- All Superinterfaces:
AgentExtension
,ExtEnvironmentInteractive
,ExtEnvironmentWithLayout
,ExtWithSpaceType
,Serializable
public interface ExtEnvironmentDiscrete extends ExtEnvironmentInteractive, ExtEnvironmentWithLayout, ExtWithSpaceType
Agent environment extension for discrete 2D space
- Author:
- AnyLogic North America, LLC https://anylogic.com
Modifier and Type | Method | Description |
---|---|---|
double | cToX_xjal |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
Agent | getAgentAtCell |
Returns the agent located in the cell with a given row and column, or null.
|
NeighborhoodType | getNeighborhoodType() |
Returns the type of neighbourhood (Euclidean, Moore)
|
boolean | isCellInsideSpace | |
void | putAgent_xjal | |
CellPosition | randomEmptyCell() |
Tries to find a pseudo-randomly located empty cell and return its row and column in
the array with two elements.
The current implementation is 100% fairly random. |
double | rToY_xjal |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
void | setupSpace |
Sets the space type to discrete with the given dimensions and neighbourhood
type.
|
double | spaceCellHeight() |
Returns the height of the cell in discrete space.
|
double | spaceCellWidth() |
Returns the width of the cell in discrete space.
|
int | spaceColumns() |
Returns the number of columns in the space.
|
double | spaceHeight() |
Returns the height of environment space.
|
int | spaceRows() |
Returns the number of rows in the space.
|
double | spaceWidth() |
Returns the width of environment space.
|
void | swapAgents_xjal |
applyNetwork, applyNetwork, areStepsEnabled, deliverToAllAgentsInside, deliverToRandomAgentInside, disableSteps, enableSteps, getNetworkConnectionsPerAgent, getNetworkNeighborLinkProbability, getNetworkScaleFreeM, getNetworkType, getSpaceType, randomAgentExcept, randomAgentExcept, randomAgentInside, randomAgentInside, register_xjal, register_xjal, setNetworkRandom, setNetworkRingLattice, setNetworkScaleFree, setNetworkSmallWorld, setNetworkType_xjal, setNetworkUserDefined, size, toStringNetwork_xjal, toStringSpace_xjal, unregister_xjal
void setupSpace(double width, double height, int rows, int columns, NeighborhoodType neighborhoodType)
Sets the space type to discrete with the given dimensions and neighbourhood
type. A cell in such environment will have a size of (width/columns) by
(height/rows).
This method should only be called when the environment is empty.
This method should only be called when the environment is empty.
- Parameters:
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 neighbourhood (Euclidean, Moore)
double spaceWidth()
Returns the width of environment space.
- Returns:
- the width of environment space
double spaceHeight()
Returns the height of environment space.
- Returns:
- the height of environment space
double spaceCellWidth()
Returns the width of the cell in discrete space.
- Returns:
- the width of the cell in discrete space
double spaceCellHeight()
Returns the height of the cell in discrete space.
- Returns:
- the height of the cell in discrete space
int spaceRows()
Returns the number of rows in the space.
- Returns:
- the number of rows in the space
int spaceColumns()
Returns the number of columns in the space.
- Returns:
- the number of columns in the space
NeighborhoodType getNeighborhoodType()
Returns the type of neighbourhood (Euclidean, Moore)
- Returns:
- the type of neighbourhood (Euclidean, Moore)
CellPosition randomEmptyCell()
Tries to find a pseudo-randomly located empty cell and return its row and column in
the array with two elements.
The current implementation is 100% fairly random.
The current implementation is 100% fairly random.
- Returns:
- the cell position (row and column) of the empty cell, or
null
Agent getAgentAtCell(int r, int c)
Returns the agent located in the cell with a given row and column, or null.
- Parameters:
r
- the row of the cellc
- the column of the cell- Returns:
- the agent at (r,c) or null
@AnyLogicInternalAPI void swapAgents_xjal(int r, int c, int r2, int c2)
boolean isCellInsideSpace(int r, int c)
@AnyLogicInternalAPI double cToX_xjal(int c)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
@AnyLogicInternalAPI double rToY_xjal(int r)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
@AnyLogicInternalAPI void putAgent_xjal(Agent a, int r, int c)