mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-06-24 04:11:36 +02:00
Results resolved. Small ADjustments
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from .actions import BtryCharge
|
||||
from .actions import Charge
|
||||
from .entitites import ChargePod, Battery
|
||||
from .groups import ChargePods, Batteries
|
||||
from .rules import DoneAtBatteryDischarge, BatteryDecharge
|
||||
|
@ -8,10 +8,10 @@ from marl_factory_grid.environment import constants as c
|
||||
from marl_factory_grid.utils import helpers as h
|
||||
|
||||
|
||||
class BtryCharge(Action):
|
||||
class Charge(Action):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(b.ACTION_CHARGE)
|
||||
super().__init__(b.ACTION_CHARGE, b.REWARD_CHARGE_VALID, b.Reward_CHARGE_FAIL)
|
||||
|
||||
def do(self, entity, state) -> Union[None, ActionResult]:
|
||||
if charge_pod := h.get_first(state[b.CHARGE_PODS].by_pos(entity.pos)):
|
||||
@ -24,5 +24,4 @@ class BtryCharge(Action):
|
||||
valid = c.NOT_VALID
|
||||
state.print(f'{entity.name} failed to charged batteries at {entity.pos}.')
|
||||
|
||||
return ActionResult(entity=entity, identifier=self._identifier, validity=valid,
|
||||
reward=b.REWARD_CHARGE_VALID if valid else b.Reward_CHARGE_FAIL)
|
||||
return self.get_result(valid, entity)
|
||||
|
Reference in New Issue
Block a user