Module org.bzdev.bikeshr
Package org.bzdev.bikeshare
Class TripGeneratorFactory<Obj extends TripGenerator>
java.lang.Object
org.bzdev.obnaming.NamedObjectFactory<F,Simulation,SimObject,OBJ>
org.bzdev.devqsim.SimObjectFactory<OF,S,Obj>
org.bzdev.drama.generic.GenericActorFactory<AbstractActorFactory<Obj>,DramaSimulation,Actor,Condition,Domain,DomainMember,DramaFactory,Group,Obj>
org.bzdev.drama.AbstractActorFactory<Obj>
org.bzdev.bikeshare.TripGeneratorFactory<Obj>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AbstrBasicTripGenFactory
,AbstrBurstTripGenFactory
,AbstrRoundTripGenFactory
public abstract class TripGeneratorFactory<Obj extends TripGenerator>
extends AbstractActorFactory<Obj>
Base class for trip generator factories.
The parameters this factory defines are:
- "initialDelay" - the time in seconds at which a traffic generator starts running. A value of 0.0 (the default) is the simulation's current time when the traffic generator is created (typically, the simulation's starting time).
- "probabilityFunction" - a SimFunctionTwo that provides a probability function. The probability function is defined as a real-valued function f(d1,d2) whose range is [0.0, 1.0] and whose domain contains non-negative values of its arguments. When called, d1 will be the estimated delay computed using the delay table for the source hub's user domain and d2 will be the delay computed using the delay table for the parent domain of the source hub's user domain. The probability this function computes is the probability that the delay used is d1. If the function is null, the d1 will be used if it is less than d2. If d2 is used, bicycles will not be removed or added to a hub as the trip is assumed to use some other service.
- "timeline.running" - an integer-keyed timeline parameter (see below) whose value may be "true" or "false". If not provided, this parameter is ignored. It is used to turn the traffic generator on or off at specific times.
- "domainMember". Used to configure an instance of DomainMember for handling domain membership.
- "domains". Used to clear a set of domains explicitly provided, but cannot be used to set or add domains.
- "domain". Used to specify a domain that can added or removed from the actor's domain set. For this parameter, the key is the domain and the value is a boolean that is true if conditions for that domain should be tracked; false otherwise. If a specified domain was already joined by a shared domain member, an explicit request to join that domain will be ignored when an actor is created.
- "timeline" - an integer-keyed set of values that define
changes in the object's configuration. Subclasses may provide
additional parameters. The default parameters are:
- "timeline.time" - the time at which timeline parameters are to change. This parameter must be provided if a timeline entry exists. The units are those used by the double-precession time unit for the simulation (for animations, this is generally seconds).
- "timeline.traceSetMode" - indicates how the parameter
"timeline.traceSets" is interpreted. the values are
enumeration constants of type
TraceSetMode
and are used as follows:- "KEEP" - keep the existing trace sets, adding additional ones specified by the parameter "timeline.traceSets".
- "REMOVE" - remove the trace sets specified by the parameter "timeline.traceSets".
- "REPLACE" - remove all existing trace sets and replace those with the ones specified by the timeline.traceSets parameter.
- "timeline.traceSets" - a parameter representing a set of TraceSet objects (the three-argument 'add' method is used to add entries).
- "traceSets" - a set of TraceSets a SimObject will use for tracing. One should use the add and remove factory methods as this parameter refers to a set of values.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.obnaming.NamedObjectFactory
NamedObjectFactory.ConfigException, NamedObjectFactory.IndexedSetter, NamedObjectFactory.ParmNameIterator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToTimelineRequest
(Obj object, int key, double time) void
clear()
protected void
initObject
(Obj tripGen) Methods inherited from class org.bzdev.drama.generic.GenericActorFactory
clone
Methods inherited from class org.bzdev.devqsim.SimObjectFactory
addToTimelineResponse, getSimulation
Methods inherited from class org.bzdev.obnaming.NamedObjectFactory
add, add, add, add, add, add, add, add, addDocResourceBundle, addDocResourceBundle, addJDoc, addJDoc, addLabelResourceBundle, addLabelResourceBundle, addTipResourceBundle, addTipResourceBundle, arrayInit, canAdd3, clear, configure, configureSupported, containsParm, createObject, createObject, createObject, createObject, createObjects, createObjects, createObjects, createObjects, createObjects, createObjects, doAfterInits, endObjectCreation, getDoc, getFactoryClass, getGLB, getLabel, getLayoutResource, getListedFactories, getLUB, getNextName, getNextNameIndex, getObjectNamer, getParmKeyType, getParmPrefix, getRVMode, getTemplateKeyMap, getTemplateKeyMapForFactories, getTemplateKeyMapForFactories, getTemplateKeyMapForFactories, getTip, getType, glbInRange, initParm, initParms, initParms, isClearOnly, isNamedObject, isRandomVariable, keyType, lubInRange, mustAdd, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newInstance, newInstance, newObject, parmNames, parmNameSet, parmPrefixes, remove, remove, remove, remove, remove, remove, remove, remove, removeParm, removeParms, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setDocAPIBase, setInterned, setLayoutResource, setLayoutResource, setNameRoot, setTarget, startObjectCreation, unset, unset, unset, unset, unset, unset, willIntern
-
Constructor Details
-
TripGeneratorFactory
Constructor.- Parameters:
sim
- the simulation
-
-
Method Details
-
clear
public void clear()- Overrides:
clear
in classGenericActorFactory<AbstractActorFactory<Obj extends TripGenerator>,
DramaSimulation, Actor, Condition, Domain, DomainMember, DramaFactory, Group, Obj extends TripGenerator>
-
addToTimelineRequest
- Overrides:
addToTimelineRequest
in classSimObjectFactory<AbstractActorFactory<Obj extends TripGenerator>,
DramaSimulation, Obj extends TripGenerator>
-
initObject
- Overrides:
initObject
in classGenericActorFactory<AbstractActorFactory<Obj extends TripGenerator>,
DramaSimulation, Actor, Condition, Domain, DomainMember, DramaFactory, Group, Obj extends TripGenerator>
-