#include <adevs_cellspace.h>
Public Types | |
typedef Devs< CellEvent< X >, T > | Cell |
A component model in the CellSpace. | |
Public Member Functions | |
CellSpace (long int width, long int height=1, long int depth=1) | |
Create an Width x Height x Depth CellSpace with NULL entries in the cell locations. | |
void | add (Cell *model, long int x, long int y=0, long int z=0) |
Insert a model at the x,y,z position. | |
const Cell * | getModel (long int x, long int y=0, long int z=0) const |
Get the model at location x,y,z. | |
Cell * | getModel (long int x, long int y=0, long int z=0) |
Get a mutable version of the model at x,y,z. | |
long int | getWidth () const |
Get the width of the CellSpace. | |
long int | getHeight () const |
Get the height of the CellSpace. | |
long int | getDepth () const |
Get the depth of the CellSpace. | |
void | getComponents (Set< Cell * > &c) |
Get the model's set of components. | |
void | route (const CellEvent< X > &event, Cell *model, Bag< Event< CellEvent< X >, T > > &r) |
Route events within the Cellspace. | |
~CellSpace () | |
Destructor; this destroys the components as well. |
This class describes a 3D cell space whose components accept and produce CellEvent objects. This class is meant to be useful for solving PDEs, simulating next event cell spaces, and for building other types of models represented as a space of discrete, interacting points. Output events produced by component models must be of type CellEvent, and the CellEvent (x,y,z) coordinate indicates the target cell for the event. The corresponding input event will have the same (x,y,z) value as the output event. Targets that are outside of the CellSpace will become external output events for the CellSpace model. Similarly, CellEvent objects that are injected into the CellSpace (i.e., external input events) will be delivered to the targeted cell.