|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.Environment<AgentDiscrete2D>
com.xj.anylogic.engine.EnvironmentDiscrete2D
public class EnvironmentDiscrete2D
Agent environment class for discrete 2D space
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.xj.anylogic.engine.Environment |
|---|
Environment.AgentCollection<T extends Agent> |
| Field Summary | |
|---|---|
static int |
NEIGHBORHOOD_EUCLIDEAN
|
static int |
NEIGHBORHOOD_MOORE
|
| Fields inherited from class com.xj.anylogic.engine.Environment |
|---|
LAYOUT_ARRANGED, LAYOUT_RANDOM, LAYOUT_RING, LAYOUT_SPRING_MASS, LAYOUT_USER_DEFINED, NETWORK_ALL_IN_RANGE, NETWORK_RANDOM, NETWORK_RING_LATTICE, NETWORK_SCALE_FREE, NETWORK_SMALL_WORLD, NETWORK_USER_DEFINED, SPACE_CONTINUOUS_2D, SPACE_DISCRETE_2D, TIME_CONTINUOUS, TIME_DISCRETE |
| Constructor Summary | |
|---|---|
EnvironmentDiscrete2D(ActiveObject activeObject)
Creates new environment |
|
| Method Summary | |
|---|---|
void |
applyLayout()
Rearranges agents in this environment according to the selected layout type. |
int[] |
findRandomEmptyCell()
Tries to find a pseudo-randomly located empty cell and return its row and column in the array with two elements. |
java.lang.String |
formatSpaceType()
Returns the name of the space type |
AgentDiscrete2D |
getAgentAtCell(int r,
int c)
Returns the agent located in the cell with a given row and column, or null. |
int |
getColumns()
Returns the number of columns in the space. |
int |
getLayoutType()
Returns the layout type. |
int |
getRows()
Returns the number of rows in the space. |
int |
getSpaceType()
Deprecated. |
void |
setLayoutType(int type)
Sets the layout type. |
void |
setSpaceDiscrete(double width,
double height,
int rows,
int columns,
int neighborhoodType)
Deprecated. replaced with setupSpace(double, double, int, int, int) |
void |
setupSpace(double width,
double height,
int rows,
int columns,
int neighborhoodType)
Sets the space type to discrete with the given dimensions and neighborhood type. |
| Methods inherited from class com.xj.anylogic.engine.Environment |
|---|
applyNetwork, areStepsEnabled, deliverToAll, deliverToRandom, disableSteps, enableSteps, getAgentCollection, getConnectionsPerAgent, getHeight, getNeighborLinkProbability, getNetworkType, getRandomAgent, getScaleFreeM, getWidth, layoutTypeToString, onAfterStep, onBeforeStep, onDestroy, restoreOwner, setNetworkRandom, setNetworkRingLattice, setNetworkScaleFree, setNetworkSmallWorld, setNetworkUserDefined, size, spaceTypeToString, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NEIGHBORHOOD_MOORE
public static final int NEIGHBORHOOD_EUCLIDEAN
| Constructor Detail |
|---|
public EnvironmentDiscrete2D(ActiveObject activeObject)
activeObject - owner of new environment| Method Detail |
|---|
@Deprecated public int getSpaceType()
EnvironmentEnvironment.SPACE_DISCRETE_2DEnvironment.SPACE_CONTINUOUS_2D)
getSpaceType in class Environment<AgentDiscrete2D>
@Deprecated
public void setSpaceDiscrete(double width,
double height,
int rows,
int columns,
int neighborhoodType)
setupSpace(double, double, int, int, int)
public void setupSpace(double width,
double height,
int rows,
int columns,
int neighborhoodType)
width - the width of the spaceheight - the height of the spacerows - the number of rows in the spacecolumns - the number of columns in the spaceneighborhoodType - the type of neighborhood (Euclidean, Moore)public int getRows()
public int getColumns()
public int[] findRandomEmptyCell()
null
public AgentDiscrete2D getAgentAtCell(int r,
int c)
r - the row of the cellc - the column of the cell
public void setLayoutType(int type)
type - the new layout typepublic int getLayoutType()
public void applyLayout()
setLayoutType(int)public java.lang.String formatSpaceType()
Environment
formatSpaceType in class Environment<AgentDiscrete2D>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||