|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.sposh.elements.PoshElement<THIS,PARENT> cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement<THIS,PARENT> cz.cuni.amis.pogamut.sposh.elements.NamedLapElement<DriveCollection,PoshPlan> cz.cuni.amis.pogamut.sposh.elements.DriveCollection
public final class DriveCollection
This is root of POSH plan in execution sense. In source of POSH plan, this is leaf of root. Every POSH plan can have only one DriveCollection.
drive collection: this is the root of the POSH hierarchy, and on every POSH action-selection cycle, this reconsiders which goal the agent should be working on. This is how a BOD agent can respond rapidly to changes in the environment. How does it work? Fact: Engine remembers which node of the drive it processed last time. When engine evaluates the drive, it starts evaluation in the place, where it left off in the last evaluation of drive. Engine evaluates the plan each tick, but it doesn't matter if drive was evaluated in previsous tick or 10000 ticks ago (e.g. trigger of the drive was unsatisfied for a long time), engine will take the state (state=path from the drive to some node in the drive tree) it was left off last time and goes from there, e.g. if drive was evaluating which action it should do, it will continue to do so, if drive was executing some action, it will continue in its execution. By "will continue in..." is meant "will try to continue...", because in many cases, it will fail(the action will signal its failure ect.), but it doesn't matter, in such case the engine will traverse the drive's decision tree from the root. Originally it was supposed to enable quick switch to some action and go back to doing whatever the original drive was doing. Not sure about how useful it is.
Competences are similar, but slightly different. There is a
lot of confusion about how they differ from DC, so take a look.
Field Summary | |
---|---|
static DataFlavor |
dataFlavor
Data flavor of DC, used for drag and drop |
static String |
dcName
Property name for change of name. |
Fields inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement |
---|
IDENT_PATTERN |
Method Summary | |
---|---|
void |
addDrive(DriveElement drive)
Add passed drive as the last drive of this DC and emit new it. |
void |
addDrive(int index,
DriveElement drive)
|
DataFlavor |
getDataFlavor()
Get data flavour of posh plan element,used during DnD from palette to PoshScene. |
List<DriveElement> |
getDrives()
Get list of all drives of this DC in correct order (drive with higest priority is first, drive with lowest priority is last). |
Trigger<DriveCollection> |
getGoal()
Get goal of the DC. |
List<PoshElement> |
getChildDataNodes()
Get all child nodes of the DC. |
String |
getName()
Get name of the DC |
LapType |
getType()
Get type of the element. |
boolean |
moveChild(int newIndex,
PoshElement child)
Move child to the @newIndex. |
void |
removeDrive(DriveElement drive)
Remove drive from the drive collection. |
void |
setName(String newName)
Change name of the DC and notify property listeners. |
String |
toString()
Serialize DC into a parser readable form. |
Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement |
---|
getUnusedName, isUsedName, moveChildInList |
Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshElement |
---|
addElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getElementListeners, getNumberOfChildInstances, getParent, getRootNode, isChildOfParent, removeElementListener, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String dcName
public static final DataFlavor dataFlavor
Method Detail |
---|
public void addDrive(DriveElement drive) throws DuplicateNameException
drive
- drive to add
DuplicateNameException
public void addDrive(int index, DriveElement drive) throws DuplicateNameException
DuplicateNameException
public Trigger<DriveCollection> getGoal()
public List<DriveElement> getDrives()
public String toString()
(DC funbot (goal ((cz.cuni.HaveFun)(cz.cuni.Sing)))
(drives (
(fun (trigger ((cz.cuni.IsAtParty)(cz.cuni.FriendsInSight)) ) cz.cuni.Enjoy )
(default cz.cuni.DoNothing)
)
)
)
toString
in class Object
public List<PoshElement> getChildDataNodes()
getChildDataNodes
in class PoshElement<DriveCollection,PoshPlan>
public String getName()
getName
in class NamedLapElement<DriveCollection,PoshPlan>
public void setName(String newName) throws InvalidNameException
newName
- New name of the DC.
InvalidNameException
- throw if name is not valid (spaces,
braces...)public boolean moveChild(int newIndex, PoshElement child)
PoshElement
moveChild
in class PoshElement<DriveCollection,PoshPlan>
public DataFlavor getDataFlavor()
PoshElement
getDataFlavor
in class PoshElement<DriveCollection,PoshPlan>
public LapType getType()
PoshElement
getType
in class PoshElement<DriveCollection,PoshPlan>
public void removeDrive(DriveElement drive)
drive
- Drive to be removed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |