cz.cvut.felk.cig.jcop.solver
Class SimpleSolver

java.lang.Object
  extended by cz.cvut.felk.cig.jcop.solver.BaseSolver
      extended by cz.cvut.felk.cig.jcop.solver.SimpleSolver
All Implemented Interfaces:
Solver

public class SimpleSolver
extends BaseSolver

Basic solver, applying one algorithm on one problem until one condition is met, algorithm cannot continue or exception is raised.


Field Summary
protected  Algorithm algorithm
          Algorithm to be applied on problem.
protected  ObjectiveProblem problem
          Problem to be solved.
 
Fields inherited from class cz.cvut.felk.cig.jcop.solver.BaseSolver
defaultRenders, logger, messageListeners, renders, result, stopConditions
 
Constructor Summary
SimpleSolver(Algorithm algorithm, Problem problem)
          Creates new solver with single algorithm and single problem.
 
Method Summary
 void run()
          Solves one or more problems using one or more algorithms as long as possible (usually stops upon any StopCondition is met or when algorithm raises CannotContinueException).
 
Methods inherited from class cz.cvut.felk.cig.jcop.solver.BaseSolver
addListener, addRender, addStopCondition, getRenders, getResult, isConditionMet, optimize, render, sendMessage, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

problem

protected ObjectiveProblem problem
Problem to be solved.


algorithm

protected Algorithm algorithm
Algorithm to be applied on problem.

Constructor Detail

SimpleSolver

public SimpleSolver(Algorithm algorithm,
                    Problem problem)
Creates new solver with single algorithm and single problem.

Note that problem is converted to BaseObjectiveProblem.

Parameters:
algorithm - algorithm to be applied on problem
problem - problem to be solved by algorithm
Method Detail

run

public void run()
Description copied from interface: Solver
Solves one or more problems using one or more algorithms as long as possible (usually stops upon any StopCondition is met or when algorithm raises CannotContinueException).