public class AgentTask extends SRESpecificDataContainer
| Modifier and Type | Field and Description |
|---|---|
static (Agent)=>Boolean |
FALSE_GUARD
A guard that is always false.
|
static (Agent)=>Boolean |
TRUE_GUARD
A guard that is always true.
|
| Constructor and Description |
|---|
AgentTask(name : String,
[initiator : Object])
Construct an AgentTask with the given initiator.
|
| Modifier and Type | Method and Description |
|---|---|
(Agent)=>Boolean |
getGuard()
Replies the guard of this task.
|
Object |
getInitiator()
Replies the object that has initiated the execution of this task.
|
String |
getName()
Replies the name of this task.
|
(Agent)=>void |
getProcedure()
Replies the procedure that is associated to this task.
|
AgentTask |
ifTrue(predicate : (Agent)=>Boolean)
Change the guard to the given predicate.
|
void |
setGuard(guard : (Agent)=>Boolean)
Change the guard of this task.
|
void |
setProcedure(procedure : (Agent)=>void)
Change the procedure associated to this task.
|
void |
setTaskName(name : String)
Change the name of this task.
|
String |
toString() |
AgentTask |
unless(predicate : (Agent)=>Boolean)
Change the guard of this that with the negation of the given predicate.
|
public static val TRUE_GUARD : (Agent)=>Boolean
AgentTaskpublic new(name : String,
[initiator : Object])
name - the name of the task.initiator - the object that has initiated the execution of this task.
If the value is null (the default value of the argument), the agent is assumed to
be the initiator.@Pure
public def getProcedure() : (Agent)=>void
AgentTaskpublic def setProcedure(procedure : (Agent)=>void) : void
AgentTaskprocedure - code of the procedure to associate to the task.@Pure
public def getGuard() : (Agent)=>Boolean
AgentTaskpublic def setGuard(guard : (Agent)=>Boolean) : void
AgentTaskguard - the code of the function that is the predicate associated to the guard.AgentTask.unless(org.eclipse.xtext.xbase.lib.Functions.Function1<? super io.sarl.lang.core.Agent, ? extends java.lang.Boolean>),
AgentTask.ifTrue(org.eclipse.xtext.xbase.lib.Functions.Function1<? super io.sarl.lang.core.Agent, ? extends java.lang.Boolean>)@Pure
public def getName() : String
AgentTaskpublic def setTaskName(name : String) : void
AgentTaskname - name of the task.public def unless(predicate : (Agent)=>Boolean) : AgentTask
AgentTaskpredicate - the code of the function that is the predicate to test.this.AgentTask.setGuard(org.eclipse.xtext.xbase.lib.Functions.Function1<? super io.sarl.lang.core.Agent, ? extends java.lang.Boolean>)public def ifTrue(predicate : (Agent)=>Boolean) : AgentTask
AgentTaskpredicate - the code of the function that is the predicate to test.this.AgentTask.setGuard(org.eclipse.xtext.xbase.lib.Functions.Function1<? super io.sarl.lang.core.Agent, ? extends java.lang.Boolean>)@Pure
public def getInitiator() : Object
AgentTasknull, the agent is assumed to be the initiator.null if the initiator is the agent itself.Copyright © 2021 the original authors or authors.