weka.core.setupgenerator
Class Space

java.lang.Object
  extended by weka.core.setupgenerator.Space
All Implemented Interfaces:
Serializable

public class Space
extends Object
implements Serializable

Represents a multidimensional value space.

Version:
$Revision: 4521 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  SpaceDimension[] m_Dimensions
          the dimensions.
 
Constructor Summary
Space(SpaceDimension[] dimensions)
          Initializes the space.
 
Method Summary
 int dimensions()
          Returns the number of dimensions of this space.
 SpaceDimension getDimension(int dimension)
          Returns the specified dimension.
 Point<Integer> getLocations(Point<Object> values)
          Returns the locations for the given values in the various dimensions.
 int getType(int dimension)
          Returns the type of the dimension.
 Point<Object> getValues(Point<Integer> locations)
          Returns the double values (or list values) for the given position.
protected  boolean inc(Integer[] locations, int[] max)
          Increments the location array by 1.
 boolean isOnBorder(Point<?> points)
          checks whether the given locations/values are on the border of the space.
protected  Vector<Point<Integer>> listPoints()
          returns a Vector with all points in the space.
 Enumeration<Point<Integer>> points()
          returns an Enumeration over all points.
 int size()
          Returns the size of the space.
 Space subspace(Point<Integer> center)
          Returns a subspace around the given point, with just one more neighbor left and right on each dimension.
 String toString()
          Returns a string representation of the space.
 Enumeration<Point<Object>> values()
          returns an Enumeration over all values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Dimensions

protected SpaceDimension[] m_Dimensions
the dimensions.

Constructor Detail

Space

public Space(SpaceDimension[] dimensions)
Initializes the space.

Parameters:
dimensions - the dimensions of the space
Method Detail

dimensions

public int dimensions()
Returns the number of dimensions of this space.

Returns:
the number of dimensions

getDimension

public SpaceDimension getDimension(int dimension)
Returns the specified dimension.

Parameters:
dimension - the dimension index
Returns:
the dimension

getType

public int getType(int dimension)
Returns the type of the dimension.

Parameters:
dimension - the dimension index
Returns:
the type of the dimension
See Also:
MultiSearch#TYPE_FUNCTION, MultiSearch#TYPE_LIST

getValues

public Point<Object> getValues(Point<Integer> locations)
Returns the double values (or list values) for the given position.

Parameters:
locations - the location to get the double values for
Returns:
the double values (or list values) at the specified position

getLocations

public Point<Integer> getLocations(Point<Object> values)
Returns the locations for the given values in the various dimensions.

Parameters:
values - the double values to get the locations for
Returns:
the

isOnBorder

public boolean isOnBorder(Point<?> points)
checks whether the given locations/values are on the border of the space.

Parameters:
points - the locations/values to check
Returns:
true if the the locations/values are on the border

subspace

public Space subspace(Point<Integer> center)
Returns a subspace around the given point, with just one more neighbor left and right on each dimension.

Parameters:
center - the center of the new "universe" ;-)
Returns:
the new space

inc

protected boolean inc(Integer[] locations,
                      int[] max)
Increments the location array by 1.

Parameters:
locations - the position in the space
max - the maxima
Returns:
true if locations could be incremented

listPoints

protected Vector<Point<Integer>> listPoints()
returns a Vector with all points in the space.

Returns:
a Vector with all points

size

public int size()
Returns the size of the space.

Returns:
the number of points in the space

points

public Enumeration<Point<Integer>> points()
returns an Enumeration over all points.

Returns:
an Enumeration over all points

values

public Enumeration<Point<Object>> values()
returns an Enumeration over all values.

Returns:
an Enumeration over all values

toString

public String toString()
Returns a string representation of the space.

Overrides:
toString in class Object
Returns:
a string representation


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.