CellModules
Simu Class Reference

Public Member Functions

 Simu (string params)
 
 Simu (string params, int _seed, bool benchmark)
 
void update ()
 Updates the simulation by one time step. More...
 
void update (int nbSteps)
 Updates the simulation by multiple time steps. More...
 
int getCurrentStep ()
 Gets the current number of time steps. More...
 
double getTime (char format)
 Gets the elapsed time in a given format. More...
 
int getSeed () const
 Gets the seed used for random number generation. More...
 
vector< PrimoCell< CellBody > * > * _getCells ()
 Gets the cells in the simulation. More...
 
void showBenchmarksSummaries () const
 prints the benchmark summaries. More...
 
string _getBenchmarksJSON () const
 
string __repr__ ()
 

Public Attributes

CellPlugin< PrimoCell< CellBody > > * plugins
 Cell plugins. More...
 

Private Member Functions

void setStaticVariables ()
 

Private Attributes

scenario_t scenario
 
MecaCell::Config::random_engine_t local_random_engine
 
int seed = -1
 

Detailed Description

Simu - Main class of isiCell python wrapper

Parameters

: params : dict | str The simulation parameters in JSON format.

: seed : Optional[int] The seed for the random generators. If not provided, the seed is random.

: benchmark : Optional[bool] Whether to enable benchmarking. If not provided, benchmarking is disabled.

Attributes

: cells : CellVector provides high-performance access to all cell properties.

it's also an iterator to access each cells.

: plugins : CellPlugin allows access to the plugin part of each module.

Definition at line 31 of file simu.cpp.

Constructor & Destructor Documentation

◆ Simu() [1/2]

Simu::Simu ( string  params)
inline

Definition at line 48 of file simu.cpp.

◆ Simu() [2/2]

Simu::Simu ( string  params,
int  _seed,
bool  benchmark 
)
inline

Definition at line 56 of file simu.cpp.

Member Function Documentation

◆ __repr__()

string Simu::__repr__ ( )
inline

Definition at line 156 of file simu.cpp.

◆ _getBenchmarksJSON()

string Simu::_getBenchmarksJSON ( ) const
inline

Definition at line 152 of file simu.cpp.

◆ _getCells()

vector< PrimoCell< CellBody > * > * Simu::_getCells ( )
inline

Gets the cells in the simulation.

This method advances the simulation by a single time step.

Definition at line 138 of file simu.cpp.

◆ getCurrentStep()

int Simu::getCurrentStep ( )
inline

Gets the current number of time steps.

Returns
The current number of time steps in the simulation.

Definition at line 95 of file simu.cpp.

◆ getSeed()

int Simu::getSeed ( ) const
inline

Gets the seed used for random number generation.

Returns
The seed value.

Definition at line 129 of file simu.cpp.

◆ getTime()

double Simu::getTime ( char  format)
inline

Gets the elapsed time in a given format.

Parameters
formatThe time format ('d' for days, 'h' for hours, 'm' for minutes, 's' for seconds).
Returns
The elapsed time in the given format.
Exceptions
std::invalid_argumentif the format is invalid.

Definition at line 109 of file simu.cpp.

◆ setStaticVariables()

void Simu::setStaticVariables ( )
inlineprivate

Definition at line 36 of file simu.cpp.

◆ showBenchmarksSummaries()

void Simu::showBenchmarksSummaries ( ) const
inline

prints the benchmark summaries.

It shows the time spent in each module hook during the simulation updates. It can help identify performance bottlenecks and optimize the simulation.

Definition at line 148 of file simu.cpp.

◆ update() [1/2]

void Simu::update ( )
inline

Updates the simulation by one time step.

This method advances the simulation by a single time step.

Definition at line 72 of file simu.cpp.

◆ update() [2/2]

void Simu::update ( int  nbSteps)
inline

Updates the simulation by multiple time steps.

This method advances the simulation by a given number of time steps.

Parameters
nbStepsThe number of time steps to advance.

Definition at line 84 of file simu.cpp.

Member Data Documentation

◆ local_random_engine

MecaCell::Config::random_engine_t Simu::local_random_engine
private

Definition at line 34 of file simu.cpp.

◆ plugins

CellPlugin<PrimoCell<CellBody> >* Simu::plugins

Cell plugins.

allows access to the plugin part of each module.

Definition at line 46 of file simu.cpp.

◆ scenario

scenario_t Simu::scenario
private

Definition at line 33 of file simu.cpp.

◆ seed

int Simu::seed = -1
private

Definition at line 35 of file simu.cpp.


The documentation for this class was generated from the following file: