choco.kernel.common.opres.heuristics
Class AbstractRandomizedHeuristic

java.lang.Object
  extended by choco.kernel.common.opres.heuristics.AbstractRandomizedHeuristic
All Implemented Interfaces:
IHeuristic, ISolutionDisplay, IOptimizationMeasures, ISolutionMeasures

public abstract class AbstractRandomizedHeuristic
extends Object
implements IHeuristic


Field Summary
protected  int iterationLimit
           
 
Fields inherited from interface choco.kernel.common.opres.heuristics.IHeuristic
LOGGER
 
Constructor Summary
AbstractRandomizedHeuristic()
           
 
Method Summary
protected abstract  int apply(int iteration, int bestsol, int seed)
           
 int apply(Random random)
           
protected  int applySingleIteration(int iteration, int seed)
           
 boolean existsSolution()
          heuristics always succeeds
protected  void forceStoreSolution(int obj)
           
 int getBestIteration()
           
 int getIterationCount()
          get computation time in seconds
abstract  int getLowerBound()
           
 Number getObjectiveValue()
          Get the best objective value of a solution.
 int getSolutionCount()
          Get the solution count of the measure
 double getTimeCount()
          get computation time in seconds
 boolean hasSearched()
          indicates if the algorithm was executed
 boolean isObjectiveOptimal()
           
 void reset()
           
 void setIterationLimit(int iterationLimit)
           
 void setTimeLimit(int timeLimit)
          in seconds
 String solutionToString()
           
protected  void storeSolution(int seed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.kernel.common.opres.heuristics.IHeuristic
execute
 

Field Detail

iterationLimit

protected int iterationLimit
Constructor Detail

AbstractRandomizedHeuristic

public AbstractRandomizedHeuristic()
Method Detail

reset

public void reset()
Specified by:
reset in interface IHeuristic

forceStoreSolution

protected final void forceStoreSolution(int obj)

storeSolution

protected final void storeSolution(int seed)

getLowerBound

public abstract int getLowerBound()

apply

protected abstract int apply(int iteration,
                             int bestsol,
                             int seed)

applySingleIteration

protected final int applySingleIteration(int iteration,
                                         int seed)

apply

public final int apply(Random random)

isObjectiveOptimal

public boolean isObjectiveOptimal()
Specified by:
isObjectiveOptimal in interface IOptimizationMeasures

setTimeLimit

public final void setTimeLimit(int timeLimit)
in seconds


setIterationLimit

public final void setIterationLimit(int iterationLimit)

getIterationCount

public final int getIterationCount()
Description copied from interface: IHeuristic
get computation time in seconds

Specified by:
getIterationCount in interface IHeuristic

getBestIteration

public int getBestIteration()

getTimeCount

public final double getTimeCount()
Description copied from interface: IHeuristic
get computation time in seconds

Specified by:
getTimeCount in interface IHeuristic

hasSearched

public final boolean hasSearched()
Description copied from interface: IHeuristic
indicates if the algorithm was executed

Specified by:
hasSearched in interface IHeuristic
Returns:
true if a solution was found

existsSolution

public final boolean existsSolution()
heuristics always succeeds

Specified by:
existsSolution in interface ISolutionMeasures

getObjectiveValue

public final Number getObjectiveValue()
Description copied from interface: IOptimizationMeasures
Get the best objective value of a solution.

Specified by:
getObjectiveValue in interface IOptimizationMeasures

getSolutionCount

public int getSolutionCount()
Description copied from interface: ISolutionMeasures
Get the solution count of the measure

Specified by:
getSolutionCount in interface ISolutionMeasures
Returns:
solution count

solutionToString

public String solutionToString()
Specified by:
solutionToString in interface ISolutionDisplay


Copyright © 2012. All Rights Reserved.