JaCoP.constraints.geost
Class GeostObject

java.lang.Object
  extended by JaCoP.constraints.geost.GeostObject

public class GeostObject
extends java.lang.Object

Author:
Marc-Olivier Fleury and Radoslaw Szymanek It contains all information about the Geost object as well as functionality to maintain the consistency among time variables.

Nested Class Summary
 class GeostObject.TimeBoundConstraint
           
 
Field Summary
 IntVar[] coords
          It specifies the coordinates in k-dimensional space at which the object is fixed.
 int dimension
          It specifies the number of dimensions in this object.
 IntVar duration
          It specifies the duration time of this object.
 IntVar end
          It specifies the end time of this object.
 int no
          A unique identifier greater or equal to 0.
 IntVar shapeID
          It specifies the possible shape ids to be taken by this object.
 IntVar start
          It specifies the start time of this object in time dimension.
 java.util.ArrayList<Var> variables
          It stores all finite domain variables in connection to this object.
static java.lang.String[] xmlAttributes
          It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.
 
Constructor Summary
GeostObject(int no, IntVar[] coords, IntVar shapeID, IntVar start, IntVar duration, IntVar end)
          It constructs a Geost object with all the attributes needed by the Geost constraint.
 
Method Summary
 java.util.Collection<Var> getVariables()
          It returns finite domain variables which belong to this object.
 boolean isGrounded()
          It checks whether the object location is fixed.
 void onGround(Var variable)
          It is executed as soon as any object variable is grounded.
 void onUnGround(Var variable)
          It is executed as soon as backtracking has occurred making previously grounded variable ungrounded again.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

no

public final int no
A unique identifier greater or equal to 0. The last object supplied to GeostConstraint should have an identifier equal to n-1, where n is the total number of objects.


dimension

public final int dimension
It specifies the number of dimensions in this object.


coords

public final IntVar[] coords
It specifies the coordinates in k-dimensional space at which the object is fixed. It is the origin of the object. The actual starting point of the object depends at the end also on the shape used by the object or in particular the origins of the boxes which constitutes the shape.


shapeID

public final IntVar shapeID
It specifies the possible shape ids to be taken by this object.


start

public final IntVar start
It specifies the start time of this object in time dimension.


duration

public final IntVar duration
It specifies the duration time of this object.


end

public final IntVar end
It specifies the end time of this object.


variables

public final java.util.ArrayList<Var> variables
It stores all finite domain variables in connection to this object. E.g. shape variables are one of the objects in the focus of the constraint.


xmlAttributes

public static java.lang.String[] xmlAttributes
It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.

Constructor Detail

GeostObject

public GeostObject(int no,
                   IntVar[] coords,
                   IntVar shapeID,
                   IntVar start,
                   IntVar duration,
                   IntVar end)
It constructs a Geost object with all the attributes needed by the Geost constraint.

Parameters:
no - nonnegative unique id of this object.
coords - an array of variables representing the origin (start) of the objects.
shapeID - the variable specifying the shape finite domain variable.
start - it determines the start time of the geost object in terms of time.
duration - finite domain variable specifying the duration of the geost object in terms of time.
end -
Method Detail

getVariables

public java.util.Collection<Var> getVariables()
It returns finite domain variables which belong to this object.

Returns:
variables that constitute this object.

onGround

public final void onGround(Var variable)
It is executed as soon as any object variable is grounded.

Parameters:
variable - variable being grounded.

onUnGround

public final void onUnGround(Var variable)
It is executed as soon as backtracking has occurred making previously grounded variable ungrounded again.

Parameters:
variable - variable being ungrounded.

isGrounded

public final boolean isGrounded()
It checks whether the object location is fixed.

Returns:
true if the object location is fixed, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object