Class Routine<C extends Context>
java.lang.Object
modelarium.entities.attributes.AttributeBase<C>
modelarium.entities.attributes.routines.Routine<C>
- Type Parameters:
C- the type of context this routine is given
- All Implemented Interfaces:
Attribute
- Direct Known Subclasses:
AgentRoutine,EnvironmentRoutine
public abstract sealed class Routine<C extends Context>
extends AttributeBase<C>
permits AgentRoutine, EnvironmentRoutine
Abstract class for representing an attribute whose behaviour runs unconditionally every tick.
Routines carry no value and are never logged; they exist purely to perform behaviour. This class is extended by
AgentRoutine and EnvironmentRoutine.
-
Method Summary
Modifier and TypeMethodDescriptionCreates and returns an immutable version of this attribute.voidrun()Runs this routine's behaviour for the current tick.protected abstract voidRuns this routine's behaviour.Methods inherited from class modelarium.entities.attributes.AttributeBase
accessLevel, context, isLogged, name
-
Method Details
-
run
public void run()Runs this routine's behaviour for the current tick. -
run
Runs this routine's behaviour. Must be implemented by subclasses.- Parameters:
context- the context the routine can use in its behaviour
-
getAsImmutable
Creates and returns an immutable version of this attribute.- Returns:
- the new
ReadOnlyRoutineinstance
-