choco.cp.solver.constraints.global.geost
Class Setup

java.lang.Object
  extended by choco.cp.solver.constraints.global.geost.Setup

public final class Setup
extends Object

This is a very important class. It contains all the variables and objects the constraint needs. Also it contains functions that the user and the constraint use to access the shapes, objects as well as the external constraints in the Geost.


Field Summary
 Geost_Constraint g_constraint
           
 Hashtable<Integer,Obj> objects
          A hashtable where the key is an object_id.
 GeostOptions opt
           
 PropagationEngine propagationEngine
           
 Hashtable<Integer,List<ShiftedBox>> shapes
          A hashtable where the key is a shape_id.
 
Constructor Summary
Setup(Constants c, PropagationEngine propagationEngine, Geost_Constraint constraint)
          Creates a Setup instance for a given Constants class
 
Method Summary
 void clear()
          Clears the Setup object.
 List<ExternalConstraint> getConstraints()
           
 HeapDescending getIctrMaxHeap()
           
 HeapAscending getIctrMinHeap()
           
 int getNbOfDomainVariables()
          This function calculates the number of the domain variables in our problem.
 int getNbOfObjects()
           
 int getNbOfShapes()
           
 Obj getObject(int oid)
           
 Enumeration<Integer> getObjectKeys()
           
 Set<Integer> getObjectKeySet()
           
 List<ShiftedBox> getShape(int sid)
           
 Enumeration<Integer> getShapeKeys()
           
 Set<Integer> getShapeKeySet()
           
 void insertObject(int oid, Obj o)
           
 void insertShape(int sid, List<ShiftedBox> shiftedBoxes)
           
 void print()
          Prints to the output console the objects and the shapes of the problem.
 boolean printToFileHumanFormat(String path)
          Prints to a file that can be easily read by a person the objects and the shapes of the problem.
 boolean printToFileInputFormat(String path)
          Prints to a file the objects and the shapes of the problem.
 void SetupTheProblem(List<Obj> objects, List<ShiftedBox> shiftedBoxes, List<ExternalConstraint> ectr)
          Given a Vector of Objects and a Vector of shiftedBoxes and a Vector of ExternalConstraints it sets up the problem for the geost constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opt

public GeostOptions opt

propagationEngine

public final PropagationEngine propagationEngine

g_constraint

public final Geost_Constraint g_constraint

shapes

public final Hashtable<Integer,List<ShiftedBox>> shapes
A hashtable where the key is a shape_id. And for every shape_id there is a pointer to the set of shifted_boxes that belong to this shape. This hashtable contains all the shapes (and their shifted boxes) of all the objects in the geost constraint.


objects

public final Hashtable<Integer,Obj> objects
A hashtable where the key is an object_id. And for every object_id there is a pointer to the actual object. This hashtable contains all the objects that goest needs to place.

Constructor Detail

Setup

public Setup(Constants c,
             PropagationEngine propagationEngine,
             Geost_Constraint constraint)
Creates a Setup instance for a given Constants class

Parameters:
c - An instance of the constants class
propagationEngine -
constraint -
Method Detail

insertShape

public void insertShape(int sid,
                        List<ShiftedBox> shiftedBoxes)

insertObject

public void insertObject(int oid,
                         Obj o)

getShape

public List<ShiftedBox> getShape(int sid)

getObject

public Obj getObject(int oid)

getNbOfObjects

public int getNbOfObjects()

getNbOfShapes

public int getNbOfShapes()

getNbOfDomainVariables

public int getNbOfDomainVariables()
This function calculates the number of the domain variables in our problem.


SetupTheProblem

public void SetupTheProblem(List<Obj> objects,
                            List<ShiftedBox> shiftedBoxes,
                            List<ExternalConstraint> ectr)
Given a Vector of Objects and a Vector of shiftedBoxes and a Vector of ExternalConstraints it sets up the problem for the geost constraint.


getConstraints

public List<ExternalConstraint> getConstraints()

getIctrMinHeap

public HeapAscending getIctrMinHeap()

getIctrMaxHeap

public HeapDescending getIctrMaxHeap()

getObjectKeys

public Enumeration<Integer> getObjectKeys()

getShapeKeys

public Enumeration<Integer> getShapeKeys()

getObjectKeySet

public Set<Integer> getObjectKeySet()

getShapeKeySet

public Set<Integer> getShapeKeySet()

print

public void print()
Prints to the output console the objects and the shapes of the problem.


printToFileHumanFormat

public boolean printToFileHumanFormat(String path)
Prints to a file that can be easily read by a person the objects and the shapes of the problem. The file to be written to is specified in the global variable OUTPUT_OF_RANDOM_GEN_PROB_TO_BE_READ_BY_HUMANS, present in the global.Constants class.


printToFileInputFormat

public boolean printToFileInputFormat(String path)
Prints to a file the objects and the shapes of the problem. The written file can be read by the InputParser class. The file to be written to is specified in the global variable OUTPUT_OF_RANDOM_GEN_PROB_TO_BE_USED_AS_INPUT, present in the global.Constants class.


clear

public void clear()
Clears the Setup object. So basically it removes all the shapes, objects and constraints from the problem.



Copyright © 2012. All Rights Reserved.