java.lang.Object
org.bzdev.devqsim.SimObject
org.bzdev.drama.generic.GenericSimObject<S,A,C,D,DM,F,G>
org.bzdev.drama.generic.GenericTaskObject<S,A,C,D,DM,F,G>
org.bzdev.drama.generic.GenericDomain<DramaSimulation,Actor,Condition,Domain,DomainMember,DramaFactory,Group>
org.bzdev.drama.Domain
org.bzdev.bikeshare.HubDomain
org.bzdev.bikeshare.SysDomain
- All Implemented Interfaces:
Comparable<Domain>
,CondObserver<Condition,
,Domain> NamedObjectOps
Class providing a system domain.
All hubs (including storage hubs) are configured to be members of
a system domain. A system domain's delay table gives the travel time
for workers between pairs of hubs. The workers will typically use
a vehicle of some sort due to the need to move a number of bicycles.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CommDomainType
The Communication domain type for system domains. -
Constructor Summary
ConstructorsConstructorDescriptionSysDomain
(DramaSimulation sim, String name, boolean intern) Constructor.SysDomain
(DramaSimulation sim, String name, boolean intern, Domain parent) Constructor with parent domain. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
clone()
final boolean
delete()
final boolean
protected CommDomainType
Get this object's communication domain type.final String
getName()
protected Simulation
Get the storage hubs that are members of a system domain.Get the hubs that are members of a system domain but that are not storage hubs.final boolean
boolean
protected void
onJoinedDomain
(Actor actor, boolean trackCondition) protected void
onLeftDomain
(Actor actor) void
printConfiguration
(String iPrefix, String prefix, boolean printName, PrintWriter out) Print the configuration for an instance of HubDomain.Methods inherited from class org.bzdev.bikeshare.HubDomain
estimateDelay, estimateDelay, getDelay, getDelay, getDelayTable, getParentHubDomain
Methods inherited from class org.bzdev.drama.Domain
getMsgForwardingInfo, setMessageForwardingInfo
Methods inherited from class org.bzdev.drama.generic.GenericDomain
actorSet, actorSetSize, addCommDomainTypeSet, addCondition, canDelete, communicationMatch, communicationMatch, communicationMatch, communicationMatch, communicationMatch, communicationMatch, communicationMatch, communicationMatchByDomain, communicationMatchByDomain, communicationMatchByDomain, communicationMatchByDomain, communicationMatchByDomainAncestor, communicationMatchByDomainAncestor, communicationMatchByDomainAncestor, communicationMatchByDomainAncestor, compareTo, conditionSet, configureAsCommunicationDomain, configureAsCommunicationDomain, configureAsCommunicationDomain, containsActor, containsDomainMember, containsGroup, createCommDomainInfo, domainMemberSet, getCommDomainType, getCommDomainTypeSet, getConditionChangeQMode, getCondObserverImpl, getDelay, getDelay, getDelay, getDelay, getMessageFilter, getMessageFilter, getMessageFilter, getMessageFilter, getMFI, getParent, getPriority, groupSet, groupSetSize, hasCondition, isCommunicationDomain, onChildAdd, onChildRemove, onDelete, onJoinedDomain, onLeftDomain, removeCondition, setConditionChangeQMode, setMessageForwardingInfo
Methods inherited from class org.bzdev.drama.generic.GenericTaskObject
cancelDefaultCall, cancelDefaultTask, defaultCall, defaultTask, scheduleDefaultCall, scheduleDefaultTask, scheduleDefaultTask
Methods inherited from class org.bzdev.drama.generic.GenericSimObject
getSimulation, printState
Methods inherited from class org.bzdev.devqsim.SimObject
addSimulationListener, addTraceSet, bindCallable, bindCallable, bindCallable, bindCallable, bindRunnable, bindRunnable, bindRunnable, bindRunnable, callableObject, callableScript, callScriptFunction, callScriptMethod, clearTraceSets, evalScript, getEventListenerList, getScriptObject, getTraceSets, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printConfiguration, printState, printState, printState, printState, printState, printState, putScriptObject, removeSimulationListener, removeTraceSet, runnableObject, runnableScript, scheduleCall, scheduleCall, scheduleCall, scheduleCall, scheduleCallObject, scheduleScript, scheduleTask, scheduleTask, scheduleTask, scheduleTask, scheduleTaskObject, scheduleTaskScript, startImmediateTask, startImmediateTask, trace, trace, unscheduledTaskThread, unscheduledTaskThread, update, update, usesTraceSet
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bzdev.obnaming.NamedObjectOps
delete, deletePending, getName, isDeleted, isInterned
-
Field Details
-
commDomainType
The Communication domain type for system domains.
-
-
Constructor Details
-
SysDomain
Constructor.- Parameters:
sim
- the simulationname
- the name of this objectintern
- true if this object should be interned in the simulation's name table; false otherwise
-
SysDomain
Constructor with parent domain.- Parameters:
sim
- the simulationname
- the name of this objectintern
- true if this object should be interned in the simulation's name table; false otherwiseparent
- the parent domain
-
-
Method Details
-
fetchCommDomainType
Description copied from class:HubDomain
Get this object's communication domain type. Concrete subclasses must override this method and ensure that the method is idempotent. The value returned must not be null.This method is provided because the subclasses
UsrDomain
andSysDomain
use different communication-domain types, while this class is expected to be a communication domain.- Specified by:
fetchCommDomainType
in classHubDomain
- Returns:
- this domain's communication-domain type
-
getStorageHubs
Get the storage hubs that are members of a system domain.- Returns:
- a set of storage hubs associated with this domain
-
getUserHubs
Get the hubs that are members of a system domain but that are not storage hubs.- Returns:
- a set of hubs that are associated with this domain but that are not storage hubs
-
onJoinedDomain
- Overrides:
onJoinedDomain
in classGenericDomain<DramaSimulation,
Actor, Condition, Domain, DomainMember, DramaFactory, Group>
-
onLeftDomain
- Overrides:
onLeftDomain
in classGenericDomain<DramaSimulation,
Actor, Condition, Domain, DomainMember, DramaFactory, Group>
-
printConfiguration
Print the configuration for an instance of HubDomain. The documentation for methodSimObject.printConfiguration(String,String,boolean,java.io.PrintWriter)
contains a description of how this method is used and how to override it. The methodGenericActor.printConfiguration(String,String,boolean,java.io.PrintWriter)
describes the data that will be printed for the superclass of this class. The data that will be printed when this method is called are the following.For class
HubDomain
:- the delay table for this domain.
- a list of the storage hubs for this domain.
- Overrides:
printConfiguration
in classHubDomain
- Parameters:
iPrefix
- the prefix to use for an initial line when printName is true with null treated as an empty stringprefix
- a prefix string (typically whitespace) to put at the start of each line other than the initial line that is printed when printName is trueprintName
- requests printing the name of an objectout
- the output print writer
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
isInterned
public boolean isInterned()- Specified by:
isInterned
in interfaceNamedObjectOps
-
getObjectNamer
-
getName
- Specified by:
getName
in interfaceNamedObjectOps
-
delete
public final boolean delete()- Specified by:
delete
in interfaceNamedObjectOps
-
isDeleted
public final boolean isDeleted()- Specified by:
isDeleted
in interfaceNamedObjectOps
-
deletePending
public final boolean deletePending()- Specified by:
deletePending
in interfaceNamedObjectOps
-