io.sarl.lang.core
Class Skill
All Superinterfaces:
IBehaviorGuardEvaluatorReceiver
All Known Subclasses:
StandardActionSelectionSkill, BehaviorsSkill, DefaultContextInteractionsSkill, ExternalContextAccessSkill, InnerContextAccessSkill, LifecycleSkill, LoggingSkill, SchedulesSkill, TimeSkill, InternalEventBusSkill
abstract skill Skill
extends AgentTrait
implements IBehaviorGuardEvaluatorReceiver
A possible implementation of a capacity fulfilling all the constraints of this specification. Require Capacities should be accessed via the getSkill(Class) inside the install() The Skill should release all resources in the uninstall().
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Property Summary
Modifier and type Property and description
protected AgentTrait caller
Replies the caller of the capacity functions.
int referenceCount
Replies the number of registered references to this skill into its container.
Inherited: iD, owner
Constructor Summary
Constructor and description
new
Creates a new Skill.
new(Agent)
Creates a new Skill.
Action Summary
Modifier and type Action and description
protected AgentTrait getCaller
Replies the caller of the capacity functions.
int getReferenceCount
Replies the number of registered references to this skill into its container.
protected void install
This method is called just after the installation of this skill into its owner agent.
protected void prepareUninstallation
This method is called just before the "on Destroy" is fired.
protected void uninstall
This method is called just after the uninstallation of this skill into its owner agent.
Property Details
caller
protected val caller : AgentTrait
Replies the caller of the capacity functions.

The replied value has a meaning inside the skills' functions that are implemented the capacities' functions.

This property is an alias for the action: getCaller

Returns:
the caller, or null if the caller is unknown (assuming that the caller is the agent itself).
Since:
0.7
referenceCount
val referenceCount : int
Replies the number of registered references to this skill into its container.

This property is an alias for the action: getReferenceCount

Returns:
the number of references to this skill.
Since:
0.11
Constructor Details
new
new
Creates a new Skill.

This constructor is provided for skills written in SARL, mainly.
See:
new(Agent) for the built-in skill's constructor.
new(Agent)
new(Agent)
Creates a new Skill.

This constructor is provided for built-in skills, mainly.
Parameters:
agent - the agent that is owning the skill.
See:
new for the standard constructor.
Action Details
getCaller
protected def getCaller : AgentTrait
Replies the caller of the capacity functions.

The replied value has a meaning inside the skills' functions that are implemented the capacities' functions.
Returns:
the caller, or null if the caller is unknown (assuming that the caller is the agent itself).
Since:
0.7
getReferenceCount
def getReferenceCount : int
Replies the number of registered references to this skill into its container.
Returns:
the number of references to this skill.
Since:
0.11
install
protected def install
This method is called just after the installation of this skill into its owner agent. In this method you should get all information that depends on other Capacities.
prepareUninstallation
protected def prepareUninstallation
This method is called just before the "on Destroy" is fired.
Since:
0.11
uninstall
protected def uninstall
This method is called just after the uninstallation of this skill into its owner agent.
Since:
0.11