public abstract class AbstractSkillContainer extends AgentProtectedAPIObject implements Identifiable
Constructor and Description |
---|
AbstractSkillContainer(skillProvider : DynamicSkillProvider)
Creates a new agent with a parent
parentID without initializing the built-in capacities. |
Modifier and Type | Method and Description |
---|---|
protected <S extends Capacity> |
clearSkill(capacity : Class<S>)
Clears the Skill associated with the capacity.
|
protected <S extends Capacity> |
getSkill(capacity : Class<S>)
Replies the skill corresponding to the given capacity.
|
protected boolean |
hasSkill(capacity : Class<? extends Capacity>)
Checks if this agent has a Skill that implements the
Capacity
capacity . |
protected <S extends Skill> |
operator_mappedTo(capacity : Class<? extends Capacity>,
skill : S)
Defines the implementation of the "capacity maps-to skill" operator.
|
protected <S extends Skill> |
setSkill(skill : S,
capacities : Class<? extends Capacity>*)
Set the skill for the
Capacity capacity . |
protected void |
setSkillIfAbsent(skill : Skill,
capacities : Class<? extends Capacity>*)
Set the skill for the
Capacity capacity if the mapping is not yet set. |
isFromMe, isMe, isMe, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getID
public new
(skillProvider : DynamicSkillProvider)
parentID
without initializing the built-in capacities.skillProvider
- provides the skills dynamically on demand.@SafeVarargs protected finaldef
setSkill(skill : S, capacities : Class<? extends Capacity>*) : Swith
<S extends Skill>
AgentProtectedAPIObject
Capacity
capacity
.setSkill
in class AgentProtectedAPIObject
S
- - type of the skill.skill
- implementation of capacity
.capacities
- the capacity or the capacities to set.AgentProtectedAPIObject.setSkillIfAbsent(Skill, Class...)
@SafeVarargs
protected final def
setSkillIfAbsent(skill : Skill,
capacities : Class<? extends Capacity>*) : void
AgentProtectedAPIObject
Capacity
capacity
if the mapping is not yet set.setSkillIfAbsent
in class AgentProtectedAPIObject
skill
- implementation of capacity
.capacities
- the capacity or the capacities to set.AgentProtectedAPIObject.setSkill(Skill, Class...)
@Pure protected finaldef
getSkill(capacity : Class<S>) : Swith
<S extends Capacity>
AgentProtectedAPIObject
The return may never be null
. If not capacity
was set, the exception UnimplementedCapacityException
is thrown.
getSkill
in class AgentProtectedAPIObject
S
- - type of the capacity.capacity
- the capacity to search for the implementation.null
@Pure
protected def
hasSkill(capacity : Class<? extends Capacity>) : boolean
AgentProtectedAPIObject
Capacity
capacity
.hasSkill
in class AgentProtectedAPIObject
capacity
- capacity to checktrue
if it has a skill associate to this capacity,
false
otherwiseprotecteddef
clearSkill(capacity : Class<S>) : Swith
<S extends Capacity>
AgentProtectedAPIObject
clearSkill
in class AgentProtectedAPIObject
S
- - the type of the capacity.capacity
- the capacity for which the skill must be cleared.protecteddef
operator_mappedTo(capacity : Class<? extends Capacity>, skill : S) : voidwith
<S extends Skill>
AgentProtectedAPIObject
operator_mappedTo
in class AgentProtectedAPIObject
S
- - type of skill to be mapped to.capacity
- the implemented capacity.skill
- the skill to associate to the capacity.Copyright © 2021 the original authors or authors.