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.ClassInfo
The type (if explicitly specified).protected MParameter.EvaluationMode
The direction.protected List
<jadex.rules.eca.EventType> The aggregated/inited events.protected boolean
The exported / argument flag.protected jadex.common.UnparsedExpression
The default fact.protected List
<jadex.common.UnparsedExpression> The default facts (multi).protected jadex.common.FieldInfo
The field target.protected String
The collection implementation class.protected jadex.common.MethodInfo
The method targets.protected jadex.common.MethodInfo
protected Boolean
Flag if is multi.protected Collection
<jadex.rules.eca.EventType> The raw events.protected String
The reference.protected boolean
The result flag.protected jadex.common.UnparsedExpression
The 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 void
Adapt the evaluation mode according to thevoid
addDefaultFacts
(jadex.common.UnparsedExpression fact) The value to set.void
addEvent
(jadex.rules.eca.EventType event) Add an event.void
cleanup()
Cleanup the value on agent shutdown, i.e., call close() on closeable fact objects.Get the events.jadex.common.ClassInfo
getClazz()
Get the clazz.jadex.common.UnparsedExpression
Get the value.List
<jadex.common.UnparsedExpression> Get the value.Get the evaluationmode.List
<jadex.rules.eca.EventType> Get the events.jadex.common.FieldInfo
getField()
Get the field (for field-backed beliefs).jadex.common.MethodInfo
Get the getter method (for method-backed beliefs).Get the impl.Collection
<jadex.rules.eca.EventType> Get the rawevents.getRef()
Get the reference.jadex.common.MethodInfo
Get the setter method (for method-backed beliefs).Class
<?> getType
(ClassLoader cl) Get the class of the belief.jadex.common.UnparsedExpression
Get the updaterate.long
Get/Evaluate the updaterate value.getValue()
Get the value of the belief.getValue
(Object object, ClassLoader cl) Get the value of the belief.void
initEvents
(IBDIModel model, ClassLoader cl) Init the event, when loaded from xml.boolean
Test if belief is of array type.boolean
Get the dynamic.boolean
Get the exported flag.boolean
Test if this belief refers to a field.boolean
isMulti
(ClassLoader cl) Get the multi.boolean
isResult()
Get the result flag.void
setBeliefEvents
(Set<String> events) Set the events.void
setClazz
(jadex.common.ClassInfo clazz) The clazz to set.void
setDefaultFact
(jadex.common.UnparsedExpression fact) The value to set.void
setDefaultFacts
(List<jadex.common.UnparsedExpression> facts) Set the value.void
setEvaluationMode
(MParameter.EvaluationMode evaluationmode) The evaluationmode to set.void
The events to set.void
setExported
(boolean exported) Set the exported flag.void
setGetter
(jadex.common.MethodInfo mgetter) Set the mgetter.void
setImplClassName
(String impl) Set the impl.void
setMulti
(boolean multi) The multi to set.void
setRawEvents
(Set<jadex.rules.eca.EventType> rawevents) Set the rawevents.void
Set the reference.void
setResult
(boolean result) Set the result flag.void
setSetter
(jadex.common.MethodInfo msetter) Set the msetter.void
setUpdateRate
(jadex.common.UnparsedExpression updaterate) The updaterate to set.boolean
Set the value of the belief.boolean
setValue
(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.
-