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 classGoal.GoalType -
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>argsprotected java.util.List<Goal>dependenciesprotected java.lang.Stringdescprotected PlaninPlanprotected java.lang.Stringlocationprotected intminAgToSatprotected Planplanprotected Schemeschprivate static longserialVersionUIDprotected java.lang.Stringttfprotected Goal.GoalTypetypeFields inherited from class moise.common.MoiseElement
debug -
Constructor Summary
Constructors Constructor Description Goal(java.lang.String goal) -
Method Summary
Modifier and Type Method Description voidaddArgument(java.lang.String argId, java.lang.Object value)voidaddDependence(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.ElementgetAsDOM(org.w3c.dom.Document document)java.lang.StringgetAsProlog()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()intgetDepth()java.lang.StringgetDescription()PlangetInPlan()java.lang.StringgetLocation()intgetMinAgToSatisfy()gets the minimum number of committed agents that should satisfy the goal for the goal to be considered globally satisfiedPlangetPlan()gets the plan to achieve this goal (in case the goal is the head of a plan)java.util.List<Goal>getPreConditionGoals()SchemegetScheme()java.lang.StringgetTTF()Goal.GoalTypegetType()static java.lang.StringgetXMLTag()booleanhasArguments()booleanhasDependence()booleanhasPlan()booleanisRoot()voidsetDescription(java.lang.String s)voidsetFromDOM(org.w3c.dom.Element ele, Scheme sch)voidsetInPlan(Plan p)voidsetLocation(java.lang.String l)voidsetMinAgToSatisfy(int n)sets the minimum number of committed agents that should satisfy the goal for the goal to be considered globally satisfiedvoidsetPlan(Plan p)voidsetScheme(Scheme sch)voidsetTTF(java.lang.String ttf)voidsetType(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, toStringMethods 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
-
plan
-
inPlan
-
sch
-
desc
protected java.lang.String desc -
type
-
minAgToSat
protected int minAgToSat -
args
protected java.util.Map<java.lang.String,java.lang.Object> args -
ttf
protected java.lang.String ttf -
dependencies
-
location
protected java.lang.String location
-
-
Constructor Details
-
Goal
public Goal(java.lang.String goal)
-
-
Method Details
-
hasArguments
public boolean hasArguments() -
addArgument
public void addArgument(java.lang.String argId, java.lang.Object value) -
setScheme
-
getScheme
-
setInPlan
-
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
-
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
-
hasDependence
public boolean hasDependence() -
getDependencies
-
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
-
setType
-
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:
getAsPrologin interfaceToProlog
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document) -
setFromDOM
- Throws:
MoiseException
-