Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class Solution

java.lang.Object
  extended by jp.ac.kobe_u.cs.cream.Solution

public class Solution
extends Object

Solutions. Solutions are returned by constraint solvers. A solution consists of domains for variables and a code.

Since:
1.0
See Also:
Solver, Domain, Code

Constructor Summary
Solution(Network network)
          Constructs a solution from the given network.
 
Method Summary
 Code getCode()
          Returns the code of the solution.
 Domain getDomain(Variable v)
          Returns the domain of the given variable in the solution.
 int getIntValue(Variable v)
          Returns the integer value of the given variable in the solution.
 int getObjectiveIntValue()
          Returns the integer value of the objective variable in the solution.
 String toString()
          Returns a readable string representation of this solution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Solution

public Solution(Network network)
Constructs a solution from the given network.

Parameters:
network - the constraint network
Method Detail

getObjectiveIntValue

public int getObjectiveIntValue()
Returns the integer value of the objective variable in the solution.

Returns:
the integer value of the objective variable

getDomain

public Domain getDomain(Variable v)
Returns the domain of the given variable in the solution.

Parameters:
v - the variable
Returns:
the domain of the variable

getIntValue

public int getIntValue(Variable v)
Returns the integer value of the given variable in the solution.

Parameters:
v - the variable
Returns:
the integer value of the variable

getCode

public Code getCode()
Returns the code of the solution.

Returns:
the code of the solution

toString

public String toString()
Returns a readable string representation of this solution.

Overrides:
toString in class Object
Returns:
the readable string representation

Cream version 1.06 Core API Specification

Cream: Constraint Programming Class Library for Java