public abstract class Condition<E extends Entity> extends ModelComponent
true
whenever an entity complies to the condition.
For conditions that do not apply to a specific Entity, but to the
model as whole (e.g. when to stop an experiment), use
ModelCondition
.Constructor and Description |
---|
Condition(Model owner,
java.lang.String name,
boolean showInTrace,
java.lang.Object... args)
Constructs a condition with the given name and parameters for trace
files.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
check(E e)
Returns a boolean showing whether the given Entity complies to the
condition tested by this method or not.
|
java.lang.Object[] |
getConstructArguments() |
boolean |
hasPrimitiveArguments() |
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public Condition(Model owner, java.lang.String name, boolean showInTrace, java.lang.Object... args)
owner
- Model : The main model this condition is associated toname
- java.lang.String : The name of this conditionshowInTrace
- boolean : Flag for showing this condition in trace-files. Set
it to true
if model should show up in trace,
false
if model should not be shown in trace.args
- Object... : Arguments to pass to the condition (can be omitted)public boolean hasPrimitiveArguments()
public java.lang.Object[] getConstructArguments()
public abstract boolean check(E e)
e
- E : The Entity to test the condition ontrue
, if the entity given conforms
to the condition, false
otherwise.