neosim.implementation
Class Grid3DPopulation
java.lang.Object
|
+--neosim.implementation.PopulationNodeImpl
|
+--neosim.implementation.PopulationImpl
|
+--neosim.implementation.PopulationBuilderImpl
|
+--neosim.implementation.Grid3DPopulation
- public class Grid3DPopulation
- extends PopulationBuilderImpl
A Population builder which constructs a 3D mesh
of cells with a given start point / spacing.
Requires entities with a position.
- See Also:
- Serialized Form
Constructor Summary |
Grid3DPopulation(java.lang.String name,
PopulationNode parent,
int xdim,
int ydim,
int zdim,
double xorig,
double yorig,
double zorig,
double xdelta,
double ydelta,
double zdelta,
EntityClass ec)
Builds size instances of entity class ec. |
Method Summary |
int |
getIndex(int x,
int y,
int z)
Get global idx given x,y,z |
int |
getXdim()
Return the X dimensions of the grid |
int |
getXidx(int globi)
Get x index given global idx |
int |
getYdim()
Return the Y dimensions of the grid |
int |
getYidx(int globi)
|
int |
getZdim()
Return the Z dimensions of the grid |
int |
getZidx(int globi)
|
void |
setEntityPos(Entity3D e,
int index)
Set entity pos |
void |
setRandDispls(double x,
double y,
double z)
Set the mag of the random displs to add to each position
At present this is a uniform random # +/- these values |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Grid3DPopulation
public Grid3DPopulation(java.lang.String name,
PopulationNode parent,
int xdim,
int ydim,
int zdim,
double xorig,
double yorig,
double zorig,
double xdelta,
double ydelta,
double zdelta,
EntityClass ec)
- Builds size instances of entity class ec.
Entities must implement the Entity3D.
- Parameters:
name
- the population nameparent
- the parent populationec
- the class of entities to buildei
- the initialisation to apply to each entity
getXidx
public int getXidx(int globi)
- Get x index given global idx
getYidx
public int getYidx(int globi)
getZidx
public int getZidx(int globi)
getIndex
public int getIndex(int x,
int y,
int z)
- Get global idx given x,y,z
setEntityPos
public void setEntityPos(Entity3D e,
int index)
- Set entity pos
getXdim
public int getXdim()
- Return the X dimensions of the grid
getYdim
public int getYdim()
- Return the Y dimensions of the grid
getZdim
public int getZdim()
- Return the Z dimensions of the grid
setRandDispls
public void setRandDispls(double x,
double y,
double z)
- Set the mag of the random displs to add to each position
At present this is a uniform random # +/- these values