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 boolean
doesPrimaryNodeEvaluatorReportSolutions()
V
evaluate(org.api4.java.datastructure.graph.ILabeledPath<N,A> node)
java.lang.String
getLoggerName()
org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V>
getPrimaryNodeEvaluator()
void
registerSolutionListener(java.lang.Object listener)
boolean
reportsSolutions()
default implementation that is just correct with respect to the decorated node evaluator.boolean
requiresGraphGenerator()
default implementation that is just correct with respect to the decorated node evaluator.void
setGenerator(org.api4.java.datastructure.graph.implicit.IGraphGenerator<N,A> generator, org.api4.java.ai.graphsearch.problem.implicit.graphgenerator.IPathGoalTester<N,A> goalTester)
void
setLoggerName(java.lang.String name)
java.lang.String
toString()
-
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:DecoratingNodeEvaluator
default 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:
requiresGraphGenerator
in interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallyGraphDependentPathEvaluator<N,A,V extends java.lang.Comparable<V>>
- Overrides:
requiresGraphGenerator
in 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:DecoratingNodeEvaluator
default 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:
reportsSolutions
in interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallySolutionReportingPathEvaluator<N,A,V extends java.lang.Comparable<V>>
- Overrides:
reportsSolutions
in 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:
setGenerator
in interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallyGraphDependentPathEvaluator<N,A,V extends java.lang.Comparable<V>>
- Overrides:
setGenerator
in classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
registerSolutionListener
public void registerSolutionListener(java.lang.Object listener)
- Specified by:
registerSolutionListener
in interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallySolutionReportingPathEvaluator<N,A,V extends java.lang.Comparable<V>>
- Overrides:
registerSolutionListener
in 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:
evaluate
in interfaceorg.api4.java.common.attributedobjects.IObjectEvaluator<N,A>
- Specified by:
evaluate
in interfaceorg.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,A,V extends java.lang.Comparable<V>>
- Overrides:
evaluate
in classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
- Throws:
org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.PathEvaluationException
java.lang.InterruptedException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerName
in interfaceorg.api4.java.common.control.ILoggingCustomizable
- Overrides:
getLoggerName
in classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerName
in interfaceorg.api4.java.common.control.ILoggingCustomizable
- Overrides:
setLoggerName
in classDecoratingNodeEvaluator<N,A,V extends java.lang.Comparable<V>>
-
-