Package org.simplesim.model
Class BasicDomain
java.lang.Object
org.simplesim.model.BasicModelEntity
org.simplesim.model.BasicDomain
- All Implemented Interfaces:
Domain
,ModelEntity
- Direct Known Subclasses:
Model
,RoutingDomain
,StaticModel
Implements all basic functionality of a domain.
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlistAllAgents
(boolean recursive) Returns all agents within this domainfinal List<ModelEntity>
Returns an unmodifiable list of all entities of this domain - an entity can either be an agent or another domain.Methods inherited from class org.simplesim.model.BasicModelEntity
addToDomain, equals, getAddress, getFullName, getInport, getLevel, getName, getOutport, getParent, removeFromDomain, toString
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.simplesim.model.Domain
containsEntity, countDomainEntities, getRoot, isEmpty, isRoot
Methods inherited from interface org.simplesim.model.ModelEntity
addToDomain, getAddress, getFullName, getInport, getLevel, getName, getOutport, getParent, removeFromDomain
-
Field Details
-
ROOT_ADDRESS
public static final int[] ROOT_ADDRESS
-
-
Constructor Details
-
BasicDomain
public BasicDomain()
-
-
Method Details
-
listAllAgents
Description copied from interface:Domain
Returns all agents within this domain- Specified by:
listAllAgents
in interfaceDomain
- Parameters:
recursive
- true if listing should be done recursively for agents in all subdomains, too- Returns:
- list of all agents of this domain
-
listDomainEntities
Description copied from interface:Domain
Returns an unmodifiable list of all entities of this domain - an entity can either be an agent or another domain.- Specified by:
listDomainEntities
in interfaceDomain
- Returns:
- an unmodifiable list of all entities of this domain
-