java.lang.Object
org.bzdev.devqsim.SimObject
org.bzdev.drama.generic.GenericSimObject<S,A,C,D,DM,F,G>
org.bzdev.drama.generic.GenericMsgFrwdngInfo<DramaSimulation,Actor,Condition,Domain,DomainMember,DramaFactory,Group>
org.bzdev.drama.MsgForwardingInfo
org.bzdev.bikeshare.DelayTable
org.bzdev.bikeshare.SchedDelayTable
- All Implemented Interfaces:
NamedObjectOps
Class representing a delay table for scheduled trips between hubs.
This class computes the time it takes to travel from one hub to
another. For any two end points, the travel time may be different
each time
getDelay(double,Hub,Hub,int)
is called with the same
arguments due to the use of random variables.
This class allows one to set up a table to compute delays for any two pairs of hubs (table entries are directional so for each pair, two entries are normally needed) and a sequence of starting times.
-
Constructor Summary
ConstructorsConstructorDescriptionSchedDelayTable
(DramaSimulation sim, String name, boolean intern) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an entry describing a trip between two hubs.void
Add a periodic entry describing a sequence of trips between two hubs.boolean
protected Object
clone()
final boolean
delete()
final boolean
double
estimateDelay
(double startingTime, Hub src, Hub dest, int n) Estimate the time it takes to travel between two hubs.double
Get the time it takes to travel between two hubs.protected org.bzdev.bikeshare.SchedDelayTable.Entry
Get the best entry for a source, destination, and starting time.final String
getName()
protected Simulation
final boolean
boolean
double
latestStartingTime
(double time, Hub src, Hub dest) Get the latest starting time, given a minimum starting time, for a trip between two hubs with the same arrival time.protected long
localDelay
(Domain domain, Actor src, Object msg, Actor dest) void
printConfiguration
(String iPrefix, String prefix, boolean printName, PrintWriter out) Print the configuration for an instance of StdDelayTable.Methods inherited from class org.bzdev.bikeshare.DelayTable
addToDomain, estimateDelay, getDelay, latestStartingTime
Methods inherited from class org.bzdev.drama.generic.GenericMsgFrwdngInfo
localDelay, localDelay, localDelay, localDelay, localDelay, localDelay, localDelay, localDelay, localMessageFilter, localMessageFilter, localMessageFilter, localMessageFilter, localMessageFilter, localMessageFilter, localMessageFilter, localMessageFilter, localMessageFilter
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, onDelete, 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
canDelete, delete, deletePending, getName, isDeleted, isInterned
-
Constructor Details
-
SchedDelayTable
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
-
-
Method Details
-
localDelay
- Overrides:
localDelay
in classDelayTable
-
printConfiguration
Print the configuration for an instance of StdDelayTable. 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 methodGenericSimObject.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
StdDelayTable
:- the random variable giving the average speed (m/s).
- the default distance for the number of stops.
- the number of stops over the default distance.
- the default probability of stopping at a stop.
- the default maximum wait time at a stop.
- the distance fraction (0.0 means line of sight and 1.0 means the value following a rectangular grid when computing distances from XY coordinates)
- the hub table. For each pair of hubs, this table shows the
following:
- the distance in meters between two hubs.
- the number of stops.
- the probability of stopping.
- the maximum wait while stopped.
- Overrides:
printConfiguration
in classGenericSimObject<DramaSimulation,
Actor, Condition, Domain, DomainMember, DramaFactory, Group> - 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
-
canDelete
public boolean canDelete()- Specified by:
canDelete
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