Package modelarium.entities.attributes
Interface Attribute
- All Known Subinterfaces:
AgentAttribute,EnvironmentAttribute
- All Known Implementing Classes:
AgentEvent,AgentProperty,AgentRoutine,AttributeBase,EnvironmentEvent,EnvironmentProperty,EnvironmentRoutine,Event,FunctionalAgentEvent,FunctionalAgentProperty,FunctionalAgentRoutine,FunctionalEnvironmentEvent,FunctionalEnvironmentProperty,FunctionalEnvironmentRoutine,Property,Routine
Interface for representing a single named behaviour or value belonging to an entity.
Attributes are the units of behaviour the model runs each tick, and come in three forms: events, routines and properties. Each attribute has a name, an access level, and a flag indicating whether its state is logged as the model progresses.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the access level of this attribute, determining whether other entities may read it.Creates and returns an immutable version of this attribute.booleanisLogged()Returns whether this attribute's state is logged as the model progresses.name()Returns the name of this attribute.voidrun()Runs this attribute's behaviour for the current tick.
-
Method Details
-
name
String name()Returns the name of this attribute.- Returns:
- the attribute's name
-
isLogged
boolean isLogged()Returns whether this attribute's state is logged as the model progresses.- Returns:
- true if the attribute is logged, false otherwise
-
accessLevel
AttributeAccessLevel accessLevel()Returns the access level of this attribute, determining whether other entities may read it.- Returns:
- the attribute's
AttributeAccessLevel
-
run
void run()Runs this attribute's behaviour for the current tick. -
getAsImmutable
ReadOnlyAttribute<?> getAsImmutable()Creates and returns an immutable version of this attribute.- Returns:
- the new
ReadOnlyAttributeinstance
-