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

public sealed interface Attribute permits AgentAttribute, AttributeBase<C>, EnvironmentAttribute
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 Type
    Method
    Description
    Returns the access level of this attribute, determining whether other entities may read it.
    Creates and returns an immutable version of this attribute.
    boolean
    Returns whether this attribute's state is logged as the model progresses.
    Returns the name of this attribute.
    void
    run()
    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 ReadOnlyAttribute instance