## org.ascape.model.space
Class Coordinate1DContinuous

    java.lang.Object
      org.ascape.model.space.Coordinate
          org.ascape.model.space.CoordinateContinuous
              org.ascape.model.space.Coordinate1DContinuous

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

Direct Known Subclasses:
  Coordinate2DContinuous

    public class Coordinate1DContinuous

extends CoordinateContinuous

A location within a one-dimensional discrete space.

Since:
  2.0
Version:
  2.0
Author:
  Miles Parker
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.ascape.model.space.CoordinateContinuous
`values`

Constructor Summary
`Coordinate1DContinuous()` Creates a 1-dimensional coordinate.
`Coordinate1DContinuous(double value)` Creates a 1-dimensional coordinate with the specified position.
`Coordinate1DContinuous(double[] values)` Creates a 1-dimensional coordinate with the specified postion values.

Method Summary
`Coordinate` `add(Coordinate coordinate)` Adds the location of the supplied coordinate to this coordinate, returning the resulting coordinate.
`double` `getDistance(Coordinate coordinate)` Returns the distance between two coordinates.
`double` `getValue()` Returns the number of dimensions for this lattice.
`double` `getXValue()` Returns the x value of this coordinate.
`void` `setValue(double x)` Sets the value for this coordinate.
`void` `setXValue(double x)` Sets the y value for this coordinate.
`java.lang.String` `toString()` Returns a string representing this coordinate.

Methods inherited from class org.ascape.model.space.CoordinateContinuous
`equals, getDimensionCount, getProduct, getValueAtDimension, getValues, setValueAtDimension, setValues`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Coordinate1DContinuous

    public Coordinate1DContinuous()

  Creates a 1-dimensional coordinate.

### Coordinate1DContinuous

    public Coordinate1DContinuous(double[] values)

  Creates a 1-dimensional coordinate with the specified postion values.

  Parameters:
    `values` - the values

### Coordinate1DContinuous

    public Coordinate1DContinuous(double value)

  Creates a 1-dimensional coordinate with the specified position.

  Parameters:
    `value` - the value

Method Detail

### getDistance

    public double getDistance(Coordinate coordinate)

  Returns the distance between two coordinates. Note: Expects non-periodic (i.e. not non-wrap around) space, since there is no space context. Coordinates are not aware of a particular space context, so the agent and space getDistance methods should be used whenever comparing distance in the context of scapes.

  Specified by:
    `getDistance` in class `Coordinate`
  Parameters:
    `coordinate` - target to calcualte distance to
  Returns:
    the distance between the two coordinates

### getValue

    public double getValue()

  Returns the number of dimensions for this lattice.

  Returns:
    the value

### setValue

    public void setValue(double x)

  Sets the value for this coordinate.

  Parameters:
    `x` - the x

### getXValue

    public double getXValue()

  Returns the x value of this coordinate.

  Returns:
    the x value

### setXValue

    public void setXValue(double x)

  Sets the y value for this coordinate.

  Parameters:
    `x` - the x

### add

    public Coordinate add(Coordinate coordinate)

  Adds the location of the supplied coordinate to this coordinate, returning the resulting coordinate.

  Specified by:
    `add` in class `Coordinate`
  Parameters:
    `coordinate` - the coordinate to sum with this one
  Returns:
    the coordinate

### toString

    public java.lang.String toString()

  Returns a string representing this coordinate.

  Overrides:
    `toString` in class `CoordinateContinuous`
  Returns:
    the string