org.drools.planner.core.localsearch.decider.acceptor.tabu
Class AbstractTabuAcceptor

java.lang.Object
  extended by org.drools.planner.core.solver.event.SolverLifecycleListenerAdapter
      extended by org.drools.planner.core.localsearch.event.LocalSearchSolverPhaseLifecycleListenerAdapter
          extended by org.drools.planner.core.localsearch.decider.acceptor.AbstractAcceptor
              extended by org.drools.planner.core.localsearch.decider.acceptor.tabu.AbstractTabuAcceptor
All Implemented Interfaces:
EventListener, Acceptor, LocalSearchSolverPhaseLifecycleListener, SolverLifecycleListener
Direct Known Subclasses:
MoveTabuAcceptor, PlanningEntityTabuAcceptor, PlanningValueTabuAcceptor, SolutionTabuAcceptor

public abstract class AbstractTabuAcceptor
extends AbstractAcceptor

Abstract superclass for all Tabu Acceptors.

See Also:
Acceptor

Field Summary
protected  boolean aspirationEnabled
           
protected  boolean assertTabuHashCodeCorrectness
           
protected  int fadingTabuSize
           
protected  List<Object> tabuSequenceList
           
protected  int tabuSize
           
protected  Map<Object,Integer> tabuToStepIndexMap
           
 
Fields inherited from class org.drools.planner.core.localsearch.decider.acceptor.AbstractAcceptor
logger
 
Constructor Summary
AbstractTabuAcceptor()
           
 
Method Summary
protected  double calculateFadingTabuAcceptChance(int fadingTabuStepCount)
           
protected abstract  Collection<? extends Object> findNewTabu(LocalSearchStepScope localSearchStepScope)
           
protected abstract  Collection<? extends Object> findTabu(MoveScope moveScope)
           
 boolean isAccepted(MoveScope moveScope)
           
 void phaseEnded(LocalSearchSolverPhaseScope localSearchSolverPhaseScope)
           
 void phaseStarted(LocalSearchSolverPhaseScope localSearchSolverPhaseScope)
           
 void setAspirationEnabled(boolean aspirationEnabled)
           
 void setAssertTabuHashCodeCorrectness(boolean assertTabuHashCodeCorrectness)
           
 void setFadingTabuSize(int fadingTabuSize)
           
 void setTabuSize(int tabuSize)
           
 void stepEnded(LocalSearchStepScope localSearchStepScope)
           
 
Methods inherited from class org.drools.planner.core.localsearch.event.LocalSearchSolverPhaseLifecycleListenerAdapter
stepStarted
 
Methods inherited from class org.drools.planner.core.solver.event.SolverLifecycleListenerAdapter
solvingEnded, solvingStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.drools.planner.core.localsearch.event.LocalSearchSolverPhaseLifecycleListener
stepStarted
 
Methods inherited from interface org.drools.planner.core.solver.event.SolverLifecycleListener
solvingEnded, solvingStarted
 

Field Detail

tabuSize

protected int tabuSize

fadingTabuSize

protected int fadingTabuSize

aspirationEnabled

protected boolean aspirationEnabled

assertTabuHashCodeCorrectness

protected boolean assertTabuHashCodeCorrectness

tabuToStepIndexMap

protected Map<Object,Integer> tabuToStepIndexMap

tabuSequenceList

protected List<Object> tabuSequenceList
Constructor Detail

AbstractTabuAcceptor

public AbstractTabuAcceptor()
Method Detail

setTabuSize

public void setTabuSize(int tabuSize)

setFadingTabuSize

public void setFadingTabuSize(int fadingTabuSize)

setAspirationEnabled

public void setAspirationEnabled(boolean aspirationEnabled)

setAssertTabuHashCodeCorrectness

public void setAssertTabuHashCodeCorrectness(boolean assertTabuHashCodeCorrectness)

phaseStarted

public void phaseStarted(LocalSearchSolverPhaseScope localSearchSolverPhaseScope)
Specified by:
phaseStarted in interface LocalSearchSolverPhaseLifecycleListener
Overrides:
phaseStarted in class LocalSearchSolverPhaseLifecycleListenerAdapter

phaseEnded

public void phaseEnded(LocalSearchSolverPhaseScope localSearchSolverPhaseScope)
Specified by:
phaseEnded in interface LocalSearchSolverPhaseLifecycleListener
Overrides:
phaseEnded in class LocalSearchSolverPhaseLifecycleListenerAdapter

isAccepted

public boolean isAccepted(MoveScope moveScope)
Parameters:
moveScope - not null
Returns:
true if accepted

calculateFadingTabuAcceptChance

protected double calculateFadingTabuAcceptChance(int fadingTabuStepCount)
Parameters:
fadingTabuStepCount - 0 < fadingTabuStepCount <= fadingTabuSize
Returns:
0.0 < acceptChance < 1.0

stepEnded

public void stepEnded(LocalSearchStepScope localSearchStepScope)
Specified by:
stepEnded in interface LocalSearchSolverPhaseLifecycleListener
Overrides:
stepEnded in class LocalSearchSolverPhaseLifecycleListenerAdapter

findTabu

protected abstract Collection<? extends Object> findTabu(MoveScope moveScope)

findNewTabu

protected abstract Collection<? extends Object> findNewTabu(LocalSearchStepScope localSearchStepScope)


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.