|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 spaceMethod Detail |
---|
public void setGeometry(Geometry geometry)
setGeometry
in class ListBase
geometry
- the basic geometry of this spacepublic void setExtent(int size)
setExtent
in class CollectionSpace
size
- the size of this spacepublic void construct()
construct
in interface Space
construct
in class CollectionSpace
public void populate()
populate
in interface Space
populate
in class ListBase
public void initialize()
initialize
in interface Space
initialize
in class CollectionSpace
public void randomizeCallingOrder()
public java.util.Iterator iterator()
CollectionSpace
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
iterator
in class CollectionSpace
public ResetableIterator safeIterator()
CollectionSpace
safeIterator
in interface Space
safeIterator
in class CollectionSpace
public ResetableIterator safeIterator(int start, int limit)
Space
safeIterator
in interface Space
safeIterator
in class CollectionSpace
start
- the startlimit
- the limit
public RandomIterator safeRandomIterator()
CollectionSpace
safeRandomIterator
in interface Space
safeRandomIterator
in class CollectionSpace
public int getSize()
getSize
in interface Space
getSize
in class Discrete
public java.lang.Object get(int xPosition)
get
in interface java.util.List
get
in class ListBase
xPosition
- the x position
public Location get(Coordinate coordinate)
get
in interface Space
get
in class CollectionSpace
coordinate
- the coordinate
public Location findRandom()
findRandom
in interface Space
findRandom
in class CollectionSpace
public Coordinate findRandomCoordinate()
findRandomCoordinate
in interface Space
findRandomCoordinate
in class CollectionSpace
public int findRandomIndex()
public java.util.List findWithinImpl(Coordinate origin, boolean includeSelf, double dist)
ListBase
findWithinImpl
in class ListBase
origin
- 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 Space
isMutable
in class CollectionSpace
public boolean isDeleteSweepNeeded()
isDeleteSweepNeeded
in class CollectionSpace
public boolean isCoordinateSweepNeeded()
isCoordinateSweepNeeded
in class ListBase
public Node[] getCells()
getCells
in class Discrete
public Location[] getLocations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |