Projective Simulation
  • Get started
  • Documentation
  • Tutorials
  • Research
  1. Agents
  2. Core
  • Documentation
  • Agents
    • Core
    • Foraging
  • ECMs
    • Core
    • Priming
    • State Estimators
  • Environments
    • Core
    • Foraging
    • POMDPs
    • Factorized POMDPs

On this page

  • Abstract Agent
  • Basic Agent
    • Two layer Basic PS
  • nbdev export
  • View source
  • Report an issue
  1. Agents
  2. Core

Core

This module contains the basic types of Projective Simulation agents.

Abstract Agent


source

Abstract_Agent

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:


source

Abstract_Agent.update

def update():

Updates the internal structure of the agent, typically by updating its ECM.


source

Abstract_Agent.deliberate

def 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


source

Basic_Agent

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

Two layer Basic PS


source

Basic_2Layer_Agent

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.

nbdev export

  • View source
  • Report an issue