def__init__( 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"):
Abstract agent class any PS agent should be derived from. Asserts that the necessary methods are implemented.
PS agents must have as parent class Abstract_Agent, and hence must contain two compulsory methods:
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.
def__init__( 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"):
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
def__init__( 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):
Basic PS agent with a two layer ECM. Percepts are added to the ECM as new obsevations are encountered.