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).
- See Also:
- Serialized Form
Methods inherited from class moise.common.MoiseElement |
compareTo, equals, getBoolProperty, getBoolProperty, getCreationDate, getFullId, getId, getId, getOwner, getPrefix, getPrefix, getProperties, getPropertiesAsDOM, getPropertiesAsProlog, getProperty, getStrProperty, hashCode, setId, setOwner, setPrefix, setPropertiesFromDOM, setProperty |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
subGoals
protected java.util.List<Goal> subGoals
op
protected Plan.PlanOpType op
successRate
protected double successRate
target
protected Goal target
sch
protected Scheme sch
Plan
public Plan(Scheme sch)
Plan
public Plan(Plan.PlanOpType op,
Scheme sch,
java.lang.String targetGoalId)
throws MoiseConsistencyException
- Throws:
MoiseConsistencyException
setOp
public void setOp(Plan.PlanOpType op)
throws MoiseConsistencyException
- Throws:
MoiseConsistencyException
getOp
public Plan.PlanOpType getOp()
getTargetGoal
public Goal getTargetGoal()
addSubGoal
public void addSubGoal(java.lang.String goalId)
throws MoiseConsistencyException
- Throws:
MoiseConsistencyException
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