C# Class TrafficManager.TrafficLight.TimedTrafficLightsStep

Inheritance: ICloneable
Afficher le fichier Open project: Katalyst6/CSL.TransitAddonMod Class Usage Examples

Méthodes publiques

Свойство Type Description
lastFlowWaitCalc uint
maxTime int
maxWait float
minFlow float
minTime int
segmentLights CustomSegmentLights>.Dictionary
startFrame uint
waitFlowBalance float

Méthodes publiques

Méthode Description
Clone ( ) : object
GetLight ( ushort segmentId, ExtVehicleType vehicleType, int lightType ) : RoadBaseAI.TrafficLightState
MaxTimeRemaining ( ) : long

Countdown value for max. time

MinTimeRemaining ( ) : long

Countdown value for min. time

SetLights ( ) : void

Updates "real-world" traffic light states according to the timed scripts

SetLights ( bool noTransition ) : void
SetStepDone ( ) : void
Start ( ) : void

Starts the step.

StepDone ( bool updateValues ) : bool
TimedTrafficLightsStep ( TimedTrafficLights timedNode, int minTime, int maxTime, float waitFlowBalance, List groupNodeIds, bool makeRed = false ) : System
UpdateLights ( ) : void

Updates timed segment lights according to "real-world" traffic light states

calcWaitFlow ( float &wait, float &flow ) : bool

Calculates the current metrics for flowing and waiting vehicles

isValid ( ) : bool

Private Methods

Méthode Description
ChangeLightMode ( ushort segmentId, ExtVehicleType vehicleType, CustomSegmentLight mode ) : void
addSegment ( ushort segmentId, bool makeRed ) : void

Adds a new segment to this step. After adding all steps the method `rebuildSegmentIds` must be called.

calcLightState ( RoadBaseAI previousState, RoadBaseAI currentState, RoadBaseAI nextState, bool atStartTransition, bool atEndTransition ) : RoadBaseAI.TrafficLightState
calcMaxSegmentLength ( ) : void
getCurrentFrame ( ) : uint
isEndTransitionDone ( ) : bool

Checks if the green-to-red (=yellow) phase is finished

isInEndTransition ( ) : bool

Checks if the green-to-red (=yellow) phase is currently active

isInStartTransition ( ) : bool

Method Details

Clone() public méthode

public Clone ( ) : object
Résultat object

GetLight() public méthode

public GetLight ( ushort segmentId, ExtVehicleType vehicleType, int lightType ) : RoadBaseAI.TrafficLightState
segmentId ushort
vehicleType ExtVehicleType
lightType int
Résultat RoadBaseAI.TrafficLightState

MaxTimeRemaining() public méthode

Countdown value for max. time
public MaxTimeRemaining ( ) : long
Résultat long

MinTimeRemaining() public méthode

Countdown value for min. time
public MinTimeRemaining ( ) : long
Résultat long

SetLights() public méthode

Updates "real-world" traffic light states according to the timed scripts
public SetLights ( ) : void
Résultat void

SetLights() public méthode

public SetLights ( bool noTransition ) : void
noTransition bool
Résultat void

SetStepDone() public méthode

public SetStepDone ( ) : void
Résultat void

Start() public méthode

Starts the step.
public Start ( ) : void
Résultat void

StepDone() public méthode

public StepDone ( bool updateValues ) : bool
updateValues bool
Résultat bool

TimedTrafficLightsStep() public méthode

public TimedTrafficLightsStep ( TimedTrafficLights timedNode, int minTime, int maxTime, float waitFlowBalance, List groupNodeIds, bool makeRed = false ) : System
timedNode TimedTrafficLights
minTime int
maxTime int
waitFlowBalance float
groupNodeIds List
makeRed bool
Résultat System

UpdateLights() public méthode

Updates timed segment lights according to "real-world" traffic light states
public UpdateLights ( ) : void
Résultat void

calcWaitFlow() public méthode

Calculates the current metrics for flowing and waiting vehicles
public calcWaitFlow ( float &wait, float &flow ) : bool
wait float
flow float
Résultat bool

isValid() public méthode

public isValid ( ) : bool
Résultat bool

Property Details

lastFlowWaitCalc public_oe property

public uint lastFlowWaitCalc
Résultat uint

maxTime public_oe property

The number of time units this traffic light remains in the current state at most
public int maxTime
Résultat int

maxWait public_oe property

maximum mean "number of cars waiting for green" / "average segment length"
public float maxWait
Résultat float

minFlow public_oe property

minimum mean "number of cars passing through" / "average segment length"
public float minFlow
Résultat float

minTime public_oe property

The number of time units this traffic light remains in the current state at least
public int minTime
Résultat int

segmentLights public_oe property

public Dictionary segmentLights
Résultat CustomSegmentLights>.Dictionary

startFrame public_oe property

public uint startFrame
Résultat uint

waitFlowBalance public_oe property

public float waitFlowBalance
Résultat float