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 class
Plan.PlanOpType
-
Field Summary
Fields Modifier and Type Field Description protected Plan.PlanOpType
op
protected Scheme
sch
private static long
serialVersionUID
protected java.util.List<Goal>
subGoals
protected double
successRate
protected Goal
target
-
Fields 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 void
addSubGoal(java.lang.String goalId)
Goal
containsSubGoals(java.lang.String goalId)
Looks into the subgoals of the plan to find out a Goal like goalIdorg.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
java.lang.String
getAsProlog()
returns a string representing the plan in Prolog syntax, format: plan(operator,list of goals)Plan.PlanOpType
getOp()
Goal
getPreviousSubGoals(java.lang.String goalId)
Looks into the subgoals of the plan to find out the previous Goal of goalId.java.util.List<Goal>
getSubGoals()
double
getSuccessRate()
Goal
getTargetGoal()
static java.lang.String
getXMLTag()
void
setFromDOM(org.w3c.dom.Element ele, Goal targetGoal)
void
setOp(Plan.PlanOpType op)
void
setSuccessRate(double d)
private void
setTarget(java.lang.String targetGoalId)
private void
setTarget(Goal goal)
java.lang.String
toString()
-
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
-
-
-
-
Field Detail
-
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 Detail
-
Plan
public Plan(Scheme sch)
-
Plan
public Plan(Plan.PlanOpType op, Scheme sch, java.lang.String targetGoalId) throws MoiseConsistencyException
- Throws:
MoiseConsistencyException
-
-
Method Detail
-
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
-
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 classMoiseElement
-
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 interfaceToProlog
-
getXMLTag
public static java.lang.String getXMLTag()
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
-
setFromDOM
public void setFromDOM(org.w3c.dom.Element ele, Goal targetGoal) throws MoiseException
- Throws:
MoiseException
-
-