firs commit for our new MARL algorithms library, contains working implementations of IAC, SNAC and SEAC
This commit is contained in:
@ -1,22 +1,25 @@
|
||||
def make(env_name, pomdp_r=2, max_steps=400, stack_n_frames=3, n_agents=1, individual_rewards=False):
|
||||
def make(env_name, pomdp_r=2, max_steps=400, stack_n_frames=3, n_agents=1, individual_rewards=False):
|
||||
import yaml
|
||||
from pathlib import Path
|
||||
from environments.factory.combined_factories import DirtItemFactory
|
||||
from environments.factory.factory_item import ItemFactory, ItemProperties
|
||||
from environments.factory.factory_dirt import DirtProperties, DirtFactory
|
||||
from environments.utility_classes import MovementProperties, ObservationProperties, AgentRenderOptions
|
||||
from environments.factory.factory_dirt import DirtProperties, DirtFactory, RewardsDirt
|
||||
from environments.utility_classes import AgentRenderOptions
|
||||
|
||||
with (Path(__file__).parent / 'levels' / 'parameters' / f'{env_name}.yaml').open('r') as stream:
|
||||
dictionary = yaml.load(stream, Loader=yaml.FullLoader)
|
||||
|
||||
obs_props = ObservationProperties(render_agents=AgentRenderOptions.COMBINED,
|
||||
frames_to_stack=stack_n_frames, pomdp_r=pomdp_r)
|
||||
obs_props = dict(render_agents=AgentRenderOptions.COMBINED,
|
||||
pomdp_r=pomdp_r,
|
||||
indicate_door_area=True,
|
||||
show_global_position_info=False,
|
||||
frames_to_stack=stack_n_frames)
|
||||
|
||||
factory_kwargs = dict(n_agents=n_agents, individual_rewards=individual_rewards,
|
||||
max_steps=max_steps, obs_prop=obs_props,
|
||||
mv_prop=MovementProperties(**dictionary['movement_props']),
|
||||
dirt_prop=DirtProperties(**dictionary['dirt_props']),
|
||||
record_episodes=False, verbose=False, **dictionary['factory_props']
|
||||
factory_kwargs = dict(**dictionary,
|
||||
n_agents=n_agents,
|
||||
individual_rewards=individual_rewards,
|
||||
max_steps=max_steps,
|
||||
obs_prop=obs_props,
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
return DirtFactory(**factory_kwargs).__enter__()
|
||||
|
@ -1,8 +1,12 @@
|
||||
movement_props:
|
||||
parse_doors: True
|
||||
doors_have_area: True
|
||||
done_at_collision: False
|
||||
level_name: "rooms"
|
||||
mv_prop:
|
||||
allow_diagonal_movement: True
|
||||
allow_square_movement: True
|
||||
allow_no_op: False
|
||||
dirt_props:
|
||||
dirt_prop:
|
||||
initial_dirt_ratio: 0.35
|
||||
initial_dirt_spawn_r_var : 0.1
|
||||
clean_amount: 0.34
|
||||
@ -12,8 +16,15 @@ dirt_props:
|
||||
spawn_frequency: 0
|
||||
max_spawn_ratio: 0.05
|
||||
dirt_smear_amount: 0.0
|
||||
agent_can_interact: True
|
||||
factory_props:
|
||||
parse_doors: True
|
||||
level_name: "rooms"
|
||||
doors_have_area: False
|
||||
done_when_clean: True
|
||||
rewards_base:
|
||||
MOVEMENTS_VALID: 0
|
||||
MOVEMENTS_FAIL: 0
|
||||
NOOP: 0
|
||||
USE_DOOR_VALID: 0
|
||||
USE_DOOR_FAIL: 0
|
||||
COLLISION: 0
|
||||
rewards_dirt:
|
||||
CLEAN_UP_VALID: 1
|
||||
CLEAN_UP_FAIL: 0
|
||||
CLEAN_UP_LAST_PIECE: 5
|
Reference in New Issue
Block a user