## org.ascape.model.space
Interface Space

All Superinterfaces:
  java.util.Collection, java.lang.Iterable, RandomFunctions

All Known Implementing Classes:
  Array, Array1D, Array2D, Array2DBase, Array2DEuclidian, Array2DMoore, Array2DSmallWorld, Array2DVonNeumann, CollectionSpace, Continuous1D, Continuous2D, Discrete, Graph, GraphSmallWorld, ListBase, ListSpace, Singleton, SubCollection, SubContinuous, SubContinuous1D, SubContinuous2D, SubGraph, SubListSpace

    public interface Space

extends java.util.Collection, RandomFunctions

The Interface Space.

Method Summary
`boolean` `add(java.lang.Object o, boolean isParent)` Add.
`double` `calculateDistance(Coordinate origin, Coordinate target)` Calculate distance.
`double` `calculateDistance(Location origin, Location target)` Calculate distance.
`java.lang.Object` `clone()` Clone.
`java.util.Iterator` `conditionalIterator(Conditional condition)` Conditional iterator.
`void` `construct()` Construct.
`int` `countWithin(Coordinate origin, Conditional condition, boolean includeSelf, double distance)` Count within.
`java.util.List` `find(Conditional condition)` Find.
`Location` `findMaximum(DataPoint point)` Find maximum.
`Location` `findMaximumWithin(Coordinate coordinate, DataPoint dataPoint, Conditional condition, boolean includeSelf, double distance)` Find maximum within.
`Location` `findMinimum(DataPoint point)` Find minimum.
`Location` `findMinimumWithin(Coordinate coordinate, DataPoint dataPoint, Conditional condition, boolean includeSelf, double distance)` Find minimum within.
`Location` `findNearest(Coordinate origin, Conditional condition, boolean includeOrigin, double distance)` Find nearest.
`Location` `findNearest(Location origin, Conditional condition, boolean includeOrigin, double distance)`
`Location` `findRandom()` Find random.
`Location` `findRandom(Conditional condition)` Find random.
`Location` `findRandom(Location excludeLocation)` Find random.
`Location` `findRandom(Location exclude, Conditional condition)`
`Coordinate` `findRandomCoordinate()` Find random coordinate.
`Location` `findRandomWithin(Location origin, Conditional condition, boolean includeSelf, double distance)`
`java.util.List` `findWithin(Coordinate origin, Conditional condition, boolean includeSelf, double distance)` Find within.
`Location` `get(Coordinate coordinate)` Get.
`SpaceContext` `getContext()` Gets the context.
`Coordinate` `getExtent()` Gets the extent.
`Geometry` `getGeometry()` Gets the geometry.
`int` `getSize()` Gets the size.
`boolean` `hasWithin(Coordinate origin, Conditional condition, boolean includeSelf, double distance)` Checks for within.
`void` `initialize()` Initialize.
`boolean` `isMutable()` Checks if is mutable.
`boolean` `isPeriodic()` Checks if is periodic.
`void` `moveAway(Location origin, Coordinate target, double distance)` Move away.
`void` `moveToward(Location origin, Coordinate target, double distance)` Move toward.
`Location` `newLocation(boolean randomLocation)` New location.
`void` `populate()` Populate.
`ResetableIterator` `safeIterator()` Safe iterator.
`ResetableIterator` `safeIterator(int start, int limit)` Safe iterator.
`ResetableIterator[]` `safeIterators(int count)` Safe iterators.
`RandomIterator` `safeRandomIterator()` Safe random iterator.
`void` `set(Coordinate coordinate, Location agent)` Set.
`void` `setContext(SpaceContext space)` Sets the context.
`void` `setExtent(Coordinate extent)` Sets the extent.
`void` `setPeriodic(boolean periodic)` Sets the periodic.
`void` `setSize(int size)` Sets the size.
`java.util.Iterator` `withinIterator(Coordinate origin, Conditional condition, boolean includeSelf, double distance)` Within iterator.

Methods inherited from interface java.util.Collection
`add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray`

Methods inherited from interface org.ascape.util.RandomFunctions
`getRandom, randomInRange, randomInRange, randomIs, randomToLimit, setRandom`

Method Detail

### moveAway

    void moveAway(Location origin,
                  Coordinate target,
                  double distance)

  Move away.

  Parameters:
    `origin` - the origin
    `target` - the target
    `distance` - the distance

### moveToward

    void moveToward(Location origin,
                    Coordinate target,
                    double distance)

  Move toward.

  Parameters:
    `origin` - the origin
    `target` - the target
    `distance` - the distance

### calculateDistance

    double calculateDistance(Coordinate origin,
                             Coordinate target)

  Calculate distance.

  Parameters:
    `origin` - the origin
    `target` - the target
  Returns:
    the double

### calculateDistance

    double calculateDistance(Location origin,
                             Location target)

  Calculate distance.

  Parameters:
    `origin` - the origin
    `target` - the target
  Returns:
    the double

### find

    java.util.List find(Conditional condition)

  Find.

  Parameters:
    `condition` - the condition
  Returns:
    the list

### findNearest

    Location findNearest(Coordinate origin,
                         Conditional condition,
                         boolean includeOrigin,
                         double distance)

  Find nearest.

  Parameters:
    `origin` - the origin
    `condition` - the condition
    `includeOrigin` - the include origin
    `distance` - the distance
  Returns:
    the location

### findNearest

    Location findNearest(Location origin,
                         Conditional condition,
                         boolean includeOrigin,
                         double distance)

### findWithin

    java.util.List findWithin(Coordinate origin,
                              Conditional condition,
                              boolean includeSelf,
                              double distance)

  Find within.

  Parameters:
    `origin` - the origin
    `condition` - the condition
    `includeSelf` - the include self
    `distance` - the distance
  Returns:
    the list

### countWithin

    int countWithin(Coordinate origin,
                    Conditional condition,
                    boolean includeSelf,
                    double distance)

  Count within.

  Parameters:
    `origin` - the origin
    `condition` - the condition
    `includeSelf` - the include self
    `distance` - the distance
  Returns:
    the int

### hasWithin

    boolean hasWithin(Coordinate origin,
                      Conditional condition,
                      boolean includeSelf,
                      double distance)

  Checks for within.

  Parameters:
    `origin` - the origin
    `condition` - the condition
    `includeSelf` - the include self
    `distance` - the distance
  Returns:
    true, if successful

### findMinimumWithin

    Location findMinimumWithin(Coordinate coordinate,
                               DataPoint dataPoint,
                               Conditional condition,
                               boolean includeSelf,
                               double distance)

  Find minimum within.

  Parameters:
    `coordinate` - the coordinate
    `dataPoint` - the data point
    `condition` - the condition
    `includeSelf` - the include self
    `distance` - the distance
  Returns:
    the location

### findMaximumWithin

    Location findMaximumWithin(Coordinate coordinate,
                               DataPoint dataPoint,
                               Conditional condition,
                               boolean includeSelf,
                               double distance)

  Find maximum within.

  Parameters:
    `coordinate` - the coordinate
    `dataPoint` - the data point
    `condition` - the condition
    `includeSelf` - the include self
    `distance` - the distance
  Returns:
    the location

### withinIterator

    java.util.Iterator withinIterator(Coordinate origin,
                                      Conditional condition,
                                      boolean includeSelf,
                                      double distance)

  Within iterator.

  Parameters:
    `origin` - the origin
    `condition` - the condition
    `includeSelf` - the include self
    `distance` - the distance
  Returns:
    the iterator

### findRandomCoordinate

    Coordinate findRandomCoordinate()

  Find random coordinate.

  Returns:
    the coordinate

### findRandom

    Location findRandom()

  Find random.

  Returns:
    the location

### findRandom

    Location findRandom(Location excludeLocation)

  Find random.

  Parameters:
    `excludeLocation` - the exclude location
  Returns:
    the location

### findRandom

    Location findRandom(Conditional condition)

  Find random.

  Parameters:
    `condition` - the condition
  Returns:
    the location

### findRandom

    Location findRandom(Location exclude,
                        Conditional condition)

### findRandomWithin

    Location findRandomWithin(Location origin,
                              Conditional condition,
                              boolean includeSelf,
                              double distance)

### findMinimum

    Location findMinimum(DataPoint point)

  Find minimum.

  Parameters:
    `point` - the point
  Returns:
    the location

### findMaximum

    Location findMaximum(DataPoint point)

  Find maximum.

  Parameters:
    `point` - the point
  Returns:
    the location

### get

    Location get(Coordinate coordinate)

  Get.

  Parameters:
    `coordinate` - the coordinate
  Returns:
    the location

### set

    void set(Coordinate coordinate,
             Location agent)

  Set.

  Parameters:
    `coordinate` - the coordinate
    `agent` - the agent

### newLocation

    Location newLocation(boolean randomLocation)

  New location.

  Parameters:
    `randomLocation` - the random location
  Returns:
    the location

### setExtent

    void setExtent(Coordinate extent)

  Sets the extent.

  Parameters:
    `extent` - the new extent

### getExtent

    Coordinate getExtent()

  Gets the extent.

  Returns:
    the extent

### getSize

    int getSize()

  Gets the size.

  Returns:
    the size

### setSize

    void setSize(int size)

  Sets the size.

  Parameters:
    `size` - the new size

### construct

    void construct()

  Construct.

### populate

    void populate()

  Populate.

### initialize

    void initialize()

  Initialize.

### getContext

    SpaceContext getContext()

  Gets the context.

  Returns:
    the context

### setContext

    void setContext(SpaceContext space)

  Sets the context.

  Parameters:
    `space` - the new context

### getGeometry

    Geometry getGeometry()

  Gets the geometry.

  Returns:
    the geometry

### isPeriodic

    boolean isPeriodic()

  Checks if is periodic.

  Returns:
    true, if is periodic

### isMutable

    boolean isMutable()

  Checks if is mutable.

  Returns:
    true, if is mutable

### setPeriodic

    void setPeriodic(boolean periodic)

  Sets the periodic.

  Parameters:
    `periodic` - the new periodic

### add

    boolean add(java.lang.Object o,
                boolean isParent)

  Add.

  Parameters:
    `o` - the o
    `isParent` - the is parent
  Returns:
    true, if successful

### clone

    java.lang.Object clone()

  Clone.

  Returns:
    the object

### safeIterator

    ResetableIterator safeIterator(int start,
                                   int limit)

  Safe iterator.

  Parameters:
    `start` - the start
    `limit` - the limit
  Returns:
    the resetable iterator

### safeIterators

    ResetableIterator[] safeIterators(int count)

  Safe iterators.

  Parameters:
    `count` - the count
  Returns:
    the resetable iterator[]

### safeIterator

    ResetableIterator safeIterator()

  Safe iterator.

  Returns:
    the resetable iterator

### safeRandomIterator

    RandomIterator safeRandomIterator()

  Safe random iterator.

  Returns:
    the random iterator

### conditionalIterator

    java.util.Iterator conditionalIterator(Conditional condition)

  Conditional iterator.

  Parameters:
    `condition` - the condition
  Returns:
    the iterator