Bardo.Examples.Applications.Flatland (Bardo v0.1.0)

View Source

Main setup module for the Flatland experiment.

This module provides functions to configure and run Flatland simulations with evolving predator and prey agents.

Summary

Functions

configure(experiment_id, predator_population_size, prey_population_size, plant_quantity, simulation_steps, generations \\ 50)

@spec configure(
  atom(),
  pos_integer(),
  pos_integer(),
  pos_integer(),
  pos_integer(),
  pos_integer()
) ::
  map()

Configure a basic Flatland experiment with predator and prey.

Parameters:

  • experiment_id: Unique identifier for the experiment
  • predator_population_size: Number of predator agents
  • prey_population_size: Number of prey agents
  • plant_quantity: Number of plants in the environment
  • simulation_steps: Number of simulation steps per evaluation
  • generations: Number of generations to evolve (defaults to 50)

Returns the experiment configuration map.

run(experiment_id, predator_population_size \\ 20, prey_population_size \\ 20, plant_quantity \\ 40, simulation_steps \\ 1000, generations \\ 50)

@spec run(
  atom(),
  pos_integer(),
  pos_integer(),
  pos_integer(),
  pos_integer(),
  pos_integer()
) ::
  :ok | {:error, any()}

Run a Flatland experiment with the given configuration.

Parameters:

  • experiment_id: Unique identifier for the experiment
  • predator_population_size: Number of predator agents (default: 20)
  • prey_population_size: Number of prey agents (default: 20)
  • plant_quantity: Number of plants in the environment (default: 40)
  • simulation_steps: Number of simulation steps per evaluation (default: 1000)
  • generations: Number of generations to evolve (default: 50)

Returns :ok if the experiment was started successfully.

visualize(experiment_id)

@spec visualize(atom()) :: :ok | {:error, any()}

Load and visualize the best agents from a completed Flatland experiment.

Parameters:

  • experiment_id: ID of the completed experiment

Returns :ok if visualization was started successfully.