omnics.strategy
Interface ForwardStrategy

All Superinterfaces:
SolverStrategy
All Known Implementing Classes:
MinDomForward, SimpleForward

public interface ForwardStrategy
extends SolverStrategy

Describes an heuristic responsible with selecting the next variable to be instantiated by the solver.

The variable will be selected from the remaining candidates - variables that are active and have not been instantiated. If all the active variables have been instantiated that implies that the candidates set is empty and the next method must return null.

Example:

 
 public class SimpleForward extends AbstractStrategy
     implements ForwardStrategy {
    
   public Var next() {        
       List<Var> candidates = solver.candidates();
       if (candidates.size() == 0) {
           return null;
       }
       return candidates.get(0);
   }
 

Author:
Cristian Frasinaru

Method Summary
 Var next()
          Determines the next variable to be instantiated by the solver.
 
Methods inherited from interface omnics.strategy.SolverStrategy
getSolver, setSolver
 

Method Detail

next

Var next()
Determines the next variable to be instantiated by the solver. If there are no more candidates left the method must return null.

Returns:
the next variable to be instantiated by the solver or null if there are no more candidates.