org.opt4j.satdecoding
Class Model

java.lang.Object
  extended by org.opt4j.satdecoding.Model

public class Model
extends java.lang.Object

The Model is a data structure that represents a solution of the given problem, i.e., all Literals are set such that all Constraints specified by the AbstractSATDecoder are feasible.


Field Summary
protected  java.util.Map<java.lang.Object,java.lang.Boolean> map
           
 
Constructor Summary
Model()
          Constructs a Model.
 
Method Summary
 java.lang.Boolean get(java.lang.Object var)
          Returns the value of the variable, or null if this variable is not defined.
 java.util.Set<java.lang.Object> getVars()
          Returns all variables of the model.
 java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Boolean>> pairs()
          Returns the entry set: The entry pairs of all variables to the boolean values.
 void set(java.lang.Object var, boolean phase)
          Sets the variable to a phase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected final java.util.Map<java.lang.Object,java.lang.Boolean> map
Constructor Detail

Model

public Model()
Constructs a Model.

Method Detail

get

public java.lang.Boolean get(java.lang.Object var)
Returns the value of the variable, or null if this variable is not defined.

Parameters:
var - the variable
Returns:
true if the variable in this model is true or null if it is not defined

set

public void set(java.lang.Object var,
                boolean phase)
Sets the variable to a phase.

Parameters:
var - the variable
phase - the phase

getVars

public java.util.Set<java.lang.Object> getVars()
Returns all variables of the model.

Returns:
all variables

pairs

public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Boolean>> pairs()
Returns the entry set: The entry pairs of all variables to the boolean values.

Returns:
the entry set