Class AlternativeNodeEvaluator<N,​A,​V extends java.lang.Comparable<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 Detail

      • AlternativeNodeEvaluator

        public 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

        public 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 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 interface org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallyGraphDependentPathEvaluator<N,​A,​V extends java.lang.Comparable<V>>
        Overrides:
        requiresGraphGenerator in class DecoratingNodeEvaluator<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 interface org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallySolutionReportingPathEvaluator<N,​A,​V extends java.lang.Comparable<V>>
        Overrides:
        reportsSolutions in class DecoratingNodeEvaluator<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 interface org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallyGraphDependentPathEvaluator<N,​A,​V extends java.lang.Comparable<V>>
        Overrides:
        setGenerator in class DecoratingNodeEvaluator<N,​A,​V extends java.lang.Comparable<V>>
      • registerSolutionListener

        public void registerSolutionListener​(java.lang.Object listener)
        Specified by:
        registerSolutionListener in interface org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPotentiallySolutionReportingPathEvaluator<N,​A,​V extends java.lang.Comparable<V>>
        Overrides:
        registerSolutionListener in class DecoratingNodeEvaluator<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 interface org.api4.java.common.attributedobjects.IObjectEvaluator<N,​A>
        Specified by:
        evaluate in interface org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.IPathEvaluator<N,​A,​V extends java.lang.Comparable<V>>
        Overrides:
        evaluate in class DecoratingNodeEvaluator<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 class java.lang.Object
      • getLoggerName

        public java.lang.String getLoggerName()
        Specified by:
        getLoggerName in interface org.api4.java.common.control.ILoggingCustomizable
        Overrides:
        getLoggerName in class DecoratingNodeEvaluator<N,​A,​V extends java.lang.Comparable<V>>
      • setLoggerName

        public void setLoggerName​(java.lang.String name)
        Specified by:
        setLoggerName in interface org.api4.java.common.control.ILoggingCustomizable
        Overrides:
        setLoggerName in class DecoratingNodeEvaluator<N,​A,​V extends java.lang.Comparable<V>>