Package jadex.bdi.model
Class MCapability
java.lang.Object
jadex.bdi.model.MElement
jadex.bdi.model.MCapability
The capability model.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe belief mappings (abstract/reference name -> concrete belief name).The beliefs.protected List
<MCondition> The expressions.protected List
<MConfiguration> The configurations.The event mappings (abstract/reference name -> concrete name).The expression mappings (abstract/reference name -> concrete name).protected List
<jadex.common.UnparsedExpression> The expressions.The goal mappings (abstract/reference name -> concrete name).The goals.protected List
<MInternalEvent> The internal events.protected List
<MMessageEvent> The message events.The plans.The goal/service publications.The result mappings invalid input: '<'belief->result>.protected List
<MServiceCall> The services.protected List
<MCapabilityReference> The subcapabilities.Fields inherited from class jadex.bdi.model.MElement
CAPABILITY_SEPARATOR, description, name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a belief.void
addBeliefReference
(String reference, String concrete) Add a belief reference (abstract/reference name -> concrete belief name).void
addCapability
(MCapabilityReference subcapability) Add a sub capability.void
addCondition
(MCondition condition) Add a condition.void
addConfiguration
(MConfiguration config) Add a configuration.void
addEventReference
(String reference, String concrete) Add a event reference (abstract/reference name -> concrete event name).void
addExpression
(jadex.common.UnparsedExpression expression) Add a expression.void
addExpressionReference
(String reference, String concrete) Add a expression reference (abstract/reference name -> concrete expression name).void
Add a goal.void
addGoalPublication
(jadex.common.ClassInfo ci, MGoal mgoal, String methodname) Add a publication info.void
addGoalReference
(String reference, String concrete) Add a goal reference (abstract/reference name -> concrete goal name).void
addInternalEvent
(MInternalEvent event) Add an internal event.void
addMessageEvent
(MMessageEvent message) Add a message.void
Add a plan.Add a reference and resolve transitive dependencies.void
addResultMapping
(String belief, String result) Add a result mapping.void
addservice
(MServiceCall ser) Add a service.Get a belief.Get the fully qualified belief references (abstract/reference name -> concrete belief name).Get the beliefs.Get the sub capabilities.getCondition
(String name) Get a condition.Get the conditions.getConfiguration
(String name) Get the configurations.Get the configurations.Get the fully qualified event references (abstract/reference name -> concrete event name).jadex.common.UnparsedExpression
getExpression
(String name) Get a expression.Get the fully qualified expression references (abstract/reference name -> concrete expression name).List
<jadex.common.UnparsedExpression> Get the expressions.Get the goal for its name.Get the pubs.Get the fully qualified goal references (abstract/reference name -> concrete goal name).getGoals()
Get the goals.getInternalEvent
(String name) Get an internal event.Get the Internals.getMessageEvent
(String name) Get a message event.Get the messages.Get the plan for its name.getPlans()
Get the plans.getReferences
(Map<String, String> references) Get references or empty map.getResolvedGoal
(String scope, String name) Get a goal by resolved name.getResolvedInternalEvent
(String scope, String name) Get an internal event by resolved name.getResolvedMessageEvent
(String scope, String name) Get a message event by resolved name.Get the result mappings (concrete belief->result name).getService
(String name) Get the plan for its name.Get the services.boolean
Test if a belief is contained.hasBeliefIgnoreCase
(String name) Test if a belief is contained.boolean
hasCondition
(String name) Test if a condition is contained.boolean
hasExpression
(String name) Test if a expression is contained.boolean
hasInternalEvent
(String name) Test if an internal event is contained.boolean
hasMessageEvent
(String name) Test if a message is contained.void
removeBelief
(MBelief belief) Remove a belief.void
setBeliefs
(List<MBelief> beliefs) Set the beliefs.void
setCapabilities
(List<MCapabilityReference> subcapabilities) Set the sub capabilities.void
setConditions
(List<MCondition> conditions) Set the conditions.void
setConfigurations
(List<MConfiguration> configurations) Set the configurations.void
setExpressions
(List<jadex.common.UnparsedExpression> expressions) Set the expressions.void
setGoalPublications
(Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs) The pubs to set.void
Set the goals.void
setInternalEvents
(List<MInternalEvent> ievents) Set the internal events.void
setMessageEvents
(List<MMessageEvent> messages) Set the messages.void
Set the plans.void
setServices
(List<MServiceCall> services) Set the services.void
sortPlans
(Map<String, Integer> order, ClassLoader cl) Sorts plans according to their line numbers in the source to guarantee their natural declaration order.Methods inherited from class jadex.bdi.model.MElement
equals, getCapabilityName, getDescription, getElementName, getName, hashCode, internalName, setDescription, setFlatName, setName, toString
-
Field Details
-
beliefs
The beliefs. -
goals
The goals. -
plans
The plans. -
messages
The message events. -
services
The services. -
expressions
The expressions. -
configurations
The configurations. -
beliefreferences
The belief mappings (abstract/reference name -> concrete belief name). -
resultmappings
The result mappings invalid input: '<'belief->result>. -
goalreferences
The goal mappings (abstract/reference name -> concrete name). -
eventreferences
The event mappings (abstract/reference name -> concrete name). -
expressionreferences
The expression mappings (abstract/reference name -> concrete name). -
subcapabilities
The subcapabilities. -
ievents
The internal events. -
pubs
The goal/service publications. -
conditions
The expressions.
-
-
Constructor Details
-
MCapability
public MCapability()Bean Constructor. -
MCapability
Create a capability.
-
-
Method Details
-
getBeliefs
Get the beliefs.- Returns:
- The beliefs.
-
setBeliefs
Set the beliefs.- Parameters:
beliefs
- The beliefs to set.
-
addBelief
Add a belief. -
removeBelief
Remove a belief. -
hasBelief
Test if a belief is contained. -
hasBeliefIgnoreCase
Test if a belief is contained.- Parameters:
name
- The name.- Returns:
- The correctly spelled belief name or null.
-
getBelief
Get a belief. -
getGoals
Get the goals.- Returns:
- The goals.
-
setGoals
Set the goals.- Parameters:
goals
- The goals to set.
-
addGoal
Add a goal. -
getGoal
Get the goal for its name.- Returns:
- The goal.
-
getPlans
Get the plans.- Returns:
- The plans.
-
setPlans
Set the plans.- Parameters:
plans
- The plans to set.
-
addPlan
Add a plan. -
getPlan
Get the plan for its name.- Returns:
- The plan.
-
sortPlans
Sorts plans according to their line numbers in the source to guarantee their natural declaration order. -
getInternalEvents
Get the Internals.- Returns:
- The Internals.
-
setInternalEvents
Set the internal events.- Parameters:
ievents
- The internal events to set.
-
addInternalEvent
Add an internal event. -
hasInternalEvent
Test if an internal event is contained. -
getInternalEvent
Get an internal event. -
getMessageEvents
Get the messages.- Returns:
- The messages.
-
setMessageEvents
Set the messages.- Parameters:
messages
- The messages to set.
-
addMessageEvent
Add a message. -
hasMessageEvent
Test if a message is contained. -
getMessageEvent
Get a message event. Null if not found. -
getResolvedGoal
Get a goal by resolved name. Exception if not found. This method is meant handles calls from user code (e.g. createXYZ() in a plan). Internally, all references should be mapped to the correct concrete elements already during loading (e.g. config elements).- Parameters:
scope
- The local scope.name
- The name, relative to scope.
-
getResolvedInternalEvent
Get an internal event by resolved name. Exception if not found. This method is meant handles calls from user code (e.g. createXYZ() in a plan). Internally, all references should be mapped to the correct concrete elements already during loading (e.g. config elements).- Parameters:
scope
- The local scope.name
- The name, relative to scope.
-
getResolvedMessageEvent
Get a message event by resolved name. Exception if not found. This method is meant handles calls from user code (e.g. createXYZ() in a plan). Internally, all references should be mapped to the correct concrete elements already during loading (e.g. config elements).- Parameters:
scope
- The local scope.name
- The name, relative to scope.
-
getConfigurations
Get the configurations.- Returns:
- The configurations.
-
setConfigurations
Set the configurations.- Parameters:
configurations
- The configurations to set.
-
addConfiguration
Add a configuration. -
getConfiguration
Get the configurations.- Returns:
- The configurations.
-
getServices
Get the services.- Returns:
- The services.
-
setServices
Set the services.- Parameters:
services
- The services to set.
-
getService
Get the plan for its name.- Returns:
- The plan.
-
addservice
Add a service. -
getCapabilities
Get the sub capabilities.- Returns:
- The sub capabilities.
-
setCapabilities
Set the sub capabilities.- Parameters:
subcapabilities
- The sub capabilities to set.
-
addCapability
Add a sub capability. -
getExpressions
Get the expressions.- Returns:
- The expressions.
-
setExpressions
Set the expressions.- Parameters:
expressions
- The expressions to set.
-
addExpression
public void addExpression(jadex.common.UnparsedExpression expression) Add a expression. -
hasExpression
Test if a expression is contained. -
getExpression
Get a expression. -
getConditions
Get the conditions.- Returns:
- The conditions.
-
setConditions
Set the conditions.- Parameters:
conditions
- The conditions to set.
-
addCondition
Add a condition. -
hasCondition
Test if a condition is contained. -
getCondition
Get a condition. -
getGoalPublications
Get the pubs.- Returns:
- The pubs
-
setGoalPublications
public void setGoalPublications(Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs) The pubs to set.- Parameters:
pubs
- The pubs to set
-
addGoalPublication
Add a publication info. -
getBeliefReferences
Get the fully qualified belief references (abstract/reference name -> concrete belief name). -
addBeliefReference
Add a belief reference (abstract/reference name -> concrete belief name).- Parameters:
reference
- The fully qualified abstract / reference belief name.concrete
- The fully qualified concrete belief name.
-
getResultMappings
Get the result mappings (concrete belief->result name). Note: result mappings are inverse to reference mappings! -
addResultMapping
Add a result mapping. Note: result mappings are inverse to reference mappings!- Parameters:
belief
- The concrete belief name (fully qualified).result
- The result name.
-
getExpressionReferences
Get the fully qualified expression references (abstract/reference name -> concrete expression name). -
addExpressionReference
Add a expression reference (abstract/reference name -> concrete expression name).- Parameters:
reference
- The fully qualified abstract / reference expression name.concrete
- The fully qualified concrete expression name.
-
getEventReferences
Get the fully qualified event references (abstract/reference name -> concrete event name). -
addEventReference
Add a event reference (abstract/reference name -> concrete event name).- Parameters:
reference
- The fully qualified abstract / reference event name.concrete
- The fully qualified concrete event name.
-
getGoalReferences
Get the fully qualified goal references (abstract/reference name -> concrete goal name). -
addGoalReference
Add a goal reference (abstract/reference name -> concrete goal name).- Parameters:
reference
- The fully qualified abstract / reference goal name.concrete
- The fully qualified concrete goal name.
-
addReference
protected static Map<String,String> addReference(Map<String, String> references, String reference, String concrete) Add a reference and resolve transitive dependencies. -
getReferences
Get references or empty map.
-