Bardo.PopulationManager.PopulationManagerSupervisor (Bardo v0.1.0)
View SourceDynamic supervisor for population manager workers.
This module provides helper functions for starting, stopping and managing population workers, which handle the evolutionary process for populations of neural networks.
Summary
Functions
Returns a specification to start this module under a supervisor.
Get the count of running populations.
List all running population IDs.
Starts the supervisor.
Start a new population worker under the dynamic supervisor.
Stop a population worker.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec count_populations() :: {:ok, non_neg_integer()}
Get the count of running populations.
Returns
{:ok, count}
- The number of running population workers
@spec list_populations() :: {:ok, [atom()]}
List all running population IDs.
Returns
{:ok, [atom()]}
- List of running population IDs
Starts the supervisor.
Parameters
args
- Optional arguments for the supervisor
Returns
{:ok, pid}
- PID of the started supervisor process
@spec start_population(binary() | atom(), map()) :: DynamicSupervisor.on_start_child()
Start a new population worker under the dynamic supervisor.
Parameters
population_id
- Unique identifier for the populationparams
- Parameters for the population, including experiment ID, size, etc.
Returns
{:ok, pid}
- If the worker was started successfully{:error, reason}
- If there was an error starting the worker
Stop a population worker.
Parameters
population_id
- Unique identifier for the population
Returns
:ok
- If the worker was stopped successfully{:error, :not_found}
- If the worker was not found