Package moise.os.fs

Class Plan

java.lang.Object
moise.common.MoiseElement
moise.os.fs.Plan
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, Identifiable, ToProlog, ToXML

public class Plan
extends MoiseElement
implements ToXML, ToProlog
Represents a Plan (one operator, and success rate, and a set of goals).
Author:
Jomi Fred Hubner
See Also:
Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
      Constant Field Values
    • subGoals

      protected java.util.List<Goal> subGoals
    • op

      protected Plan.PlanOpType op
    • successRate

      protected double successRate
    • target

      protected Goal target
    • sch

      protected Scheme sch
  • Constructor Details

  • Method Details

    • setOp

      public void setOp​(Plan.PlanOpType op) throws MoiseConsistencyException
      Throws:
      MoiseConsistencyException
    • getOp

      public Plan.PlanOpType getOp()
    • setTarget

      private void setTarget​(java.lang.String targetGoalId) throws MoiseConsistencyException
      Throws:
      MoiseConsistencyException
    • setTarget

      private void setTarget​(Goal goal) throws MoiseConsistencyException
      Throws:
      MoiseConsistencyException
    • getTargetGoal

      public Goal getTargetGoal()
    • addSubGoal

      public void addSubGoal​(java.lang.String goalId) throws MoiseConsistencyException
      Throws:
      MoiseConsistencyException
    • addSubGoal

      public void addSubGoal​(Goal g)
    • removeSubGoal

      public boolean removeSubGoal​(Goal g)
    • getSubGoals

      public java.util.List<Goal> getSubGoals()
    • containsSubGoals

      public Goal containsSubGoals​(java.lang.String goalId)
      Looks into the subgoals of the plan to find out a Goal like goalId
    • getPreviousSubGoals

      public Goal getPreviousSubGoals​(java.lang.String goalId)
      Looks into the subgoals of the plan to find out the previous Goal of goalId. E.g: for the plan "p = g1, g2, g3", the g2's previous goal is g1. Returns null either if the goal does no exist or has no previous goal.
    • setSuccessRate

      public void setSuccessRate​(double d)
    • getSuccessRate

      public double getSuccessRate()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class MoiseElement
    • getAsProlog

      public java.lang.String getAsProlog()
      returns a string representing the plan in Prolog syntax, format: plan(operator,list of goals)
      Specified by:
      getAsProlog in interface ToProlog
    • getXMLTag

      public static java.lang.String getXMLTag()
    • getAsDOM

      public org.w3c.dom.Element getAsDOM​(org.w3c.dom.Document document)
      Specified by:
      getAsDOM in interface ToXML
    • setFromDOM

      public void setFromDOM​(org.w3c.dom.Element ele, Goal targetGoal) throws MoiseException
      Throws:
      MoiseException