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
AgentTask
public 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
AgentTask
public def
setProcedure(procedure : (Agent)=>void) : void
AgentTask
procedure
- code of the procedure to associate to the task.@Pure
public def
getGuard() : (Agent)=>Boolean
AgentTask
public def
setGuard(guard : (Agent)=>Boolean) : void
AgentTask
guard
- 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
AgentTask
public def
setTaskName(name : String) : void
AgentTask
name
- name of the task.public def
unless(predicate : (Agent)=>Boolean) : AgentTask
AgentTask
predicate
- 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
AgentTask
predicate
- 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
AgentTask
null
, the agent is assumed to be the initiator.null
if the initiator is the agent itself.Copyright © 2021 the original authors or authors.