mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-11-02 13:37:27 +01:00
Merge remote-tracking branch 'origin/documentation' into documentation
This commit is contained in:
@@ -132,13 +132,25 @@ class FactoryConfigParser(object):
|
||||
# Actions
|
||||
conf_actions = self.agents[name]['Actions']
|
||||
actions = list()
|
||||
# Actions:
|
||||
# Allowed
|
||||
# - Noop
|
||||
# - Move8
|
||||
# ----
|
||||
# Noop:
|
||||
# South:
|
||||
# reward_fail: 0.5
|
||||
# ----
|
||||
# Forbidden
|
||||
# - South:
|
||||
# reward_fail: 0.5
|
||||
|
||||
if isinstance(conf_actions, dict):
|
||||
conf_kwargs = conf_actions.copy()
|
||||
conf_actions = list(conf_actions.keys())
|
||||
elif isinstance(conf_actions, list):
|
||||
conf_kwargs = {}
|
||||
if isinstance(conf_actions, dict):
|
||||
if any(isinstance(x, dict) for x in conf_actions):
|
||||
raise ValueError
|
||||
pass
|
||||
for action in conf_actions:
|
||||
@@ -155,6 +167,7 @@ class FactoryConfigParser(object):
|
||||
except AttributeError:
|
||||
class_or_classes = locate_and_import_class(action, self.custom_modules_path)
|
||||
try:
|
||||
# Handle Lists of Actions (e.g., Move8, Move4, Default)
|
||||
parsed_actions.extend(class_or_classes)
|
||||
for actions_class in class_or_classes:
|
||||
conf_kwargs[actions_class.__name__] = conf_kwargs.get(action, {})
|
||||
|
||||
@@ -100,7 +100,6 @@ class EnvRecorder(Wrapper):
|
||||
n_dests=0,
|
||||
dwell_time=0,
|
||||
spawn_frequency=0,
|
||||
spawn_in_other_zone=False,
|
||||
spawn_mode=''
|
||||
)
|
||||
rewards_dest = dict(
|
||||
|
||||
@@ -15,7 +15,7 @@ OBSERVATIONS = 'Observations'
|
||||
RULES = 'Rule'
|
||||
TESTS = 'Tests'
|
||||
EXCLUDED = ['identifier', 'args', 'kwargs', 'Move', 'Agent', 'GlobalPositions', 'Walls', 'Gamestate', 'Path',
|
||||
'Iterable', 'Move', 'Result', 'TemplateRule', 'Entities', 'EnvObjects', 'Zones', 'Collection',
|
||||
'Iterable', 'Move', 'Result', 'TemplateRule', 'Entities', 'EnvObjects', 'Collection',
|
||||
'State', 'Object', 'default_valid_reward', 'default_fail_reward', 'size']
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user