Bardo.Polis.Manager (Bardo v0.1.0)
View SourceThe PolisManager process represents an interfacing point with the neuroevolutionary platform infrastructure. The module contains the functions that perform general, global tasks. Because there should be only a single polis_manager per node, representing a single neuroevolutionary platform per node.
The following list summarizes the types of functions we want to be able to execute through the polis_manager module:
- Start all the neuroevolutionary platform supporting processes
- Stop and shut down the neuroevolutionary platform
The PolisManager is the infrastructure and the system within which the the NN based agents, and the scapes they interface with, exist. It is for this reason that it was given the name 'polis', an independent and self governing city state of intelligent agents.
Summary
Functions
Backs up the DB and shuts down the application.
Returns a specification to start this module under a supervisor.
Evolve the next generation for a polis instance.
The prep function first checks whether a polis_manager process is online. If there is an online polis_manager process running on the node, then the prep function preps the system. Otherwise, it returns an error.
Send a command to a polis instance.
The setup function first checks whether a polis_manager process is online. If there is an online polis_manager process running on the node, then the setup function configures the system and starts the public scape if any. Otherwise, it returns an error.
Starts the PolisManager process. The start_link first checks whether a polis_manager process has already been spawned, by checking if one is registered. If it's not, then the GenServer.start_link function starts up the neuroevolutionary platform. Otherwise, it returns an error.
All applications are taken down smoothly, all code is unloaded, and all ports are closed before the system terminates by calling halt(Status). The stop function first checks whether a polis_manager process is online. If there is an online polis_manager process running on the node, then the stop function sends a signal to it requesting it to stop. Otherwise, it shutdowns immediately.
Stop a specific polis instance.
Update the population for a polis instance.
Functions
@spec backup_and_shutdown() :: {:error, String.t()} | :ok
Backs up the DB and shuts down the application.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Evolve the next generation for a polis instance.
The prep function first checks whether a polis_manager process is online. If there is an online polis_manager process running on the node, then the prep function preps the system. Otherwise, it returns an error.
Send a command to a polis instance.
The setup function first checks whether a polis_manager process is online. If there is an online polis_manager process running on the node, then the setup function configures the system and starts the public scape if any. Otherwise, it returns an error.
Starts the PolisManager process. The start_link first checks whether a polis_manager process has already been spawned, by checking if one is registered. If it's not, then the GenServer.start_link function starts up the neuroevolutionary platform. Otherwise, it returns an error.
@spec stop() :: {:error, String.t()} | :ok
All applications are taken down smoothly, all code is unloaded, and all ports are closed before the system terminates by calling halt(Status). The stop function first checks whether a polis_manager process is online. If there is an online polis_manager process running on the node, then the stop function sends a signal to it requesting it to stop. Otherwise, it shutdowns immediately.
Stop a specific polis instance.
Update the population for a polis instance.