Bardo.ScapeManager.Scape (Bardo v0.1.0)

View Source

Scapes are self-contained simulated worlds or virtual environments.

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 neural network to, and a function that can keep track of the neural network's performance.

Scapes run outside the neural network systems, as independent processes with which the neural networks interact using their sensors and actuators. There are two types of scapes:

  1. Private scapes are spawned for each neural network during creation, and destroyed when that neural network is taken offline.
  2. Public scapes are persistent - they exist regardless of the neural networks, and allow multiple neural networks to interact with them at the same time, enabling those networks to interact with each other.

This module defines the public scape.

Summary

Functions

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

Returns a specification to start this module under a supervisor.

Enter public scape.

Insert point at X,Y into tree.

Leave public scape.

Move the agent to a different point in the tree.

Query a specific area within the scape.

Gather sensory inputs from the environment (Public Scape).

Starts the Scape process.

Lookup agent in tree.

Functions

actuate(agent_id, actuator_pid, function, params)

@spec actuate(Bardo.Models.agent_id(), pid(), atom(), any()) :: :ok

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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

enter(agent_id, params)

@spec enter(Bardo.Models.agent_id(), any()) :: :ok

Enter public scape.

insert(x, y, agent_id)

@spec insert(float(), float(), Bardo.Models.agent_id()) :: boolean()

Insert point at X,Y into tree.

leave(agent_id, params)

@spec leave(Bardo.Models.agent_id(), any()) :: :ok

Leave public scape.

move(x, y, agent_id)

@spec move(float(), float(), Bardo.Models.agent_id()) :: boolean()

Move the agent to a different point in the tree.

query_area(x, y, w, h)

@spec query_area(float(), float(), float(), float()) :: list()

Query a specific area within the scape.

sense(agent_id, sensor_pid, params)

@spec sense(Bardo.Models.agent_id(), pid(), any()) :: :ok

Gather sensory inputs from the environment (Public Scape).

start_link(x, y, width, height, mod_name)

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

Starts the Scape process.

whereis(agent_id)

@spec whereis(Bardo.Models.agent_id()) :: {float(), float()} | :not_found

Lookup agent in tree.