Package 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).- Author:
- Jomi Fred Hubner
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Goal.GoalType
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
args
protected java.util.List<Goal>
dependencies
protected java.lang.String
desc
protected Plan
inPlan
protected java.lang.String
location
protected int
minAgToSat
protected Plan
plan
protected Scheme
sch
private static long
serialVersionUID
protected java.lang.String
ttf
protected Goal.GoalType
type
-
Fields inherited from class moise.common.MoiseElement
debug
-
-
Constructor Summary
Constructors Constructor Description Goal(java.lang.String goal)
-
Method Summary
Modifier and Type Method Description void
addArgument(java.lang.String argId, java.lang.Object value)
void
addDependence(Goal g)
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)[location(L)]java.util.List<Goal>
getDependencies()
int
getDepth()
java.lang.String
getDescription()
Plan
getInPlan()
java.lang.String
getLocation()
int
getMinAgToSatisfy()
gets the minimum number of committed agents that should satisfy the goal for the goal to be considered globally satisfiedPlan
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
hasDependence()
boolean
hasPlan()
boolean
isRoot()
void
setDescription(java.lang.String s)
void
setFromDOM(org.w3c.dom.Element ele, Scheme sch)
void
setInPlan(Plan p)
void
setLocation(java.lang.String l)
void
setMinAgToSatisfy(int n)
sets the minimum number of committed agents that should satisfy the goal for the goal to be considered globally satisfiedvoid
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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
-
dependencies
protected java.util.List<Goal> dependencies
-
location
protected java.lang.String location
-
-
Method Detail
-
hasArguments
public boolean hasArguments()
-
addArgument
public void addArgument(java.lang.String argId, java.lang.Object value)
-
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()
-
addDependence
public void addDependence(Goal g)
-
hasDependence
public boolean hasDependence()
-
getDependencies
public java.util.List<Goal> getDependencies()
-
getPreConditionGoals
public java.util.List<Goal> getPreConditionGoals()
-
setMinAgToSatisfy
public void setMinAgToSatisfy(int n)
sets the minimum number of committed agents that should satisfy the goal for the goal to be considered globally satisfied
-
getMinAgToSatisfy
public int getMinAgToSatisfy()
gets the minimum number of committed agents that should satisfy the goal for the goal to be considered globally 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)
-
getLocation
public java.lang.String getLocation()
-
setLocation
public void setLocation(java.lang.String l)
-
getXMLTag
public static java.lang.String getXMLTag()
-
isRoot
public boolean isRoot()
-
getDepth
public int getDepth()
-
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)[location(L)]- Specified by:
getAsProlog
in interfaceToProlog
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
-
setFromDOM
public void setFromDOM(org.w3c.dom.Element ele, Scheme sch) throws MoiseException
- Throws:
MoiseException
-
-