Class AlternativeNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
- java.lang.Object
-
- ai.libs.jaicore.search.algorithms.standard.bestfirst.nodeevaluation.DecoratingNodeEvaluator<N,A,V>
-
- ai.libs.jaicore.search.algorithms.standard.bestfirst.nodeevaluation.AlternativeNodeEvaluator<N,A,V>
-
- Type Parameters:
N-V-
- All Implemented Interfaces:
org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.ICancelablePathEvaluator,org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V>,org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallyGraphDependentPathEvaluator<N,A,V>,org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallySolutionReportingPathEvaluator<N,A,V>,org.api4.java.common.attributedobjects.IGetter<org.api4.java.datastructure.graph.ILabeledPath<N,A>,V>,org.api4.java.common.attributedobjects.IObjectEvaluator<org.api4.java.datastructure.graph.ILabeledPath<N,A>,V>,org.api4.java.common.control.ILoggingCustomizable
- Direct Known Subclasses:
CoveringNodeEvaluator,PathVsSubpathNodeEvaluator
public class AlternativeNodeEvaluator<N,A,V extends java.lang.Comparable<V>> extends DecoratingNodeEvaluator<N,A,V> implements org.api4.java.common.control.ILoggingCustomizable
This node evaluator can be used a) if there is a prioritized node evaluator that should be used unless it returns NULL b) to realize dead-end recognition c) to use different node evaluators in different regions of the search graph
-
-
Constructor Summary
Constructors Constructor Description AlternativeNodeEvaluator(org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V> ne1, org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V> ne2)AlternativeNodeEvaluator(org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V> ne1, org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V> ne2, boolean enforceExecutionOfSecondEvaluator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoesPrimaryNodeEvaluatorReportSolutions()Vevaluate(org.api4.java.datastructure.graph.ILabeledPath<N,A> node)java.lang.StringgetLoggerName()org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V>getPrimaryNodeEvaluator()voidregisterSolutionListener(java.lang.Object listener)booleanreportsSolutions()default implementation that is just correct with respect to the decorated node evaluator.booleanrequiresGraphGenerator()default implementation that is just correct with respect to the decorated node evaluator.voidsetGenerator(org.api4.java.datastructure.graph.implicit.IGraphGenerator<N,A> generator, org.api4.java.ai.graphsearch.problem.implicit.graphgenerator.IPathGoalTester<N,A> goalTester)voidsetLoggerName(java.lang.String name)java.lang.StringtoString()-
Methods inherited from class ai.libs.jaicore.search.algorithms.standard.bestfirst.nodeevaluation.DecoratingNodeEvaluator
cancelActiveTasks, doesDecoratedEvaluatorReportSolutions, getEvaluator, isDecoratedEvaluatorCancelable, isDecoratedEvaluatorGraphDependent
-
-
-
-
Method Detail
-
requiresGraphGenerator
public boolean requiresGraphGenerator()
Description copied from class:DecoratingNodeEvaluatordefault implementation that is just correct with respect to the decorated node evaluator. If the node evaluator that inherits from DecoratingNodeEvaluator itself may require the graph, this method should be overwritten.- Specified by:
requiresGraphGeneratorin interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallyGraphDependentPathEvaluator<N,A,V extends java.lang.Comparable<V>>- Overrides:
requiresGraphGeneratorin classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
doesPrimaryNodeEvaluatorReportSolutions
public boolean doesPrimaryNodeEvaluatorReportSolutions()
-
getPrimaryNodeEvaluator
public org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V> getPrimaryNodeEvaluator()
-
reportsSolutions
public boolean reportsSolutions()
Description copied from class:DecoratingNodeEvaluatordefault implementation that is just correct with respect to the decorated node evaluator. If the node evaluator that inherits from DecoratingNodeEvaluator itself may be solution reporting, this method should be overwritten.- Specified by:
reportsSolutionsin interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallySolutionReportingPathEvaluator<N,A,V extends java.lang.Comparable<V>>- Overrides:
reportsSolutionsin classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
setGenerator
public void setGenerator(org.api4.java.datastructure.graph.implicit.IGraphGenerator<N,A> generator, org.api4.java.ai.graphsearch.problem.implicit.graphgenerator.IPathGoalTester<N,A> goalTester)
- Specified by:
setGeneratorin interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallyGraphDependentPathEvaluator<N,A,V extends java.lang.Comparable<V>>- Overrides:
setGeneratorin classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
registerSolutionListener
public void registerSolutionListener(java.lang.Object listener)
- Specified by:
registerSolutionListenerin interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallySolutionReportingPathEvaluator<N,A,V extends java.lang.Comparable<V>>- Overrides:
registerSolutionListenerin classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
evaluate
public V evaluate(org.api4.java.datastructure.graph.ILabeledPath<N,A> node) throws org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.PathEvaluationException, java.lang.InterruptedException
- Specified by:
evaluatein interfaceorg.api4.java.common.attributedobjects.IObjectEvaluator<N,A>- Specified by:
evaluatein interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V extends java.lang.Comparable<V>>- Overrides:
evaluatein classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>- Throws:
org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.PathEvaluationExceptionjava.lang.InterruptedException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable- Overrides:
getLoggerNamein classDecoratingNodeEvaluator<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 classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
-