Merge remote-tracking branch 'origin/documentation' into documentation

This commit is contained in:
Chanumask
2024-03-11 09:40:23 +01:00
10 changed files with 15 additions and 133 deletions

View File

@@ -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, {})

View File

@@ -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(

View File

@@ -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']