OptaPlanner core 6.0.0.CR2

org.optaplanner.core.impl.localsearch.decider.acceptor.tabu
Class AbstractTabuAcceptor

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

public abstract class AbstractTabuAcceptor
extends AbstractAcceptor

Abstract superclass for all Tabu Acceptors.

See Also:
Acceptor

Field Summary
protected  boolean aspirationEnabled
           
protected  boolean assertTabuHashCodeCorrectness
           
protected  TabuSizeStrategy fadingTabuSizeStrategy
           
protected  List<Object> tabuSequenceList
           
protected  TabuSizeStrategy tabuSizeStrategy
           
protected  Map<Object,Integer> tabuToStepIndexMap
           
protected  int workingFadingTabuSize
           
protected  int workingTabuSize
           
 
Fields inherited from class org.optaplanner.core.impl.localsearch.decider.acceptor.AbstractAcceptor
logger
 
Constructor Summary
AbstractTabuAcceptor()
           
 
Method Summary
protected  void adjustTabuList(int tabuStepIndex, Collection<? extends Object> tabus)
           
protected  double calculateFadingTabuAcceptChance(int fadingTabuStepCount)
           
protected abstract  Collection<? extends Object> findNewTabu(LocalSearchStepScope stepScope)
           
protected abstract  Collection<? extends Object> findTabu(LocalSearchMoveScope moveScope)
           
 boolean isAccepted(LocalSearchMoveScope moveScope)
           
 void phaseEnded(LocalSearchSolverPhaseScope phaseScope)
           
 void phaseStarted(LocalSearchSolverPhaseScope phaseScope)
           
 void setAspirationEnabled(boolean aspirationEnabled)
           
 void setAssertTabuHashCodeCorrectness(boolean assertTabuHashCodeCorrectness)
           
 void setFadingTabuSizeStrategy(TabuSizeStrategy fadingTabuSizeStrategy)
           
 void setTabuSizeStrategy(TabuSizeStrategy tabuSizeStrategy)
           
 void stepEnded(LocalSearchStepScope stepScope)
           
 
Methods inherited from class org.optaplanner.core.impl.localsearch.event.LocalSearchSolverPhaseLifecycleListenerAdapter
stepStarted
 
Methods inherited from class org.optaplanner.core.impl.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.optaplanner.core.impl.localsearch.event.LocalSearchSolverPhaseLifecycleListener
stepStarted
 
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingEnded, solvingStarted
 

Field Detail

tabuSizeStrategy

protected TabuSizeStrategy tabuSizeStrategy

fadingTabuSizeStrategy

protected TabuSizeStrategy fadingTabuSizeStrategy

aspirationEnabled

protected boolean aspirationEnabled

assertTabuHashCodeCorrectness

protected boolean assertTabuHashCodeCorrectness

tabuToStepIndexMap

protected Map<Object,Integer> tabuToStepIndexMap

tabuSequenceList

protected List<Object> tabuSequenceList

workingTabuSize

protected int workingTabuSize

workingFadingTabuSize

protected int workingFadingTabuSize
Constructor Detail

AbstractTabuAcceptor

public AbstractTabuAcceptor()
Method Detail

setTabuSizeStrategy

public void setTabuSizeStrategy(TabuSizeStrategy tabuSizeStrategy)

setFadingTabuSizeStrategy

public void setFadingTabuSizeStrategy(TabuSizeStrategy fadingTabuSizeStrategy)

setAspirationEnabled

public void setAspirationEnabled(boolean aspirationEnabled)

setAssertTabuHashCodeCorrectness

public void setAssertTabuHashCodeCorrectness(boolean assertTabuHashCodeCorrectness)

phaseStarted

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

phaseEnded

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

stepEnded

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

adjustTabuList

protected void adjustTabuList(int tabuStepIndex,
                              Collection<? extends Object> tabus)

isAccepted

public boolean isAccepted(LocalSearchMoveScope 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

findTabu

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

findNewTabu

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

OptaPlanner core 6.0.0.CR2

Copyright © 2006-2013 JBoss by Red Hat. All Rights Reserved.