Package jason.asSemantics
Class Intention
java.lang.Object
jason.asSemantics.Intention
- All Implemented Interfaces:
ToDOM
,java.io.Serializable
,java.lang.Comparable<Intention>
,java.lang.Iterable<IntendedMeans>
- Direct Known Subclasses:
fork.ForkIntention
public class Intention extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Intention>, java.lang.Iterable<IntendedMeans>, ToDOM
Represents and Intention (a stack of IntendedMeans).
The comparable sorts the intentions based on the atomic property:
atomic intentions comes first.
- Author:
- Jomi and Rafael
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Intention.State
-
Field Summary
Fields Modifier and Type Field Description private int
atomicCount
static Intention
EmptyInt
private Intention
gIntention
private int
id
private static java.util.concurrent.atomic.AtomicInteger
idCount
private int
imWithGoalCondition
private java.util.Deque<IntendedMeans>
intendedMeans
private int
interestedInUpdateEvents
private boolean
isSuspended
static Atom
noReason
private Circumstance.IntentionPlace
place
private static long
serialVersionUID
private Term
suspendedReason
-
Constructor Summary
Constructors Constructor Description Intention()
-
Method Summary
Modifier and Type Method Description void
clearIM()
Intention
clone()
int
compareTo(Intention o)
atomic intentions are grater than not atomic intentionsvoid
copyTo(Intention i)
IntendedMeans
dropGoal(IMCondition c, Unifier u)
remove all IMs until the lowest IM that succeeds in test cboolean
equals(java.lang.Object o)
void
fail(Circumstance c)
Pair<Event,java.lang.Integer>
findEventForFailure(Trigger tevent, PlanLibrary pl, Circumstance c)
org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
get as XMLStructure
getAsTerm()
IntendedMeans
getBottom()
Intention
getGIntention()
int
getId()
IntendedMeans
getIM(IMCondition c, Unifier u)
returns the IntendedMeans that succeeds in test c, returns null if there isn't oneCircumstance.IntentionPlace
getPlace()
returns where the intention is in the interpreter data structures.Intention.State
getStateBasedOnPlace()
Term
getSuspendedReason()
boolean
hasGoalCondition()
int
hashCode()
boolean
hasInterestInUpdateEvents()
boolean
hasTrigger(Trigger g, Unifier u)
returns true if the intention has an IM where TE = g, using u to verify equalityboolean
isAtomic()
boolean
isFinished()
boolean
isSuspended()
java.util.Iterator<IntendedMeans>
iterator()
IntendedMeans
peek()
IntendedMeans
pop()
void
push(IntendedMeans im)
void
setAtomic(int a)
void
setGIntention(Intention i)
void
setNoInterestInUpdateEvents()
void
setPlace(Circumstance.IntentionPlace place)
void
setSuspended(boolean b)
suspended intention means suspended by the internal action .suspendvoid
setSuspendedReason(Term r)
int
size()
java.lang.String
toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
EmptyInt
-
idCount
private static java.util.concurrent.atomic.AtomicInteger idCount -
id
private int id -
atomicCount
private int atomicCount -
isSuspended
private boolean isSuspended -
suspendedReason
-
place
-
interestedInUpdateEvents
private int interestedInUpdateEvents -
imWithGoalCondition
private int imWithGoalCondition -
gIntention
-
intendedMeans
-
noReason
-
-
Constructor Details
-
Intention
public Intention()
-
-
Method Details
-
setGIntention
-
getGIntention
-
getId
public int getId() -
push
-
peek
-
pop
-
isAtomic
public boolean isAtomic() -
setAtomic
public void setAtomic(int a) -
setNoInterestInUpdateEvents
public void setNoInterestInUpdateEvents() -
hasInterestInUpdateEvents
public boolean hasInterestInUpdateEvents() -
hasGoalCondition
public boolean hasGoalCondition() -
iterator
- Specified by:
iterator
in interfacejava.lang.Iterable<IntendedMeans>
-
isFinished
public boolean isFinished() -
size
public int size() -
clearIM
public void clearIM() -
setSuspended
public void setSuspended(boolean b)suspended intention means suspended by the internal action .suspend -
isSuspended
public boolean isSuspended() -
setSuspendedReason
-
getSuspendedReason
-
getIM
returns the IntendedMeans that succeeds in test c, returns null if there isn't one -
getBottom
-
getPlace
returns where the intention is in the interpreter data structures. It is updated by circumstance getAllIntentions. -
setPlace
-
getStateBasedOnPlace
-
hasTrigger
returns true if the intention has an IM where TE = g, using u to verify equality -
dropGoal
remove all IMs until the lowest IM that succeeds in test c -
fail
-
findEventForFailure
public Pair<Event,java.lang.Integer> findEventForFailure(Trigger tevent, PlanLibrary pl, Circumstance c) -
compareTo
atomic intentions are grater than not atomic intentions- Specified by:
compareTo
in interfacejava.lang.Comparable<Intention>
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
clone
- Overrides:
clone
in classjava.lang.Object
-
copyTo
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getAsTerm
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)get as XML
-