AlternatingArbiter

class AlternatingArbiter(val walkTime: Double, val driveTime: Double) : CrossingArbiterIfc(source)

Turn and turn about: a signal with a cycle.

Pedestrians are admitted for walkTime once a turn opens, and the crossing then stays open to traffic for at least driveTime before another turn may begin. Both sides get a share that does not depend on how hard the other side is pushing, which is what neither priority rule can offer.

Parameters

walkTime

how long a pedestrian turn admits people

driveTime

the least time traffic gets between turns

Constructors

Link copied to clipboard
constructor(walkTime: Double, driveTime: Double)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun admitsPedestrian(crossing: ZoneCrossing): Boolean

May a pedestrian step onto the crossing now?

Link copied to clipboard
open override fun barsVehicles(crossing: ZoneCrossing): Boolean

Should the crossing be held shut against vehicles?

Link copied to clipboard
open override fun reset()

Clears whatever the discipline remembers between replications. Does nothing by default.

Link copied to clipboard
open override fun reviewAt(crossing: ZoneCrossing): Double

When the crossing should ask again even though nothing has happened.

Link copied to clipboard
open override fun turnEnded(crossing: ZoneCrossing)

Told that a turn has ended, so a discipline with a memory can advance it.