Class AwaStarSearch<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N,A,V extends java.lang.Comparable<V>>
- java.lang.Object
-
- ai.libs.jaicore.basic.algorithm.AAlgorithm<I,O>
-
- ai.libs.jaicore.basic.algorithm.ASolutionCandidateIterator<I,O>
-
- ai.libs.jaicore.basic.algorithm.AOptimizer<I,EvaluatedSearchGraphPath<N,A,V>,V>
-
- ai.libs.jaicore.search.core.interfaces.AOptimalPathInORGraphSearch<I,N,A,V>
-
- ai.libs.jaicore.search.algorithms.standard.awastar.AwaStarSearch<I,N,A,V>
-
- Type Parameters:
N-A-V-
- All Implemented Interfaces:
java.lang.Iterable<org.api4.java.algorithm.events.IAlgorithmEvent>,java.util.concurrent.Callable<EvaluatedSearchGraphPath<N,A,V>>,java.util.Iterator<org.api4.java.algorithm.events.IAlgorithmEvent>,org.api4.java.ai.graphsearch.problem.IOptimalPathInORGraphSearch<I,EvaluatedSearchGraphPath<N,A,V>,N,A,V>,org.api4.java.ai.graphsearch.problem.IPathInORGraphSearch<I,EvaluatedSearchGraphPath<N,A,V>,N,A>,org.api4.java.ai.graphsearch.problem.IPathSearch<I,EvaluatedSearchGraphPath<N,A,V>,N,A>,org.api4.java.algorithm.IAlgorithm<I,EvaluatedSearchGraphPath<N,A,V>>,org.api4.java.algorithm.IOptimizationAlgorithm<I,EvaluatedSearchGraphPath<N,A,V>,V>,org.api4.java.algorithm.ISolutionCandidateIterator<I,EvaluatedSearchGraphPath<N,A,V>>,org.api4.java.common.control.ICancelable,org.api4.java.common.control.ILoggingCustomizable
public class AwaStarSearch<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N,A,V extends java.lang.Comparable<V>> extends AOptimalPathInORGraphSearch<I,N,A,V>
This is a modified version of the AWA* algorithm for problems without admissible heuristic. Important differences are: - no early termination if a best-f-valued solution is found as f is not optimistic
-
-
Constructor Summary
Constructors Constructor Description AwaStarSearch(I problem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.api4.java.datastructure.graph.implicit.IGraphGenerator<N,A>getGraphGenerator()java.lang.StringgetLoggerName()intgetNumCPUs()org.api4.java.algorithm.events.IAlgorithmEventnextWithException()voidreceiveSolutionEvent(EvaluatedSearchSolutionCandidateFoundEvent<N,A,V> solutionEvent)EvaluatedSearchSolutionCandidateFoundEvent<N,A,V>registerNewSolutionCandidate(EvaluatedSearchGraphPath<N,A,V> solution)voidsetLoggerName(java.lang.String name)voidsetNumCPUs(int numberOfCPUs)protected voidshutdown()-
Methods inherited from class ai.libs.jaicore.search.core.interfaces.AOptimalPathInORGraphSearch
getGoalTester, nextSolutionCandidateEvent, registerSolution
-
Methods inherited from class ai.libs.jaicore.basic.algorithm.AOptimizer
call, getBestScoreKnownToExist, getBestSeenSolution, nextSolutionCandidate, setBestSeenSolution, tellAboutBestScoreKnownToExist, updateBestSeenSolution
-
Methods inherited from class ai.libs.jaicore.basic.algorithm.ASolutionCandidateIterator
collectAllSolutions
-
Methods inherited from class ai.libs.jaicore.basic.algorithm.AAlgorithm
activate, announceTimeoutDetected, avoidReinterruptionOnShutdownOnCurrentThread, cancel, checkAndConductTermination, checkTermination, computeTimeoutAware, getActivationTime, getConfig, getId, getInput, getListeners, getRemainingTimeToDeadline, getState, getTimeout, getTimeoutPrecautionOffset, hasNext, hasThreadBeenInterruptedDuringShutdown, interruptThreadAsPartOfShutdown, isCanceled, isShutdownInitialized, isStopCriterionSatisfied, isTimeouted, iterator, next, post, registerActiveThread, registerListener, resolveShutdownInterruptOnCurrentThread, setConfig, setDeadline, setMaxNumThreads, setState, setTimeout, setTimeout, setTimeoutPrecautionOffset, terminate, unregisterActiveThread, unregisterThreadAndShutdown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.api4.java.algorithm.IAlgorithm
call, getConfig, getId, getInput, getTimeout, registerListener, setMaxNumThreads, setTimeout, setTimeout
-
-
-
-
Constructor Detail
-
AwaStarSearch
public AwaStarSearch(I problem)
-
-
Method Detail
-
receiveSolutionEvent
public void receiveSolutionEvent(EvaluatedSearchSolutionCandidateFoundEvent<N,A,V> solutionEvent)
-
registerNewSolutionCandidate
public EvaluatedSearchSolutionCandidateFoundEvent<N,A,V> registerNewSolutionCandidate(EvaluatedSearchGraphPath<N,A,V> solution)
-
nextWithException
public org.api4.java.algorithm.events.IAlgorithmEvent nextWithException() throws java.lang.InterruptedException, org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException, org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException, org.api4.java.algorithm.exceptions.AlgorithmException- Throws:
java.lang.InterruptedExceptionorg.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledExceptionorg.api4.java.algorithm.exceptions.AlgorithmTimeoutedExceptionorg.api4.java.algorithm.exceptions.AlgorithmException
-
shutdown
protected void shutdown()
- Overrides:
shutdownin classai.libs.jaicore.basic.algorithm.AAlgorithm<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,EvaluatedSearchGraphPath<N,A,V extends java.lang.Comparable<V>>>
-
setNumCPUs
public void setNumCPUs(int numberOfCPUs)
- Specified by:
setNumCPUsin interfaceorg.api4.java.algorithm.IAlgorithm<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N>- Overrides:
setNumCPUsin classai.libs.jaicore.basic.algorithm.AAlgorithm<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,EvaluatedSearchGraphPath<N,A,V extends java.lang.Comparable<V>>>
-
getNumCPUs
public int getNumCPUs()
- Specified by:
getNumCPUsin interfaceorg.api4.java.algorithm.IAlgorithm<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N>- Overrides:
getNumCPUsin classai.libs.jaicore.basic.algorithm.AAlgorithm<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,EvaluatedSearchGraphPath<N,A,V extends java.lang.Comparable<V>>>
-
getGraphGenerator
public org.api4.java.datastructure.graph.implicit.IGraphGenerator<N,A> getGraphGenerator()
- Specified by:
getGraphGeneratorin interfaceorg.api4.java.ai.graphsearch.problem.IPathSearch<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N,A,V extends java.lang.Comparable<V>>- Overrides:
getGraphGeneratorin classAOptimalPathInORGraphSearch<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N,A,V extends java.lang.Comparable<V>>
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable- Overrides:
setLoggerNamein classAOptimalPathInORGraphSearch<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N,A,V extends java.lang.Comparable<V>>
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable- Overrides:
getLoggerNamein classAOptimalPathInORGraphSearch<I extends GraphSearchWithSubpathEvaluationsInput<N,A,V>,N,A,V extends java.lang.Comparable<V>>
-
-