choco
Class Solution

java.lang.Object
  extended by choco.Solution
Direct Known Subclasses:
PalmSolution

public class Solution
extends java.lang.Object

A class storing a state of the problem


Field Summary
protected  int[] intVarValues
          data storage for values of search variables
protected static java.util.logging.Logger logger
           
protected  int objectiveValue
           
protected  AbstractProblem problem
          the problem owning the solution
protected  RealInterval[] realVarValues
           
protected  int[][] setVarValues
           
 
Constructor Summary
Solution(AbstractProblem pb)
          Constructor
 
Method Summary
 RealInterval getRealValue(int varIndex)
           
 int[] getSetValue(int varIndex)
           
 int getValue(int varIndex)
          Accessor to the value of a variable in a solution
 void recordIntObjective(int intObjectiveValue)
           
 void recordIntValue(int intVarIndex, int intVarValue)
           
 void recordRealValue(int realVarIndex, RealInterval realVarValue)
           
 void recordSetValue(int setVarIndex, int[] setVarValue)
           
 void restore()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final java.util.logging.Logger logger

problem

protected AbstractProblem problem
the problem owning the solution


intVarValues

protected int[] intVarValues
data storage for values of search variables


realVarValues

protected RealInterval[] realVarValues

setVarValues

protected int[][] setVarValues

objectiveValue

protected int objectiveValue
Constructor Detail

Solution

public Solution(AbstractProblem pb)
Constructor

Parameters:
pb - the problem owning the solution
Method Detail

recordIntValue

public void recordIntValue(int intVarIndex,
                           int intVarValue)

recordSetValue

public void recordSetValue(int setVarIndex,
                           int[] setVarValue)

recordRealValue

public void recordRealValue(int realVarIndex,
                            RealInterval realVarValue)

recordIntObjective

public void recordIntObjective(int intObjectiveValue)

restore

public void restore()

getValue

public int getValue(int varIndex)
Accessor to the value of a variable in a solution

Parameters:
varIndex - the index of the variable among all variables of the problem
Returns:
its value (whenever it is instantiated in the solution), or Integer.MAX_VALUE otherwise

getSetValue

public int[] getSetValue(int varIndex)

getRealValue

public RealInterval getRealValue(int varIndex)