choco.cp.solver.constraints.global.geost.geometricPrim
Class Obj

java.lang.Object
  extended by choco.cp.solver.constraints.global.geost.geometricPrim.Obj
All Implemented Interfaces:
Externalizable, Serializable

public final class Obj
extends Object
implements Externalizable

This class represent an Object of our placement problem.

See Also:
Serialized Form

Constructor Summary
Obj()
           
Obj(int dim)
          Creates an object in a certain given dimension
Obj(int dim, int objectId, IntDomainVar shapeId, IntDomainVar[] coordinates, IntDomainVar startTime, IntDomainVar durationTime, IntDomainVar endTime)
          Creates an object with the given parameters
Obj(int dim, int objectId, IntDomainVar shapeId, IntDomainVar[] coordinates, IntDomainVar startTime, IntDomainVar durationTime, IntDomainVar endTime, int radius)
           
 
Method Summary
 void addRelatedExternalConstraint(ExternalConstraint ectr)
          Adds a Related External Constraint to this object.
 void addRelatedInternalConstraint(InternalConstraint ictr)
          Adds a Related Internal Constraint to this object.
 int calculateDomainSize()
          Calculate the domain size (to check if we pruned the object at a certain iteration)
 void clearInternalConstraints()
           
 boolean coordInstantiated()
           
 IntDomainVar getCoord(int index)
          Gets the index coordinate domain variable of the object origin
 IntDomainVar[] getCoordinates()
          Gets all the coordinate domain variables of the object origin
 IntDomainVar getDuration()
           
 IntDomainVar getEnd()
           
 int getObjectId()
          Gets the Object id
 int getRadius()
           
 List<ExternalConstraint> getRelatedExternalConstraints()
          Gets all Related External Constraints to this object.
 List<InternalConstraint> getRelatedInternalConstraints()
          Gets all Related Internal Constraints to this object.
 IntDomainVar getShapeId()
          Gets the Shape id domain variable
 IntDomainVar getStart()
           
 Outbox intersect(Outbox ob)
           
 boolean isInside(Point p)
           
 boolean isSphere()
           
 void print()
           
 void readExternal(ObjectInput in)
           
 boolean sameDomain(Obj o)
           
 void setCoord(int index, IntDomainVar value)
          Sets a coordinate domain variables of the object origin at the given dimension given by the parameter index, to another domain variable given by the parameter value.
 void setCoordinates(IntDomainVar[] coordinates)
          Sets all the coordinate domain variables of the object origin to the ones given as parameter
 void setDuration(IntDomainVar duration)
           
 void setEnd(IntDomainVar end)
           
 void setObjectId(int objectId)
          Sets the Object id
 void setRelatedExternalConstraints(List<ExternalConstraint> relatedExtConstraints)
          Sets all Related External Constraints to this object.
 void setRelatedInternalConstraints(List<InternalConstraint> relatedIntConstraints)
          Sets all Related Internal Constraints to this object.
 void setShapeId(IntDomainVar shapeId)
          Sets the Shape id domain variable
 void setStart(IntDomainVar start)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Obj

public Obj()

Obj

public Obj(int dim,
           int objectId,
           IntDomainVar shapeId,
           IntDomainVar[] coordinates,
           IntDomainVar startTime,
           IntDomainVar durationTime,
           IntDomainVar endTime)
Creates an object with the given parameters

Parameters:
dim - An integer representing the dimension of the placement problem
objectId - An integer representing the object id
shapeId - An Integer Domain Variable representing the possible shape ids the Object can have
coordinates - An array of size k of Integer Domain Variables (where k is the dimension of the space we are working in) representing the Domain of our object origin
startTime - An Integer Domain Variable representing the time that the object start in
durationTime - An Integer Domain Variable representing the duration
endTime - An Integer Domain Variable representing the time that the object ends in

Obj

public Obj(int dim,
           int objectId,
           IntDomainVar shapeId,
           IntDomainVar[] coordinates,
           IntDomainVar startTime,
           IntDomainVar durationTime,
           IntDomainVar endTime,
           int radius)

Obj

public Obj(int dim)
Creates an object in a certain given dimension

Method Detail

getObjectId

public int getObjectId()
Gets the Object id


setObjectId

public void setObjectId(int objectId)
Sets the Object id


getShapeId

public IntDomainVar getShapeId()
Gets the Shape id domain variable


setShapeId

public void setShapeId(IntDomainVar shapeId)
Sets the Shape id domain variable


getCoordinates

public IntDomainVar[] getCoordinates()
Gets all the coordinate domain variables of the object origin


setCoordinates

public void setCoordinates(IntDomainVar[] coordinates)
Sets all the coordinate domain variables of the object origin to the ones given as parameter


setCoord

public void setCoord(int index,
                     IntDomainVar value)
Sets a coordinate domain variables of the object origin at the given dimension given by the parameter index, to another domain variable given by the parameter value.


getCoord

public IntDomainVar getCoord(int index)
Gets the index coordinate domain variable of the object origin


getDuration

public IntDomainVar getDuration()

setDuration

public void setDuration(IntDomainVar duration)

getEnd

public IntDomainVar getEnd()

setEnd

public void setEnd(IntDomainVar end)

getStart

public IntDomainVar getStart()

setStart

public void setStart(IntDomainVar start)

getRelatedExternalConstraints

public List<ExternalConstraint> getRelatedExternalConstraints()
Gets all Related External Constraints to this object.


getRelatedInternalConstraints

public List<InternalConstraint> getRelatedInternalConstraints()
Gets all Related Internal Constraints to this object.


setRelatedExternalConstraints

public void setRelatedExternalConstraints(List<ExternalConstraint> relatedExtConstraints)
Sets all Related External Constraints to this object.


setRelatedInternalConstraints

public void setRelatedInternalConstraints(List<InternalConstraint> relatedIntConstraints)
Sets all Related Internal Constraints to this object.


addRelatedExternalConstraint

public void addRelatedExternalConstraint(ExternalConstraint ectr)
Adds a Related External Constraint to this object.


addRelatedInternalConstraint

public void addRelatedInternalConstraint(InternalConstraint ictr)
Adds a Related Internal Constraint to this object.


calculateDomainSize

public int calculateDomainSize()
Calculate the domain size (to check if we pruned the object at a certain iteration)


coordInstantiated

public boolean coordInstantiated()

sameDomain

public boolean sameDomain(Obj o)

print

public void print()

toString

public String toString()
Overrides:
toString in class Object

intersect

public Outbox intersect(Outbox ob)

isSphere

public boolean isSphere()

getRadius

public int getRadius()

clearInternalConstraints

public void clearInternalConstraints()

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

isInside

public boolean isInside(Point p)


Copyright © 2012. All Rights Reserved.