coopihc.policy.BasePolicy.BasePolicy

class BasePolicy(*args, action_state=None, **kwargs)[source]

Bases: object

Base Policy class. Randomly samples from the action state. You have can provide an action state as an argument (args[0]). If no action state is provided, the policy is initialized with an action state with a single ‘None’ action.

Methods

default_value

Apply this decorator to use bundle.game_state as default value to observe if game_state = None

reset

Reset the policy

sample

Attributes

action

Return the last action.

action_keys

observation

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()[source]

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)[source]

Reset the policy

Parameters

random (bool, optional) – reset the policy, defaults to True. Here in case of subclassing BasePolicy.