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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPlan.PlanOpType -
Field Summary
Fields Modifier and Type Field Description protected Plan.PlanOpTypeopprotected Schemeschprivate static longserialVersionUIDprotected java.util.List<Goal>subGoalsprotected doublesuccessRateprotected GoaltargetFields inherited from class moise.common.MoiseElement
debug -
Constructor Summary
Constructors Constructor Description Plan(Plan.PlanOpType op, Scheme sch, java.lang.String targetGoalId)Plan(Scheme sch) -
Method Summary
Modifier and Type Method Description voidaddSubGoal(java.lang.String goalId)voidaddSubGoal(Goal g)GoalcontainsSubGoals(java.lang.String goalId)Looks into the subgoals of the plan to find out a Goal like goalIdorg.w3c.dom.ElementgetAsDOM(org.w3c.dom.Document document)java.lang.StringgetAsProlog()returns a string representing the plan in Prolog syntax, format: plan(operator,list of goals)Plan.PlanOpTypegetOp()GoalgetPreviousSubGoals(java.lang.String goalId)Looks into the subgoals of the plan to find out the previous Goal of goalId.java.util.List<Goal>getSubGoals()doublegetSuccessRate()GoalgetTargetGoal()static java.lang.StringgetXMLTag()booleanremoveSubGoal(Goal g)voidsetFromDOM(org.w3c.dom.Element ele, Goal targetGoal)voidsetOp(Plan.PlanOpType op)voidsetSuccessRate(double d)private voidsetTarget(java.lang.String targetGoalId)private voidsetTarget(Goal goal)java.lang.StringtoString()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, setPropertyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
subGoals
-
op
-
successRate
protected double successRate -
target
-
sch
-
-
Constructor Details
-
Plan
-
Plan
public Plan(Plan.PlanOpType op, Scheme sch, java.lang.String targetGoalId) throws MoiseConsistencyException- Throws:
MoiseConsistencyException
-
-
Method Details
-
setOp
- Throws:
MoiseConsistencyException
-
getOp
-
setTarget
- Throws:
MoiseConsistencyException
-
setTarget
- Throws:
MoiseConsistencyException
-
getTargetGoal
-
addSubGoal
- Throws:
MoiseConsistencyException
-
addSubGoal
-
removeSubGoal
-
getSubGoals
-
containsSubGoals
Looks into the subgoals of the plan to find out a Goal like goalId -
getPreviousSubGoals
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:
toStringin classMoiseElement
-
getAsProlog
public java.lang.String getAsProlog()returns a string representing the plan in Prolog syntax, format: plan(operator,list of goals)- Specified by:
getAsPrologin interfaceToProlog
-
getXMLTag
public static java.lang.String getXMLTag() -
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document) -
setFromDOM
- Throws:
MoiseException
-