Bardo.AgentManager.PrivateScape behaviour (Bardo v0.1.0)

View Source

Defines generic private scape behavior.

Scapes are self contained simulated worlds or virtual environments, that is, they are not necessarily physical. They can be thought of as a way of interfacing with the problem in question. Scapes are composed of two parts, a simulation of an environment or a problem we are applying the NN to, and a function that can keep track of the NN's performance. Scapes run outside the NN systems, as independent processes with which the NNs interact using their sensors and actuators. There are two types of scapes. One type of scape, private, is spawned for each NN during the NN's creation, and destroyed when that NN is taken offline. Another type of scape, public, is persistent, they exist regardless of the NNs, and allow multiple NNs to interact with them at the same time, and thus they can allow those NNs to interact with each other too. This module defines the private scape.

Summary

Callbacks

Callback to actuate on the environment.

Callback to initialize the private scape module state.

Callback to sense input from the environment.

Optional callback for cleanup when terminating.

Functions

Performs various PrivateScape functions e.g. move, push, etc. The scape API is problem dependent. This function provides an interface to call various functions defined by the PrivateScape in question.

Returns a specification to start this module under a supervisor.

Gathers sensory inputs from the environment.

Spawns the PrivateScape process.

Callbacks

actuate(function, params, agent_id, state)

@callback actuate(
  function :: atom(),
  params :: any(),
  agent_id :: tuple(),
  state :: any()
) ::
  {result :: {[float()], integer() | atom()}, new_mod_state :: any()}

Callback to actuate on the environment.

init(params)

@callback init(params :: any()) :: {:ok, mod_state :: any()}

Callback to initialize the private scape module state.

sense(params, state)

@callback sense(params :: any(), state :: any()) ::
  {result :: atom() | [float()], new_mod_state :: any()}

Callback to sense input from the environment.

terminate(reason, mod_state)

(optional)
@callback terminate(reason :: atom(), mod_state :: any()) :: :ok

Optional callback for cleanup when terminating.

Functions

actuate(pid, agent_id, actuator_pid, function, params)

@spec actuate(pid(), tuple(), pid(), atom(), any()) :: :ok

Performs various PrivateScape functions e.g. move, push, etc. The scape API is problem dependent. This function provides an interface to call various functions defined by the PrivateScape in question.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

sense(pid, agent_id, sensor_pid, params)

@spec sense(pid(), tuple(), pid(), any()) :: :ok

Gathers sensory inputs from the environment.

start_link(agent_id, mod)

@spec start_link(tuple(), atom()) :: {:ok, pid()}

Spawns the PrivateScape process.