|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ascape.model.space.CollectionSpace
org.ascape.model.space.Discrete
org.ascape.model.space.Array
org.ascape.model.space.ListBase
org.ascape.model.space.Array1D
public class Array1D
A one-dimensional, fixed-size, collection of agents providing services described for space.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.ascape.model.space.CollectionSpace |
|---|
CollectionSpace.ClosestDataPoint, CollectionSpace.ConditionalIterator, CollectionSpace.CSIterator, CollectionSpace.CSMutableIterator, CollectionSpace.ListMutableRandomIterator, CollectionSpace.ListRandomIterator, CollectionSpace.MutableSubIterator, CollectionSpace.SubIterator |
| Field Summary |
|---|
| Fields inherited from class org.ascape.model.space.Array |
|---|
CACHE_RESULTS |
| Fields inherited from class org.ascape.model.space.Discrete |
|---|
performanceWarning |
| Fields inherited from class org.ascape.model.space.CollectionSpace |
|---|
collection, ESTIMATED_MAXIMUM_SIZE, extent, geometry |
| Constructor Summary | |
|---|---|
Array1D()
Constructs a one-dimensional immutable array. |
|
Array1D(CoordinateDiscrete extent)
Constructs a one-dimensional immutable array. |
|
| Method Summary | |
|---|---|
void |
construct()
Contructs the basic structure. |
Location |
findRandom()
Returns a cell randomly selected from the lattice. |
Coordinate |
findRandomCoordinate()
Returns a coordinate randomly selected from the lattice's space. |
int |
findRandomIndex()
Returns a coordinate randomly selected from the lattice's space. |
java.util.List |
findWithinImpl(Coordinate origin,
boolean includeSelf,
double dist)
Returns cells that are near the provided cell. |
Location |
get(Coordinate coordinate)
Returns the object (agent) existing at the specified coordinate. |
java.lang.Object |
get(int xPosition)
Returns the cell existing at the specified coordinate position. |
Node[] |
getCells()
Returns all agents in the space as an array of cells (use this method to avoid coercion of memebers to Node.) |
Location[] |
getLocations()
Returns all agents in the space as an array. |
int |
getSize()
Returns the size, or number of cells, (the product of all extents) of this FixedList. |
void |
initialize()
Initializes the space, ensuring that the ordering used for random draws starts consistently. |
boolean |
isCoordinateSweepNeeded()
Is a coordinate location sweep needed for this space? Intended for internal purposes. |
boolean |
isDeleteSweepNeeded()
Is a delete sweep needed for this space? Intended for internal purposes. |
boolean |
isMutable()
Is the space mutable, that is, can it change its structure at runtime? Returns false for array 1D. |
java.util.Iterator |
iterator()
Returns an iterator across all agents in this context. |
void |
populate()
Populates the space with clones of the prototype agent. |
void |
randomizeCallingOrder()
Randomizes the lookup used to determine calling order for random order execution of rules. |
ResetableIterator |
safeIterator()
Returns a context iterator across all objects in this context. |
ResetableIterator |
safeIterator(int start,
int limit)
Safe iterator. |
RandomIterator |
safeRandomIterator()
Returns a context iterator across all agents in random order. |
void |
setExtent(int size)
Sets the size of the array. |
void |
setGeometry(Geometry geometry)
Sets the geometry of this space. |
| Methods inherited from class org.ascape.model.space.ListBase |
|---|
add, add, add, add, addAll, calculateDistance, coordinateSweep, findCellAway, findCellToward, findFirstMatchInRank, findNearestMatchRank, findNearestMatchRank, findRandomMatchInRank, get, indexOf, lastIndexOf, listIterator, listIterator, remove, remove, remove, set, set, subList |
| Methods inherited from class org.ascape.model.space.Array |
|---|
findNearest, findWithin, replace, swap |
| Methods inherited from class org.ascape.model.space.CollectionSpace |
|---|
add, addAll, calculateDistance, clear, clone, conditionalIterator, conditionalIterator, contains, containsAll, countWithin, createOrder, createSpatialConditional, deleteSweep, filter, find, findMaximum, findMaximum, findMaximumWithin, findMinimum, findMinimum, findMinimumWithin, findNearest, findRandom, findRandom, findRandom, findRandomWithin, getContext, getExtent, getGeometry, getRandom, hasWithin, isEmpty, isPeriodic, iteratorCount, iteratorToList, moveAway, moveToward, newLocation, newLocation, randomInRange, randomInRange, randomIs, randomizeOrder, randomToLimit, removeAll, retainAll, safeIterators, set, setContext, setExtent, setPeriodic, setRandom, setSize, size, toArray, toArray, toList, withinIterator |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray |
| Constructor Detail |
|---|
public Array1D()
public Array1D(CoordinateDiscrete extent)
extent - a coordinate describing the size of this space| Method Detail |
|---|
public void setGeometry(Geometry geometry)
setGeometry in class ListBasegeometry - the basic geometry of this spacepublic void setExtent(int size)
setExtent in class CollectionSpacesize - the size of this spacepublic void construct()
construct in interface Spaceconstruct in class CollectionSpacepublic void populate()
populate in interface Spacepopulate in class ListBasepublic void initialize()
initialize in interface Spaceinitialize in class CollectionSpacepublic void randomizeCallingOrder()
public java.util.Iterator iterator()
CollectionSpace
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class CollectionSpacepublic ResetableIterator safeIterator()
CollectionSpace
safeIterator in interface SpacesafeIterator in class CollectionSpace
public ResetableIterator safeIterator(int start,
int limit)
Space
safeIterator in interface SpacesafeIterator in class CollectionSpacestart - the startlimit - the limit
public RandomIterator safeRandomIterator()
CollectionSpace
safeRandomIterator in interface SpacesafeRandomIterator in class CollectionSpacepublic int getSize()
getSize in interface SpacegetSize in class Discretepublic java.lang.Object get(int xPosition)
get in interface java.util.Listget in class ListBasexPosition - the x position
public Location get(Coordinate coordinate)
get in interface Spaceget in class CollectionSpacecoordinate - the coordinate
public Location findRandom()
findRandom in interface SpacefindRandom in class CollectionSpacepublic Coordinate findRandomCoordinate()
findRandomCoordinate in interface SpacefindRandomCoordinate in class CollectionSpacepublic int findRandomIndex()
public java.util.List findWithinImpl(Coordinate origin,
boolean includeSelf,
double dist)
ListBase
findWithinImpl in class ListBaseorigin - the coordinate to find cells nearincludeSelf - should supplied agent be included in the return setdist - the distance to form centralCells to return cells
public boolean isMutable()
isMutable in interface SpaceisMutable in class CollectionSpacepublic boolean isDeleteSweepNeeded()
isDeleteSweepNeeded in class CollectionSpacepublic boolean isCoordinateSweepNeeded()
isCoordinateSweepNeeded in class ListBasepublic Node[] getCells()
getCells in class Discretepublic Location[] getLocations()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||