Enum Context
-
- All Implemented Interfaces:
public enum Context
This enum describes the possible contexts for a given Action or Condition. A context represents the elements which are read for a Condition and the elements that may be subject of modifications for an Action. Choosing the right Context is crucial: if it's too restricted the simulation will be invalid, if it's too wide it WILL impact dramatically on performances. Contexts are used internally to better determine dependencies among reactions. See this paper for further information about the usage of contexts.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GLOBAL
The reaction potentially influences every other reaction.
LOCAL
The reaction can influence only the node in which it's placed.
NEIGHBORHOOD
The reaction may influence its node and the neighboring ones.
-
Method Summary
Modifier and Type Method Description static Context
getWider(Context c1, Context c2)
static Array<Context>
values()
Returns an array containing the constants of this enum type, in the order they're declared. static Context
valueOf(String name)
Returns the enum constant of this type with the specified name. -
-
Method Detail
-
getWider
static Context getWider(Context c1, Context c2)
- Parameters:
c1
- context to comparec2
- other context to compare- Returns:
the wider (more general) between the two: if either one is GLOBAL, then GLOBAL is returned. Otherwise, if either one is NEIGHBORHOOD, NEIGHBORHOOD is returned. Otherwise, LOCAL is returned.
-
values
static Array<Context> values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.
- Returns:
an array containing the constants of this enum type, in the order they're declared
-
valueOf
static Context valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
- Returns:
the enum constant with the specified name
-
-
-
-