public class APL
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
APL.MGoalInfo |
static class |
APL.MPlanInfo |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Object> |
candidates
The list of candidates.
|
protected RProcessableElement |
element
The processable element.
|
protected java.util.List<APL.MGoalInfo> |
goalprecandidates
The mgoal candidates (in case a goal triggers another goal).
|
protected java.util.List<APL.MPlanInfo> |
precandidates
The mplan candidates.
|
Constructor and Description |
---|
APL(RProcessableElement element)
Create a new APL.
|
APL(RProcessableElement element,
java.util.List<java.lang.Object> candidates)
Create a new APL.
|
Modifier and Type | Method and Description |
---|---|
jadex.commons.future.IFuture<java.lang.Void> |
build(jadex.bridge.IInternalAccess ia)
Build the apl.
|
static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
calculateBindingElements(jadex.bridge.IInternalAccess agent,
MParameterElement melem,
RProcessableElement element)
Calculate the possible binding value combinations.
|
static jadex.commons.future.IFuture<java.lang.Boolean> |
checkMPlan(jadex.bridge.IInternalAccess ia,
APL.MPlanInfo mplaninfo,
RProcessableElement element)
Test precondition (and match expression) of a plan to decide
if it can be added to the candidates.
|
static java.util.List<APL.MGoalInfo> |
createMGoalCandidates(jadex.bridge.IInternalAccess agent,
MGoal mgoal,
RProcessableElement element)
Create candidates for a matching mgoal.
|
static java.util.List<APL.MPlanInfo> |
createMPlanCandidates(jadex.bridge.IInternalAccess agent,
MPlan mplan,
RProcessableElement element)
Create candidates for a matching mplan.
|
protected jadex.commons.future.IFuture<java.util.List<java.lang.Object>> |
doBuild(jadex.bridge.IInternalAccess ia)
Do build the apl by adding possible candidate plans.
|
java.util.List<java.lang.Object> |
getCandidates()
Get the candidates.
|
protected java.lang.Object |
getNextCandidate(MCapability mcapa)
Get the next candidate with respect to the plan
priority and the rank of the candidate.
|
protected static int |
getPriority(java.lang.Object cand,
MCapability mcapa)
Get the priority of a candidate.
|
protected int |
getRank(java.lang.Object cand)
Get the rank of a candidate.
|
boolean |
isEmpty()
Test if APL has more candidates.
|
void |
planFinished(IInternalPlan rplan)
After plan has finished the candidate will be removed from the APL.
|
java.util.List<java.lang.Object> |
selectCandidates(MCapability mcapa)
Select candidates from the list of applicable plans.
|
protected RProcessableElement element
protected java.util.List<java.lang.Object> candidates
protected java.util.List<APL.MPlanInfo> precandidates
protected java.util.List<APL.MGoalInfo> goalprecandidates
public APL(RProcessableElement element)
public APL(RProcessableElement element, java.util.List<java.lang.Object> candidates)
public jadex.commons.future.IFuture<java.lang.Void> build(jadex.bridge.IInternalAccess ia)
public boolean isEmpty()
public java.util.List<java.lang.Object> selectCandidates(MCapability mcapa)
protected jadex.commons.future.IFuture<java.util.List<java.lang.Object>> doBuild(jadex.bridge.IInternalAccess ia)
public static jadex.commons.future.IFuture<java.lang.Boolean> checkMPlan(jadex.bridge.IInternalAccess ia, APL.MPlanInfo mplaninfo, RProcessableElement element)
protected java.lang.Object getNextCandidate(MCapability mcapa)
public java.util.List<java.lang.Object> getCandidates()
protected static int getPriority(java.lang.Object cand, MCapability mcapa)
protected int getRank(java.lang.Object cand)
public void planFinished(IInternalPlan rplan)
public static java.util.List<APL.MPlanInfo> createMPlanCandidates(jadex.bridge.IInternalAccess agent, MPlan mplan, RProcessableElement element)
public static java.util.List<APL.MGoalInfo> createMGoalCandidates(jadex.bridge.IInternalAccess agent, MGoal mgoal, RProcessableElement element)
public static java.util.List<java.util.Map<java.lang.String,java.lang.Object>> calculateBindingElements(jadex.bridge.IInternalAccess agent, MParameterElement melem, RProcessableElement element)
agent
- The agent.melem
- The parameter element.element
- The element to process (if any).