Package jadex.bdi.model
Class MBelief
java.lang.Object
jadex.bdi.model.MElement
jadex.bdi.model.MBelief
Belief model.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class<?> The autoclosable class, if present.The events this belief depends on.protected jadex.common.ClassInfoThe type (if explicitly specified).protected MParameter.EvaluationModeThe direction.protected List<jadex.rules.eca.EventType> The aggregated/inited events.protected booleanThe exported / argument flag.protected jadex.common.UnparsedExpressionThe default fact.protected List<jadex.common.UnparsedExpression> The default facts (multi).protected jadex.common.FieldInfoThe field target.protected StringThe collection implementation class.protected jadex.common.MethodInfoThe method targets.protected jadex.common.MethodInfoprotected BooleanFlag if is multi.protected Collection<jadex.rules.eca.EventType> The raw events.protected StringThe reference.protected booleanThe result flag.protected jadex.common.UnparsedExpressionThe update rate.Fields inherited from class jadex.bdi.model.MElement
CAPABILITY_SEPARATOR, description, name -
Constructor Summary
ConstructorsConstructorDescriptionMBelief()Bean Constructor.MBelief(jadex.common.FieldInfo target, String impl, boolean dynamic, long updaterate, String[] beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief.MBelief(jadex.common.FieldInfo target, String impl, boolean dynamic, long updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief.MBelief(jadex.common.FieldInfo target, String impl, boolean dynamic, jadex.common.UnparsedExpression updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief.MBelief(jadex.common.MethodInfo target, String impl, boolean dynamic, long updaterate, String[] beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief.MBelief(jadex.common.MethodInfo target, String impl, boolean dynamic, long updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief.MBelief(jadex.common.MethodInfo target, String impl, boolean dynamic, jadex.common.UnparsedExpression updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdapt the evaluation mode according to thevoidaddDefaultFacts(jadex.common.UnparsedExpression fact) The value to set.voidaddEvent(jadex.rules.eca.EventType event) Add an event.voidcleanup()Cleanup the value on agent shutdown, i.e., call close() on closeable fact objects.Get the events.jadex.common.ClassInfogetClazz()Get the clazz.jadex.common.UnparsedExpressionGet the value.List<jadex.common.UnparsedExpression> Get the value.Get the evaluationmode.List<jadex.rules.eca.EventType> Get the events.jadex.common.FieldInfogetField()Get the field (for field-backed beliefs).jadex.common.MethodInfoGet the getter method (for method-backed beliefs).Get the impl.Collection<jadex.rules.eca.EventType> Get the rawevents.getRef()Get the reference.jadex.common.MethodInfoGet the setter method (for method-backed beliefs).Class<?> getType(ClassLoader cl) Get the class of the belief.jadex.common.UnparsedExpressionGet the updaterate.longGet/Evaluate the updaterate value.getValue()Get the value of the belief.getValue(Object object, ClassLoader cl) Get the value of the belief.voidinitEvents(IBDIModel model, ClassLoader cl) Init the event, when loaded from xml.booleanTest if belief is of array type.booleanGet the dynamic.booleanGet the exported flag.booleanTest if this belief refers to a field.booleanisMulti(ClassLoader cl) Get the multi.booleanisResult()Get the result flag.voidsetBeliefEvents(Set<String> events) Set the events.voidsetClazz(jadex.common.ClassInfo clazz) The clazz to set.voidsetDefaultFact(jadex.common.UnparsedExpression fact) The value to set.voidsetDefaultFacts(List<jadex.common.UnparsedExpression> facts) Set the value.voidsetEvaluationMode(MParameter.EvaluationMode evaluationmode) The evaluationmode to set.voidThe events to set.voidsetExported(boolean exported) Set the exported flag.voidsetGetter(jadex.common.MethodInfo mgetter) Set the mgetter.voidsetImplClassName(String impl) Set the impl.voidsetMulti(boolean multi) The multi to set.voidsetRawEvents(Set<jadex.rules.eca.EventType> rawevents) Set the rawevents.voidSet the reference.voidsetResult(boolean result) Set the result flag.voidsetSetter(jadex.common.MethodInfo msetter) Set the msetter.voidsetUpdateRate(jadex.common.UnparsedExpression updaterate) The updaterate to set.booleanSet the value of the belief.booleansetValue(Object object, Object value, ClassLoader cl) Set the value of the belief.Methods inherited from class jadex.bdi.model.MElement
equals, getCapabilityName, getDescription, getElementName, getName, hashCode, internalName, setDescription, setFlatName, setName, toString
-
Field Details
-
AUTOCLOSABLE
The autoclosable class, if present. -
ftarget
protected jadex.common.FieldInfo ftargetThe field target. -
mgetter
protected jadex.common.MethodInfo mgetterThe method targets. -
msetter
protected jadex.common.MethodInfo msetter -
impl
The collection implementation class. -
updaterate
protected jadex.common.UnparsedExpression updaterateThe update rate. -
multi
Flag if is multi. -
beliefevents
The events this belief depends on. -
rawevents
The raw events. -
events
The aggregated/inited events. -
fact
protected jadex.common.UnparsedExpression factThe default fact. -
facts
The default facts (multi). -
clazz
protected jadex.common.ClassInfo clazzThe type (if explicitly specified). -
exported
protected boolean exportedThe exported / argument flag. -
result
protected boolean resultThe result flag. -
ref
The reference. -
evaluationmode
The direction.
-
-
Constructor Details
-
MBelief
public MBelief()Bean Constructor. -
MBelief
public MBelief(jadex.common.FieldInfo target, String impl, boolean dynamic, jadex.common.UnparsedExpression updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief. -
MBelief
public MBelief(jadex.common.FieldInfo target, String impl, boolean dynamic, long updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief. -
MBelief
public MBelief(jadex.common.FieldInfo target, String impl, boolean dynamic, long updaterate, String[] beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief. -
MBelief
public MBelief(jadex.common.MethodInfo target, String impl, boolean dynamic, jadex.common.UnparsedExpression updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief. -
MBelief
public MBelief(jadex.common.MethodInfo target, String impl, boolean dynamic, long updaterate, Set<String> beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief. -
MBelief
public MBelief(jadex.common.MethodInfo target, String impl, boolean dynamic, long updaterate, String[] beliefevents, Collection<jadex.rules.eca.EventType> rawevents) Create a new belief.
-
-
Method Details
-
adaptEvaluationMode
protected void adaptEvaluationMode()Adapt the evaluation mode according to the -
getImplClassName
Get the impl.- Returns:
- The impl.
-
setImplClassName
Set the impl.- Parameters:
impl- The impl to set.
-
isDynamic
public boolean isDynamic()Get the dynamic.- Returns:
- The dynamic.
-
isExported
public boolean isExported()Get the exported flag.- Returns:
- The exported flag.
-
setExported
public void setExported(boolean exported) Set the exported flag.- Parameters:
exported- The exported to set.
-
isResult
public boolean isResult()Get the result flag.- Returns:
- The result flag.
-
setResult
public void setResult(boolean result) Set the result flag.- Parameters:
result- The result to set.
-
getRef
Get the reference. For belief references.- Returns:
- The reference.
-
setRef
Set the reference.- Parameters:
reference- The reference to set.
-
getUpdateRate
public jadex.common.UnparsedExpression getUpdateRate()Get the updaterate.- Returns:
- The updaterate
-
setUpdateRate
public void setUpdateRate(jadex.common.UnparsedExpression updaterate) The updaterate to set.- Parameters:
updaterate- The updaterate to set
-
getUpdaterateValue
public long getUpdaterateValue()Get/Evaluate the updaterate value.- Parameters:
agent- The agent.- Returns:
- The update rate.
-
setGetter
public void setGetter(jadex.common.MethodInfo mgetter) Set the mgetter.- Parameters:
mgetter- The mgetter to set.
-
setSetter
public void setSetter(jadex.common.MethodInfo msetter) Set the msetter.- Parameters:
msetter- The msetter to set.
-
getClazz
public jadex.common.ClassInfo getClazz()Get the clazz.- Returns:
- The clazz
-
setClazz
public void setClazz(jadex.common.ClassInfo clazz) The clazz to set.- Parameters:
clazz- The clazz to set
-
isFieldBelief
public boolean isFieldBelief()Test if this belief refers to a field.- Returns:
- True if is a field belief.
-
isMulti
Get the multi.- Returns:
- The multi.
-
setMulti
public void setMulti(boolean multi) The multi to set.- Parameters:
multi- The multi to set
-
getValue
Get the value of the belief. -
getValue
Get the value of the belief. -
setValue
Set the value of the belief.- Returns:
- True, if field was set.
-
setValue
Set the value of the belief. -
cleanup
public void cleanup()Cleanup the value on agent shutdown, i.e., call close() on closeable fact objects. -
getType
Get the class of the belief. -
getField
public jadex.common.FieldInfo getField()Get the field (for field-backed beliefs). -
getGetter
public jadex.common.MethodInfo getGetter()Get the getter method (for method-backed beliefs). -
getSetter
public jadex.common.MethodInfo getSetter()Get the setter method (for method-backed beliefs). -
isArrayBelief
public boolean isArrayBelief()Test if belief is of array type. -
getDefaultFact
public jadex.common.UnparsedExpression getDefaultFact()Get the value.- Returns:
- The value
-
setDefaultFact
public void setDefaultFact(jadex.common.UnparsedExpression fact) The value to set.- Parameters:
value- The value to set
-
getDefaultFacts
Get the value.- Returns:
- The value
-
setDefaultFacts
Set the value. -
addDefaultFacts
public void addDefaultFacts(jadex.common.UnparsedExpression fact) The value to set.- Parameters:
value- The value to set
-
getEvaluationMode
Get the evaluationmode.- Returns:
- The evaluationmode
-
setEvaluationMode
The evaluationmode to set.- Parameters:
evaluationmode- The evaluationmode to set
-
getRawEvents
Get the rawevents.- Returns:
- The rawevents.
-
setRawEvents
Set the rawevents.- Parameters:
rawevents- The rawevents to set.
-
getBeliefEvents
Get the events.- Returns:
- The events.
-
setBeliefEvents
Set the events.- Parameters:
events- The events to set.
-
getEvents
Get the events.- Returns:
- The events.
-
initEvents
Init the event, when loaded from xml. -
setEvents
The events to set.- Parameters:
events- The events to set
-
addEvent
public void addEvent(jadex.rules.eca.EventType event) Add an event.- Parameters:
event- The event.
-