org.sat4j.minisat.orders
Class RandomLiteralSelectionStrategy

java.lang.Object
  extended by org.sat4j.minisat.orders.RandomLiteralSelectionStrategy
All Implemented Interfaces:
Serializable, IPhaseSelectionStrategy

public final class RandomLiteralSelectionStrategy
extends Object
implements IPhaseSelectionStrategy

The variable selection strategy randomly picks one phase, either positive or negative.

Author:
leberre
See Also:
Serialized Form

Field Summary
static Random RAND
           
 
Constructor Summary
RandomLiteralSelectionStrategy()
           
 
Method Summary
 void assignLiteral(int p)
          indicate that a literal has been satisfied.
 void init(int nlength)
          that method has the responsibility to initialize all arrays in the heuristics.
 void init(int var, int p)
          initialize the phase of a given variable to the given value.
 int select(int var)
          selects the phase of the variable according to a phase selection strategy.
 String toString()
           
 void updateVar(int p)
          To be called when the activity of a literal changed.
 void updateVarAtDecisionLevel(int q)
          Allow to perform a specific action when a literal of the current decision level is updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RAND

public static final Random RAND
Since:
2.2
Constructor Detail

RandomLiteralSelectionStrategy

public RandomLiteralSelectionStrategy()
Method Detail

assignLiteral

public void assignLiteral(int p)
Description copied from interface: IPhaseSelectionStrategy
indicate that a literal has been satisfied.

Specified by:
assignLiteral in interface IPhaseSelectionStrategy

init

public void init(int nlength)
Description copied from interface: IPhaseSelectionStrategy
that method has the responsibility to initialize all arrays in the heuristics.

Specified by:
init in interface IPhaseSelectionStrategy
Parameters:
nlength - the number of variables managed by the heuristics.

init

public void init(int var,
                 int p)
Description copied from interface: IPhaseSelectionStrategy
initialize the phase of a given variable to the given value. That method is suppose to be called AFTER init(int).

Specified by:
init in interface IPhaseSelectionStrategy
Parameters:
var - a variable
p - it's initial phase

select

public int select(int var)
Description copied from interface: IPhaseSelectionStrategy
selects the phase of the variable according to a phase selection strategy.

Specified by:
select in interface IPhaseSelectionStrategy
Parameters:
var - a variable chosen by the heuristics
Returns:
either var or not var, depending of the selection strategy.

updateVar

public void updateVar(int p)
Description copied from interface: IPhaseSelectionStrategy
To be called when the activity of a literal changed.

Specified by:
updateVar in interface IPhaseSelectionStrategy
Parameters:
p - a literal. The associated variable will be updated.

updateVarAtDecisionLevel

public void updateVarAtDecisionLevel(int q)
Description copied from interface: IPhaseSelectionStrategy
Allow to perform a specific action when a literal of the current decision level is updated. That method is called after IPhaseSelectionStrategy.updateVar(int).

Specified by:
updateVarAtDecisionLevel in interface IPhaseSelectionStrategy
Parameters:
q - a literal

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.