CellModules
PluginDiffusion.hpp
Go to the documentation of this file.
1#ifndef ONKO3D_3_0_PLUGINDIFFUSION_HPP
2#define ONKO3D_3_0_PLUGINDIFFUSION_HPP
3
9#include <vector>
10#include <mecacell/mecacell.h>
11#include <math.h>
12#include "DiffusionGrid.hpp"
13
18namespace Diffusion2D {
19
26 template<typename cell_t>
28
29 private:
32 public:
33
37 inline PluginDiffusion() : grid() {}
38
45 inline PluginDiffusion(int w, int h) {
46 grid.initGrid(w, h);
47 }
48
54 inline PluginDiffusion(int size) {
55 grid.initGrid(size);
56 }
57
63 inline DiffusionGrid* getDiffusionGrid() { return &grid; }
64
71 inline void addMolecule(int id, Molecule m) { grid.addMolecule(id, m); }
72
78 inline void initDiffusionGrid(int size) { grid.initGrid(size); }
79
86 inline void initDiffusionGrid(int w, int h) { grid.initGrid(w, h); }
87
93 inline void setToreX(bool b) { grid.setToreX(b); }
94
100 inline void setToreY(bool b) { grid.setToreY(b); }
101
108 inline void setTore(bool x, bool y) { grid.setTore(x, y); }
109
118 template<typename world_t>
119 void preBehaviorUpdate(world_t *w) {
121 }
122 };
123}
124
125#endif //ONKO3D_3_0_PLUGINDIFFUSION_HPP
Manages a 2D grid for molecule diffusion.
Manages a grid of molecules for diffusion.
void initGrid(int w, int h)
Initializes the grid with dimensions.
void setToreX(bool b)
Sets the toroidal property on the x-axis.
void setToreY(bool b)
Sets the toroidal property on the y-axis.
void setTore(bool x, bool y)
Sets the toroidal properties on both axes.
void addMolecule(int id, Molecule m)
Adds a molecule to the grid.
void computeMolecules(world_t *w)
Computes the quantities of molecules in the grid.
Class for managing grid-based diffusion.
PluginDiffusion()
Default constructor.
DiffusionGrid * getDiffusionGrid()
Gets the diffusion grid.
void setToreY(bool b)
Sets the toroidal property on the y-axis.
void preBehaviorUpdate(world_t *w)
Pre-behavior update hook for MecaCell.
void setToreX(bool b)
Sets the toroidal property on the x-axis.
void initDiffusionGrid(int size)
Initializes the square diffusion grid.
void setTore(bool x, bool y)
Sets the toroidal properties on both axes.
void addMolecule(int id, Molecule m)
Adds a molecule to the grid.
void initDiffusionGrid(int w, int h)
Initializes the diffusion grid with dimensions.
PluginDiffusion(int size)
Constructor with grid size.
PluginDiffusion(int w, int h)
Constructor with grid dimensions.
Namespace for 2D diffusion-related classes and functions.
Represents a molecule with diffusion properties.