Core
This module contains the basic types of Projective Simulation agents.
Abstract_Agent
Abstract_Agent (ECM=None, percept_processor=None, action_processor=None)
Abstract agent class any PS agent should be derived from. Asserts that the necessary methods are implemented.
| Type | Default | Details | |
|---|---|---|---|
| ECM | NoneType | None | The compulsory ECM Object to use. If kept Nonem raises error. |
| percept_processor | NoneType | None | An optional object for transforming observations prior to passing to ECM as a percept. Must have method “preprocess” |
| action_processor | NoneType | None | An optional object for transforming actions prior to passing to Environment as an actuator state. Must have method “postprocess” |
PS agents must have as parent class Abstract_Agent, and hence must contain two compulsory methods:
Abstract_Agent.update
Abstract_Agent.update ()
Updates the internal structure of the agent, typically by updating its ECM.
Abstract_Agent.deliberate
Abstract_Agent.deliberate ()
Returns the action to be taken by the agent. Typically, this would involve getting a state from the environment, passing it through the percept processor, passing it to the ECM, and then passing the output through the action processor if needed.
Basic_Agent
Basic_Agent (ECM:object=None, percept_processor:object=None)
Simple, projective simulation (PS) with arbitrary ECM. Uses the typical ECM structure (see module ECMs). Percepts are added to the ECM as new obsevations are encountered
| Type | Default | Details | |
|---|---|---|---|
| ECM | object | None | ECM object |
| percept_processor | object | None | Preprocessor object for transforming observations prior to passing to ECM as a percept. Must have method “preprocess” |
Basic_2Layer_Agent
Basic_2Layer_Agent (num_actions:int, glow:float=0.1, damp:float=0.0, glow_method:str='sum', policy:str='greedy', policy_parameters:dict=None, percept_processor=None)
Basic PS agent with a two layer ECM. Percepts are added to the ECM as new obsevations are encountered.
| Type | Default | Details | |
|---|---|---|---|
| num_actions | int | The number of available actions. If ECM = is not given, must be int | |
| glow | float | 0.1 | The glow (or eta) parameter. Won’t be used if ECM is given |
| damp | float | 0.0 | The damping (or gamma) parameter. Won’t be used if ECM is given |
| glow_method | str | sum | The method for updating the glow. See ECMs.Two_Layer for details |
| policy | str | greedy | The policy to use. See ECMs.Two_Layer for details |
| policy_parameters | dict | None | The parameters for the policy. See ECMs.Two_Layer for details |
| percept_processor | NoneType | None |