Manages the simulation scenario.
More...
#include <Scenario.hpp>
Manages the simulation scenario.
Definition at line 24 of file Scenario.hpp.
◆ addCell()
void Scenario::addCell |
( |
Cell * |
c | ) |
|
|
inline |
Adds a cell to the world.
- Parameters
-
c | Pointer to the cell to add. |
Definition at line 60 of file Scenario.hpp.
◆ createCell() [1/4]
Cell * Scenario::createCell |
( |
| ) |
|
|
inline |
Creates a cell.
- Returns
- Pointer to the newly created cell.
Creates a new Cell, adds it to the world, and initializes it.
This function dynamically allocates a new Cell object, adds it to the world, and then calls the init() method on the newly created Cell.
- Returns
- A pointer to the newly created and initialized Cell.
Definition at line 147 of file Scenario.hpp.
◆ createCell() [2/4]
Creates a cell at a specific position, adds it to the world, and initializes it.
This function dynamically allocates a new Cell object, adds it to the world, and then calls the init() method on the newly created Cell.
- Parameters
-
- Returns
- A pointer to the newly created and initialized Cell.
Definition at line 110 of file Scenario.hpp.
◆ createCell() [3/4]
Creates a cell at a specific position and type, adds it to the world, and initializes it.
This function dynamically allocates a new Cell object, adds it to the world, and then calls the init() method on the newly created Cell.
- Parameters
-
pos | The position vector. |
t | The type of the cell. |
- Returns
- A pointer to the newly created and initialized Cell.
Definition at line 93 of file Scenario.hpp.
◆ createCell() [4/4]
Cell * Scenario::createCell |
( |
Type |
t | ) |
|
|
inline |
Creates a cell of a specific type, adds it to the world, and initializes it.
This function dynamically allocates a new Cell object, adds it to the world, and then calls the init() method on the newly created Cell.
- Parameters
-
- Returns
- A pointer to the newly created and initialized Cell.
Definition at line 126 of file Scenario.hpp.
◆ getDt()
double Scenario::getDt |
( |
| ) |
const |
|
inline |
Gets the time step of the world.
- Returns
- The time step.
Definition at line 67 of file Scenario.hpp.
◆ getWorld()
World & Scenario::getWorld |
( |
| ) |
|
|
inline |
Gets the world of the scenario.
- Returns
- Reference to the world.
Definition at line 51 of file Scenario.hpp.
◆ init()
Initializes the scenario with a configuration.
- Parameters
-
config | The configuration in JSON format. |
Definition at line 159 of file Scenario.hpp.
◆ loop()
Runs the main loop of the scenario.
Definition at line 173 of file Scenario.hpp.
◆ setDt()
void Scenario::setDt |
( |
double |
dt | ) |
|
|
inline |
Sets the time step of the world.
- Parameters
-
Definition at line 74 of file Scenario.hpp.
◆ setUpdateBehaviorPeriod()
void Scenario::setUpdateBehaviorPeriod |
( |
int |
n | ) |
|
|
inline |
Sets the update behavior period of the world.
- Parameters
-
n | The update behavior period. |
Definition at line 81 of file Scenario.hpp.
◆ stop()
Checks if the scenario should stop.
- Returns
- True if the scenario should stop, false otherwise.
Definition at line 185 of file Scenario.hpp.
◆ dt
double Scenario::dt = 360. |
◆ maxStep
int Scenario::maxStep = 999999 |
◆ world
The documentation for this class was generated from the following file: