Description

To use the library, the jar file libbikeshr.jar (which should be installed in the same directory as libbzdev.jar) should be added to the class path in addition to libbzdev.jar. When scrunner is used, libbzdev.jar is automatically included.

A typical scrunner script (EMCAScript is used as an example) will typically start with the following:

scripting.importClasses("org.bzdev.bikeshare",
			["HubDataAdapter", "TripDataAdapter"]);

scripting.importClass("org.bzdev.drama.DramaSimulation");
scripting.importClass("org.bzdev.util.units.MKS");

// Import whatever random number generators are desired.
scripting.importClass("org.bzdev.math.rv.GaussianRV");

// 1000.0 is the number of simulation ticks per second and can
// be changed as desired.
sim = new DramaSimulation(scripting, 1000.0);

simff = sim.createFactory("org.bzdev.devqsim.SimFunctionTwoFactory");

sim.createFactories("org.bzdev.bikeshare", {
    edf: "ExtDomainFactory",
    udf: "UsrDomainFactory",
    sdf: "SysDomainFactory",
    hbf: "BasicHubBalancerFactory",
    hf: "HubFactory",
    shf: "StorageHubFactory",
    hwf: "HubWorkerFactory",
    stdtf: "StdDelayTableFactory",
    schedtf: "SchedDelayTableFactory",
    btgf: "BasicTripGenFactory"
});
The corresponding ESP script is

import (org.bzdev.bikeshare,
	[HubDataAdapter, TripDataAdapter]);

import (org.bzdev.drama.DramaSimulation);
import (org.bzdev.util.units.MKS);

// Import whatever random number generators are desired.
import (org.bzdev.math.rv.GaussianRV);

// 1000.0 is the number of simulation ticks per second and can
// be changed as desired.
var sim = new DramaSimulation(scripting, 1000.0);

var simff = sim.createFactory("org.bzdev.devqsim.SimFunctionTwoFactory");

sim.createFactories("org.bzdev.bikeshare", {
    edf: "ExtDomainFactory",
    udf: "UsrDomainFactory",
    sdf: "SysDomainFactory",
    hbf: "BasicHubBalancerFactory",
    hf: "HubFactory",
    shf: "StorageHubFactory",
    hwf: "HubWorkerFactory",
    stdtf: "StdDelayTableFactory",
    schedtf: "SchedDelayTableFactory",
    btgf: "BasicTripGenFactory"
});
###
The line containing ### is needed if any following statements use one of the factories defined by calling the createFactories method. It is not needed if those statements appear in a separate file. The factories should be used in the order listed above, or a similar order, due to the following dependencies: