coopihc.interactiontask.ExampleTask.ExampleTask
- class ExampleTask(*args, **kwargs)[source]
Bases:
coopihc.interactiontask.InteractionTask.InteractionTask
An example algebraic task which a single task state ‘x’, which finishes when x = 4.
Methods
base assistant step
base user step
finit
Redefine this to specify the task state transitions and rewards issued.
Redefine this to specify the task state transitions and rewards issued.
Render the task on the main plot.
Redefine this to specify how to reinitialize the task before each new game.
Attributes
assistant action
parameters
round_number
The current state of the task.
Turn number.
user action
- property assistant_action
assistant action
The last action input by the assistant.
- Returns
assistant action
- Return type
- base_on_assistant_action(*args, **kwargs)
base assistant step
Wraps the assistant defined on_assistant_action() method. For now does little but provide default values, may be useful later.
- Returns
(task state, task reward, is_done flag, metadata):
- Return type
tuple(
State
, float, boolean, dictionnary)
- base_on_user_action(*args, **kwargs)
base user step
Wraps the user defined on_user_action() method. For now does little but provide default values, may be useful later.
- Returns
(task state, task reward, is_done flag, metadata):
- Return type
tuple(
State
, float, boolean, dictionnary)
- on_assistant_action(*args, **kwargs)[source]
Redefine this to specify the task state transitions and rewards issued.
- Returns
(task state, task reward, is_done flag, {})
- Return type
tuple(
State
, float, boolean, dictionnary)
- on_user_action(*args, **kwargs)[source]
Redefine this to specify the task state transitions and rewards issued.
- Returns
(task state, task reward, is_done flag, {})
- Return type
tuple(
State
, float, boolean, dictionnary)
- render(mode='text', ax_user=None, ax_assistant=None, ax_task=None)
Render the task on the main plot.
- Parameters
mode – (str) text or plot
args – (list) list of axis in order axtask, axuser, axassistant
- reset(dic=None)[source]
Redefine this to specify how to reinitialize the task before each new game.
- property turn_number
Turn number.
The turn number of the game
- Returns
turn number
- Return type
numpy.ndarray