mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-06-25 04:41:34 +02:00
Multiple Fixes:
- Config Explainer - Rewards - Destination Reach Condition - Additional Step Callback
This commit is contained in:
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user