Multiple Fixes:

- Config Explainer
 - Rewards
 - Destination Reach Condition
 - Additional Step Callback
This commit is contained in:
Steffen Illium
2023-11-24 14:43:49 +01:00
parent 0ec260f6a2
commit 803d0dae7f
15 changed files with 158 additions and 143 deletions

View File

@ -19,7 +19,7 @@ class Charge(Action):
def do(self, entity, state) -> Union[None, ActionResult]:
if charge_pod := h.get_first(state[b.CHARGE_PODS].by_pos(entity.pos)):
valid = h.get_first(charge_pod.charge_battery(entity, state))
valid = charge_pod.charge_battery(entity, state)
if valid:
state.print(f'{entity.name} just charged batteries at {charge_pod.name}.')
else:

View File

@ -53,7 +53,7 @@ class BatteryDecharge(Rule):
for agent in state[c.AGENT]:
if isinstance(self.per_action_costs, dict):
energy_consumption = self.per_action_costs[agent.step_result()['action']]
energy_consumption = self.per_action_costs[agent.state.identifier]
else:
energy_consumption = self.per_action_costs