CellModules
Diffusion2D::PluginDiffusion< cell_t > Class Template Reference

Class for managing grid-based diffusion. More...

#include <PluginDiffusion.hpp>

Public Member Functions

 PluginDiffusion ()
 Default constructor. More...
 
 PluginDiffusion (int w, int h)
 Constructor with grid dimensions. More...
 
 PluginDiffusion (int size)
 Constructor with grid size. More...
 
DiffusionGridgetDiffusionGrid ()
 Gets the diffusion grid. More...
 
void addMolecule (int id, Molecule m)
 Adds a molecule to the grid. More...
 
void initDiffusionGrid (int size)
 Initializes the square diffusion grid. More...
 
void initDiffusionGrid (int w, int h)
 Initializes the diffusion grid with dimensions. More...
 
void setToreX (bool b)
 Sets the toroidal property on the x-axis. More...
 
void setToreY (bool b)
 Sets the toroidal property on the y-axis. More...
 
void setTore (bool x, bool y)
 Sets the toroidal properties on both axes. More...
 
template<typename world_t >
void preBehaviorUpdate (world_t *w)
 Pre-behavior update hook for MecaCell. More...
 

Private Attributes

DiffusionGrid grid
 

Detailed Description

template<typename cell_t>
class Diffusion2D::PluginDiffusion< cell_t >

Class for managing grid-based diffusion.

Template Parameters
cell_tType of the cell.

Definition at line 27 of file PluginDiffusion.hpp.

Constructor & Destructor Documentation

◆ PluginDiffusion() [1/3]

template<typename cell_t >
Diffusion2D::PluginDiffusion< cell_t >::PluginDiffusion ( )
inline

Default constructor.

Definition at line 37 of file PluginDiffusion.hpp.

◆ PluginDiffusion() [2/3]

template<typename cell_t >
Diffusion2D::PluginDiffusion< cell_t >::PluginDiffusion ( int  w,
int  h 
)
inline

Constructor with grid dimensions.

Parameters
wWidth of the grid.
hHeight of the grid.

Definition at line 45 of file PluginDiffusion.hpp.

◆ PluginDiffusion() [3/3]

template<typename cell_t >
Diffusion2D::PluginDiffusion< cell_t >::PluginDiffusion ( int  size)
inline

Constructor with grid size.

Parameters
sizeSize of the square grid.

Definition at line 54 of file PluginDiffusion.hpp.

Member Function Documentation

◆ addMolecule()

template<typename cell_t >
void Diffusion2D::PluginDiffusion< cell_t >::addMolecule ( int  id,
Molecule  m 
)
inline

Adds a molecule to the grid.

Parameters
idid of the molecule. if you use Enum, you can cast it to int.
mMolecule to be added.

Definition at line 71 of file PluginDiffusion.hpp.

◆ getDiffusionGrid()

template<typename cell_t >
DiffusionGrid * Diffusion2D::PluginDiffusion< cell_t >::getDiffusionGrid ( )
inline

Gets the diffusion grid.

Returns
Pointer to the DiffusionGrid.

Definition at line 63 of file PluginDiffusion.hpp.

◆ initDiffusionGrid() [1/2]

template<typename cell_t >
void Diffusion2D::PluginDiffusion< cell_t >::initDiffusionGrid ( int  size)
inline

Initializes the square diffusion grid.

Parameters
sizeSize of the grid.

Definition at line 78 of file PluginDiffusion.hpp.

◆ initDiffusionGrid() [2/2]

template<typename cell_t >
void Diffusion2D::PluginDiffusion< cell_t >::initDiffusionGrid ( int  w,
int  h 
)
inline

Initializes the diffusion grid with dimensions.

Parameters
wWidth of the grid.
hHeight of the grid.

Definition at line 86 of file PluginDiffusion.hpp.

◆ preBehaviorUpdate()

template<typename cell_t >
template<typename world_t >
void Diffusion2D::PluginDiffusion< cell_t >::preBehaviorUpdate ( world_t *  w)
inline

Pre-behavior update hook for MecaCell.

Computes and updates the molecule quantity for each cell.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 119 of file PluginDiffusion.hpp.

◆ setTore()

template<typename cell_t >
void Diffusion2D::PluginDiffusion< cell_t >::setTore ( bool  x,
bool  y 
)
inline

Sets the toroidal properties on both axes.

Parameters
xBoolean value for the x-axis.
yBoolean value for the y-axis.

Definition at line 108 of file PluginDiffusion.hpp.

◆ setToreX()

template<typename cell_t >
void Diffusion2D::PluginDiffusion< cell_t >::setToreX ( bool  b)
inline

Sets the toroidal property on the x-axis.

Parameters
bBoolean value for the toroidal property.

Definition at line 93 of file PluginDiffusion.hpp.

◆ setToreY()

template<typename cell_t >
void Diffusion2D::PluginDiffusion< cell_t >::setToreY ( bool  b)
inline

Sets the toroidal property on the y-axis.

Parameters
bBoolean value for the toroidal property.

Definition at line 100 of file PluginDiffusion.hpp.

Member Data Documentation

◆ grid

template<typename cell_t >
DiffusionGrid Diffusion2D::PluginDiffusion< cell_t >::grid
private

Molecule grid

Definition at line 30 of file PluginDiffusion.hpp.


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