|
||||||||||
| 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
public abstract class Space2D
General 2D space.
| Field Summary | |
|---|---|
protected IVector2 |
areasize
Area size. |
static String |
BORDER_STRICT
Border strict mode. |
static String |
BORDER_TORUS
Border torus behavior. |
static String |
PROPERTY_BORDER
The constant for the border property. |
static String |
PROPERTY_POSITION
The constant for the position property. |
| 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 | |
|---|---|
protected |
Space2D(IVector2 areasize)
Initializes the 2D-Space. |
| Method Summary | |
|---|---|
IVector2 |
adjustPosition(IVector2 pos)
Calculate a position according to the space borders. |
IVector1 |
calculateDistance(IVector1 dx,
IVector1 dy)
Calculate the distance in the space. |
IVector2 |
getAreaSize()
Returns the size of the simulated area. |
String |
getBorderMode()
Get the border mode. |
IVector1 |
getDistance(IVector1 pos1,
IVector1 pos2,
boolean isx)
Get the distance between two coordinates (x or y). |
IVector1 |
getDistance(IVector2 pos1,
IVector2 pos2)
Get the distance between two positions. |
ISpaceObject |
getNearestObject(IVector2 position,
IVector1 maxdist,
String type)
Returns the nearest object to the given position within a maximum distance from the position. |
Set |
getNearObjects(IVector2 position,
IVector1 maxdist)
Retrieve all objects in the distance for a position |
Set |
getNearObjects(IVector2 position,
IVector1 maxdist,
IFilter filter)
Retrieve all objects in the distance for a position |
Set |
getNearObjects(IVector2 position,
IVector1 maxdist,
String type)
Retrieve all objects in the distance for a position |
IVector2 |
getRandomPosition(IVector2 distance)
Retrieves a random position within the simulation area with a minimum distance from the edge. |
Object[] |
getSpaceObjects()
Get all space objects. |
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.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 PROPERTY_POSITION
public static final String PROPERTY_BORDER
public static final String BORDER_STRICT
public static final String BORDER_TORUS
protected IVector2 areasize
| Constructor Detail |
|---|
protected Space2D(IVector2 areasize)
spaceexecutor - executor for the spaceactionexecutor - executor for component actionsareasize - the size of the 2D area| Method Detail |
|---|
public IVector2 getAreaSize()
public void setAreaSize(IVector2 areasize)
areasize - The area size.public String getBorderMode()
public void initSpaceObject(ISpaceObject ret)
initSpaceObject in class AbstractEnvironmentSpace
public void setPosition(Object id,
IVector2 pos)
id - The object id.pos - The object position.
public IVector1 getDistance(IVector2 pos1,
IVector2 pos2)
pos1 - The first position.pos2 - The second position.
public IVector1 getDistance(IVector1 pos1,
IVector1 pos2,
boolean isx)
pos1 - The first position.pos2 - The second position.
public IVector1 calculateDistance(IVector1 dx,
IVector1 dy)
dx - The distance in x.dy - The distance in y.
public IVector2 adjustPosition(IVector2 pos)
public IVector2 getRandomPosition(IVector2 distance)
distance - minimum distance from the edge, null or zero for no distance
public ISpaceObject getNearestObject(IVector2 position,
IVector1 maxdist,
String type)
position - position the object should be nearest tomaxdist - maximum distance from the position, use null for unlimited distance
public Set getNearObjects(IVector2 position,
IVector1 maxdist)
position - distance -
public Set getNearObjects(IVector2 position,
IVector1 maxdist,
String type)
position - distance -
public Set getNearObjects(IVector2 position,
IVector1 maxdist,
IFilter filter)
position - distance -
public Object[] getSpaceObjects()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||