Package org.simplesim.model
Interface Domain
- All Superinterfaces:
ModelEntity
- All Known Implementing Classes:
BasicDomain
,DynamicModel
,Floor
,Model
,RoutingDomain
,SimpleDomain
,StaticModel
Domain are submodels of the simulation model.
Domains serve as a compartment for other entities within the simulation model. These entities may be agents or other
domains. Therefore, simulation model are build as a tree-like structure with Domain
as branching and
BasicAgent
as leaf, resembling a composite pattern. The domain adds the following features for entity management:
- add and remove entities to this domain
- provide information of the entities contained in this domain
- list all agents in this domain and its subdomains
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.simplesim.model.ModelEntity
ModelEntity.PortConnectionException, ModelEntity.PortOperationException, ModelEntity.UniqueConstraintViolationException
-
Field Summary
Fields inherited from interface org.simplesim.model.ModelEntity
ROOT_LEVEL
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
containsEntity
(ModelEntity entity) Checks, if this domain contains a given entity.default int
Returns the number of entities of the domain.default Domain
getRoot()
Returns the root domain of the model.default boolean
isEmpty()
default boolean
isRoot()
Checks if this domain is the root of the model.listAllAgents
(boolean recursive) Returns all agents within this domainReturns an unmodifiable list of all entities of this domain - an entity can either be an agent or another domain.Methods inherited from interface org.simplesim.model.ModelEntity
addToDomain, getAddress, getFullName, getInport, getLevel, getName, getOutport, getParent, removeFromDomain
-
Method Details
-
listAllAgents
Returns all agents within this domain- Parameters:
recursive
- true if listing should be done recursively for agents in all subdomains, too- Returns:
- list of all agents of this domain
-
listDomainEntities
List<ModelEntity> listDomainEntities()Returns an unmodifiable list of all entities of this domain - an entity can either be an agent or another domain.- Returns:
- an unmodifiable list of all entities of this domain
-
containsEntity
Checks, if this domain contains a given entity.- Parameters:
entity
- the entity to be looked up- Returns:
- true, if this domain contains the entity
-
countDomainEntities
default int countDomainEntities()Returns the number of entities of the domain.- Returns:
- the sub model count
-
getRoot
Returns the root domain of the model.- Returns:
- the root domain
-
isRoot
default boolean isRoot()Checks if this domain is the root of the model.- Returns:
- true if this domain it the root of the model
-
isEmpty
default boolean isEmpty()
-