|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.commons.SimplePropertyObject
jadex.commons.meta.TypedPropertyObject
jadex.application.space.envsupport.environment.SynchronizedPropertyObject
jadex.application.space.envsupport.environment.AbstractEnvironmentSpace
jadex.application.space.envsupport.environment.space2d.Space2D
jadex.application.space.envsupport.environment.space2d.Grid2D
public class Grid2D
2D grid environment.
| Field Summary | |
|---|---|
static String |
DEFAULT_NAME
The default ID for this space. |
static String |
NEIGHBORHOOD_MOORE
The moore neighborhood. |
static String |
NEIGHBORHOOD_VON_NEUMANN
The von neumann neighborhood. |
protected MultiCollection |
objectsygridpos
All simobject id's accessible per position. |
static String |
PROPERTY_NEIGHBORHOOD
The neighborhood property. |
| Fields inherited from class jadex.application.space.envsupport.environment.space2d.Space2D |
|---|
areasize, BORDER_STRICT, BORDER_TORUS, PROPERTY_BORDER, PROPERTY_POSITION |
| Fields inherited from class jadex.application.space.envsupport.environment.AbstractEnvironmentSpace |
|---|
actionlist, actions, application, avatarmappings, dataconsumers, dataproviders, dataviewmappings, fetcher, initialavatars, listeners, name, objectidcounter, objecttypes, objecttypesMeta, perceptgenerators, perceptlist, perceptprocessors, percepttypes, processes, processtypes, spaceobjects, spaceobjectsbyowner, spaceobjectsbytype, taskidcounter, tasktypes, views, zombieobjects |
| Fields inherited from class jadex.application.space.envsupport.environment.SynchronizedPropertyObject |
|---|
monitor |
| Fields inherited from class jadex.commons.SimplePropertyObject |
|---|
pcs, properties |
| Constructor Summary | |
|---|---|
Grid2D()
Creates a new ContinuousSpace2D with the default name. |
|
Grid2D(IVector2 areasize)
Creates a new ContinuousSpace2D with the default name. |
|
Grid2D(Object name,
IVector2 areasize)
Creates a new ContinuousSpace2D with a special ID. |
|
| Method Summary | |
|---|---|
IVector1 |
calculateDistance(IVector1 dx,
IVector1 dy)
Calculate the distance in the space. |
void |
destroySpaceObject(Object id)
Destroys an object in this space. |
IVector2 |
getEmptyGridPosition()
Get an empty position in the grid. |
Set |
getNearObjects(IVector2 position,
IVector1 distance,
String type)
Retrieve all objects in the distance for a position. |
String |
getNeighborhood()
Get the neighborhood. |
IVector1 |
getShortestDirection(IVector1 pos1,
IVector1 pos2,
boolean isx)
Get the shortest (direct) direction between two coordinates. |
Collection |
getSpaceObjectsByGridPosition(IVector2 position,
Object type)
Get all SimObjects from a specific type at a specific grid position |
void |
initSpaceObject(ISpaceObject ret)
Init an object in this space. |
void |
setAreaSize(IVector2 areasize)
Set the area size. |
void |
setPosition(Object id,
IVector2 pos)
Set the position of an object. |
| Methods inherited from class jadex.application.space.envsupport.environment.space2d.Space2D |
|---|
adjustPosition, getAreaSize, getBorderMode, getDistance, getDistance, getNearestObject, getNearObjects, getNearObjects, getRandomPosition, getSpaceObjects |
| Methods inherited from class jadex.application.space.envsupport.environment.SynchronizedPropertyObject |
|---|
addPropertyChangeListener, getMonitor, getPropertyNames, hasProperty, removePropertyChangeListener, setProperty |
| Methods inherited from class jadex.commons.meta.TypedPropertyObject |
|---|
getMetaData, getMetaDatas |
| Methods inherited from class jadex.commons.SimplePropertyObject |
|---|
getProperties, setProperties |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jadex.commons.IPropertyObject |
|---|
getPropertyNames, hasProperty, setProperty |
| Field Detail |
|---|
public static final String DEFAULT_NAME
public static final String NEIGHBORHOOD_MOORE
public static final String NEIGHBORHOOD_VON_NEUMANN
public static final String PROPERTY_NEIGHBORHOOD
protected MultiCollection objectsygridpos
| Constructor Detail |
|---|
public Grid2D()
ContinuousSpace2D with the default name.
clockService - the clock servicetimeCoefficient - the time coefficient for time differences.areaSize - the size of the 2D areapublic Grid2D(IVector2 areasize)
ContinuousSpace2D with the default name.
actionexecutor - executor for component actionsareasize - the size of the 2D area
public Grid2D(Object name,
IVector2 areasize)
ContinuousSpace2D with a special ID.
name - the name of this spaceareasize - the size of the 2D areaactionexecutor - executor for component actions| Method Detail |
|---|
public void setAreaSize(IVector2 areasize)
setAreaSize in class Space2Dareasize - The area size.public String getNeighborhood()
public Collection getSpaceObjectsByGridPosition(IVector2 position,
Object type)
public IVector2 getEmptyGridPosition()
IVector2 position.
public void setPosition(Object id,
IVector2 pos)
setPosition in class Space2Did - The object id.pos - The object position.public void initSpaceObject(ISpaceObject ret)
initSpaceObject in class Space2Dpublic void destroySpaceObject(Object id)
destroySpaceObject in interface IEnvironmentSpacedestroySpaceObject in class AbstractEnvironmentSpaceobjectId - the object's ID
public Set getNearObjects(IVector2 position,
IVector1 distance,
String type)
getNearObjects in class Space2Dposition - The position.distance - The distance.type - The type (or null for all objects).
public IVector1 calculateDistance(IVector1 dx,
IVector1 dy)
calculateDistance in class Space2Ddx - The distance in x.dy - The distance in y.
public IVector1 getShortestDirection(IVector1 pos1,
IVector1 pos2,
boolean isx)
pos1 - The first position.pos2 - The second position.isx - The flag indicating if x or y).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||