public class BDIAgent extends MicroAgent
MicroAgent.ExecuteWaitForStep
Constructor and Description |
---|
BDIAgent() |
Modifier and Type | Method and Description |
---|---|
void |
addBeliefListener(String name,
IBeliefListener listener)
Add a belief listener.
|
static void |
addInitArgs(Object obj,
Class<?> clazz,
Class<?>[] argtypes,
Object[] args)
Add an entry to the init calls.
|
<T,E> IFuture<E> |
adoptPlan(T plan)
Dispatch a pojo plan and wait for its result.
|
<T,E> IFuture<E> |
adoptPlan(T plan,
Object[] args)
Dispatch a goal wait for its result.
|
static void |
createChangeEvent(Object val,
Object oldval,
Object info,
BDIAgent agent,
String belname)
Caution: this method is used from byte engineered code, change signature with caution
Create a belief changed event.
|
<T,E> IFuture<E> |
dispatchTopLevelGoal(T goal)
Dispatch a pojo goal wait for its result.
|
void |
dropGoal(Object goal)
Drop a pojo goal.
|
Object |
getAbstractBeliefValue(String capa,
String name,
Class<?> type)
Get the value of an abstract belief.
|
BDIAgent |
getAgent()
Added for IAgentAPI autogenerated calls.
|
IGoal |
getGoal(Object goal)
Get the goal api representation for a pojo goal.
|
Collection<IGoal> |
getGoals()
Get the current goals as api representation.
|
<T> Collection<T> |
getGoals(Class<T> clazz)
Get the goals of a given type as pojos.
|
static List<Tuple2<Class<?>[],Object[]>> |
getInitCalls(Object obj,
Class<?> clazz)
Get the init calls.
|
static void |
observeValue(jadex.rules.eca.RuleSystem rs,
Object val,
BDIAgentInterpreter agent,
jadex.rules.eca.EventType etype,
MBelief mbel) |
static void |
observeValue(jadex.rules.eca.RuleSystem rs,
Object val,
BDIAgentInterpreter agent,
String etype,
MBelief mbel) |
static void |
performInitWrites(BDIAgent agent) |
static void |
publishToolBeliefEvent(BDIAgentInterpreter ip,
MBelief mbel) |
void |
removeBeliefListener(String name,
IBeliefListener listener)
Remove a belief listener.
|
void |
setAbstractBeliefValue(String capa,
String name,
Object value)
Set the value of an abstract belief.
|
static void |
unobserveValue(BDIAgent agent,
String belname)
Unobserving an old belief value.
|
static void |
writeArrayField(Object array,
int index,
Object val,
Object agentobj,
String fieldname)
Method that is called automatically when a belief
is written as array access.
|
static void |
writeArrayParameterField(Object array,
int index,
Object val,
Object agentobj,
String fieldname)
Method that is called automatically when a belief
is written as array access.
|
static void |
writeField(Object val,
String fieldname,
Object obj,
BDIAgent agent)
Method that is called automatically when a belief
is written as field access.
|
static void |
writeParameterField(Object val,
String fieldname,
Object obj,
BDIAgent agent)
Method that is called automatically when a parameter
is written as field access.
|
addMessageHandler, addService, addService, addService, addService, addService, agentCreated, agentKilled, createReply, createResultListener, createResultListener, createServiceContainer, executeBody, getAgentAdapter, getAgentName, getArgument, getArgument, getArguments, getClassLoader, getComponentAdapter, getComponentDescription, getComponentIdentifier, getConfiguration, getExternalAccess, getFetcher, getInterpreter, getLogger, getModel, getNfPropertyMetaInfo, getNonFunctionalPropertyNames, getNonFunctionalPropertyValue, getNonFunctionalPropertyValue, getParentAccess, getProperty, getRawService, getRawService, getRawServices, getRequiredService, getRequiredServicePropertyProvider, getRequiredServices, getResults, getServiceContainer, getServiceProvider, getTime, hasEventTargets, hasRequiredServicePropertyProvider, init, isAtBreakpoint, isComponentThread, killAgent, killComponent, messageArrived, publishEvent, removeMessageHandler, removeService, scheduleStep, scheduleStep, sendMessage, sendMessage, sendMessageAndWait, setResultValue, streamArrived, subscribeToEvents, waitFor, waitFor, waitForDelay, waitForDelay, waitForDelay, waitForDelay, waitForTick
public <T> Collection<T> getGoals(Class<T> clazz)
clazz
- The pojo goal class.public Collection<IGoal> getGoals()
public IGoal getGoal(Object goal)
goal
- The pojo goal.public <T,E> IFuture<E> dispatchTopLevelGoal(T goal)
goal
- The pojo goal.public void dropGoal(Object goal)
goal
- The pojo goal.public <T,E> IFuture<E> adoptPlan(T plan)
plan
- The pojo plan or plan name.public <T,E> IFuture<E> adoptPlan(T plan, Object[] args)
plan
- The pojo plan or plan name.args
- The plan arguments.public void addBeliefListener(String name, IBeliefListener listener)
name
- The belief name.listener
- The belief listener.public void removeBeliefListener(String name, IBeliefListener listener)
name
- The belief name.listener
- The belief listener.public static void addInitArgs(Object obj, Class<?> clazz, Class<?>[] argtypes, Object[] args)
obj
- object instance that owns the field __initargsclazz
- Class definition of the obj objectargtypes
- Signature of the init methodargs
- Actual argument values for the init methodpublic static List<Tuple2<Class<?>[],Object[]>> getInitCalls(Object obj, Class<?> clazz)
public static void writeField(Object val, String fieldname, Object obj, BDIAgent agent)
public static void performInitWrites(BDIAgent agent)
public static void writeArrayField(Object array, int index, Object val, Object agentobj, String fieldname)
public static void unobserveValue(BDIAgent agent, String belname)
agent
- The agent.belname
- The belief name.public static void observeValue(jadex.rules.eca.RuleSystem rs, Object val, BDIAgentInterpreter agent, String etype, MBelief mbel)
public static void observeValue(jadex.rules.eca.RuleSystem rs, Object val, BDIAgentInterpreter agent, jadex.rules.eca.EventType etype, MBelief mbel)
public Object getAbstractBeliefValue(String capa, String name, Class<?> type)
public void setAbstractBeliefValue(String capa, String name, Object value)
public static void createChangeEvent(Object val, Object oldval, Object info, BDIAgent agent, String belname)
val
- The new value.agent
- The agent.belname
- The belief name.public static void publishToolBeliefEvent(BDIAgentInterpreter ip, MBelief mbel)
public static void writeParameterField(Object val, String fieldname, Object obj, BDIAgent agent)
public static void writeArrayParameterField(Object array, int index, Object val, Object agentobj, String fieldname)
public BDIAgent getAgent()
Copyright © 2015. All Rights Reserved.