Class GraphBasedMDP<N,​A>

  • All Implemented Interfaces:
    IMDP<N,​A,​java.lang.Double>, org.api4.java.common.control.ILoggingCustomizable

    public class GraphBasedMDP<N,​A>
    extends java.lang.Object
    implements IMDP<N,​A,​java.lang.Double>, org.api4.java.common.control.ILoggingCustomizable
    • Constructor Detail

      • GraphBasedMDP

        public GraphBasedMDP​(org.api4.java.ai.graphsearch.problem.IPathSearchWithPathEvaluationsInput<N,​A,​java.lang.Double> graph)
    • Method Detail

      • getInitState

        public N getInitState()
        Specified by:
        getInitState in interface IMDP<N,​A,​java.lang.Double>
      • isMaximizing

        public boolean isMaximizing()
        Specified by:
        isMaximizing in interface IMDP<N,​A,​java.lang.Double>
      • getApplicableActions

        public java.util.Collection<A> getApplicableActions​(N state)
                                                     throws java.lang.InterruptedException
        Specified by:
        getApplicableActions in interface IMDP<N,​A,​java.lang.Double>
        Throws:
        java.lang.InterruptedException
      • getProb

        public java.util.Map<N,​java.lang.Double> getProb​(N state,
                                                               A action)
                                                        throws java.lang.InterruptedException
        Specified by:
        getProb in interface IMDP<N,​A,​java.lang.Double>
        Throws:
        java.lang.InterruptedException
      • getProb

        public double getProb​(N state,
                              A action,
                              N successor)
                       throws java.lang.InterruptedException
        Specified by:
        getProb in interface IMDP<N,​A,​java.lang.Double>
        Throws:
        java.lang.InterruptedException
      • getScore

        public java.lang.Double getScore​(N state,
                                         A action,
                                         N successor)
                                  throws org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.PathEvaluationException,
                                         java.lang.InterruptedException
        Specified by:
        getScore in interface IMDP<N,​A,​java.lang.Double>
        Throws:
        org.api4.java.ai.graphsearch.problem.pathsearch.pathevaluation.PathEvaluationException
        java.lang.InterruptedException
      • isTerminalState

        public boolean isTerminalState​(N state)
                                throws java.lang.InterruptedException
        Specified by:
        isTerminalState in interface IMDP<N,​A,​java.lang.Double>
        Throws:
        java.lang.InterruptedException
      • getLoggerName

        public java.lang.String getLoggerName()
        Specified by:
        getLoggerName in interface org.api4.java.common.control.ILoggingCustomizable
      • setLoggerName

        public void setLoggerName​(java.lang.String name)
        Specified by:
        setLoggerName in interface org.api4.java.common.control.ILoggingCustomizable
      • getUniformlyRandomApplicableAction

        public A getUniformlyRandomApplicableAction​(N state,
                                                    java.util.Random random)
                                             throws java.lang.InterruptedException
        Specified by:
        getUniformlyRandomApplicableAction in interface IMDP<N,​A,​java.lang.Double>
        Throws:
        java.lang.InterruptedException
      • isActionApplicableInState

        public boolean isActionApplicableInState​(N state,
                                                 A action)
                                          throws java.lang.InterruptedException
        Specified by:
        isActionApplicableInState in interface IMDP<N,​A,​java.lang.Double>
        Throws:
        java.lang.InterruptedException