Interface ModelEntity

All Known Subinterfaces:
Agent, Domain, Visitor
All Known Implementing Classes:
BasicAgent, BasicDomain, BasicModelEntity, Cell, DynamicElevator, DynamicModel, DynamicVisitor, Floor, InstrumentationDecorator, Model, RoutingAgent, RoutingDomain, SimpleAgent, SimpleDomain, StaticElevator, StaticModel, StaticVisitor

public interface ModelEntity
The ModelEntity is the core element of a simulation model. It provides the most basic functionality needed by all entities of the model. These are:
  • unit identification (by name or address)
  • managing in- and outports
  • utility methods (parent reference, naming, toString, equals)
  • providing relevant exceptions
  • Field Details

  • Method Details

    • addToDomain

      void addToDomain(BasicDomain domain)
      Adds this entity to a domain.

      The domain becomes the parent of this entity.

      Note: Connection management has to be done externally by the caller!

    • removeFromDomain

      void removeFromDomain()
      Removes this entity form its parent domain.

      This method should never be called during a simulation cycle. If the entity could be removed from the domain, the entity's parent is set to null.

      Note: Connection management has to be done externally by the caller.

    • getAddress

      int[] getAddress()
      Gets the entity address. Can be null.

      Note: The address of the root domain is int[0]. Another dimension is added per model level. The value of each dimension is the index within the corresponding level.

      Returns:
      the address
    • getName

      String getName()
      Returns the name of this model entity

      Returns an empty string as default, may be overridden in derived classes.

      Returns:
      the name of this model entity, may be an empty string but not null
    • getFullName

      String getFullName()
      Returns the full name of a model, concatenating the names of the parent entities.

      Example: If A and B are parents of this entity and this entity is named C, then the full name is A.B.C

      Returns:
      the full name of this entity
    • getParent

      Domain getParent()
      Returns the parent domain of this model entity.
      Returns:
      the parent of this model
    • getLevel

      int getLevel()
      Returns the level of the entity within the model hierarchy

      Models may be organized in a hierarchy, so that each entity resides in a definite domain level of the model tree. The level information is generated when the getLevel() method is called first. The level of the root node is always 0.

      Returns:
      the level of this entity in the model hierarchy
    • getInport

      Port getInport()
    • getOutport

      Port getOutport()