moise.os.fs
Class Goal
java.lang.Object
moise.common.MoiseElement
moise.os.fs.Goal
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable, Identifiable, ToProlog, ToXML
public class Goal
- extends MoiseElement
- implements ToXML, ToProlog
Represents a Goal (in the specification).
- See Also:
- Serialized Form
Constructor Summary |
Goal(java.lang.String goal)
|
Method Summary |
java.util.Map<java.lang.String,java.lang.Object> |
getArguments()
returns a map of the goal's arguments (key is the argument, value is the default value) |
org.w3c.dom.Element |
getAsDOM(org.w3c.dom.Document document)
|
java.lang.String |
getAsProlog()
returns a string representing the goal in Prolog syntax, format:
goal(id,type,description,#ags to satisfy,time to fulfill,list of arguments, plan) |
java.lang.String |
getDescription()
|
Plan |
getInPlan()
|
int |
getMinAgToSatisfy()
gets the minimum number of committed agents that should satify the goal for the goal to be considered globaly satisfied |
Plan |
getPlan()
gets the plan to achieve this goal (in case the goal is the head of a plan) |
java.util.List<Goal> |
getPreConditionGoals()
|
Scheme |
getScheme()
|
java.lang.String |
getTTF()
|
Goal.GoalType |
getType()
|
static java.lang.String |
getXMLTag()
|
boolean |
hasArguments()
|
boolean |
hasPlan()
|
void |
setDescription(java.lang.String s)
|
void |
setFromDOM(org.w3c.dom.Element ele,
Scheme sch)
|
void |
setInPlan(Plan p)
|
void |
setMinAgToSatisfy(int n)
sets the minimum number of committed agents that should satify the goal for the goal to be considered globaly satisfied |
void |
setPlan(Plan p)
|
void |
setScheme(Scheme sch)
|
void |
setTTF(java.lang.String ttf)
|
void |
setType(Goal.GoalType t)
|
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, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
plan
protected Plan plan
inPlan
protected Plan inPlan
sch
protected Scheme sch
desc
protected java.lang.String desc
type
protected Goal.GoalType type
minAgToSat
protected int minAgToSat
args
protected java.util.Map<java.lang.String,java.lang.Object> args
ttf
protected java.lang.String ttf
Goal
public Goal(java.lang.String goal)
hasArguments
public boolean hasArguments()
setScheme
public void setScheme(Scheme sch)
getScheme
public Scheme getScheme()
setInPlan
public void setInPlan(Plan p)
getInPlan
public Plan getInPlan()
getArguments
public java.util.Map<java.lang.String,java.lang.Object> getArguments()
- returns a map of the goal's arguments (key is the argument, value is the default value)
setPlan
public void setPlan(Plan p)
getPlan
public Plan getPlan()
- gets the plan to achieve this goal (in case the goal is the head of a plan)
hasPlan
public boolean hasPlan()
setDescription
public void setDescription(java.lang.String s)
getDescription
public java.lang.String getDescription()
getPreConditionGoals
public java.util.List<Goal> getPreConditionGoals()
setMinAgToSatisfy
public void setMinAgToSatisfy(int n)
- sets the minimum number of committed agents that should satify the goal for the goal to be considered globaly satisfied
getMinAgToSatisfy
public int getMinAgToSatisfy()
- gets the minimum number of committed agents that should satify the goal for the goal to be considered globaly satisfied
getType
public Goal.GoalType getType()
setType
public void setType(Goal.GoalType t)
getTTF
public java.lang.String getTTF()
setTTF
public void setTTF(java.lang.String ttf)
getXMLTag
public static java.lang.String getXMLTag()
getAsProlog
public java.lang.String getAsProlog()
- returns a string representing the goal in Prolog syntax, format:
goal(id,type,description,#ags to satisfy,time to fulfill,list of arguments, plan)
- Specified by:
getAsProlog
in interface ToProlog
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,
Scheme sch)
throws MoiseException
- Throws:
MoiseException