coopihc.policy.ExamplePolicy.ExamplePolicy
- class ExamplePolicy(*args, action_state=None, **kwargs)[source]
Bases:
coopihc.policy.BasePolicy.BasePolicy
A simple policy which assumes that the agent using it has a ‘goal’ state and that the task has an ‘x’ state. x is compared to the goal and appropriate action is taken to make sure x reaches the goal.
Methods
Apply this decorator to use bundle.game_state as default value to observe if game_state = None
Reset the policy
sample
Attributes
Return the last action.
action_keys
Return the last observation.
parameters
state
unwrapped
- property action
Return the last action.
- Returns
last action
- Return type
State<coopihc.base.StateElement.StateElement>
- default_value()
Apply this decorator to use bundle.game_state as default value to observe if game_state = None
- property observation
Return the last observation.
- Returns
last observation
- Return type
State<coopihc.base.State.State>
- reset(random=True)
Reset the policy
- Parameters
random (bool, optional) – reset the policy, defaults to True. Here in case of subclassing BasePolicy.