Skip to content

Commit

Permalink
extending class doc. refs #14736, #14734
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 18, 2024
1 parent ab5a44c commit c89afab
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tools/traci/_trafficlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
class Logic:

def __init__(self, programID, type, currentPhaseIndex, phases=None, subParameter=None):
"""
Constructs a new Logic object with the following arguments:
programID (string) - arbitrary
type (integer) - one of
tc.TRAFFICLIGHT_TYPE_STATIC
tc.TRAFFICLIGHT_TYPE_ACTUATED
tc.TRAFFICLIGHT_TYPE_NEMA
tc.TRAFFICLIGHT_TYPE_DELAYBASED
currentPhaseIndex (integer) - must be in range [0, len(phases) - 1]
phases (list of Phase objects)
subParameter (dictl) - corresponds to generic <param> objects
"""
self.programID = programID
self.type = type
self.currentPhaseIndex = currentPhaseIndex
Expand Down Expand Up @@ -407,7 +419,7 @@ def setProgramLogic(self, tlsID, logic):
"""setProgramLogic(string, Logic) -> None
Sets a new program for the given tlsID from a Logic object.
See getCompleteRedYellowGreenDefinition.
See getAllProgramLogics which returns a list of Logic objects.
"""
format = "tsiit"
values = [5, logic.programID, logic.type, logic.currentPhaseIndex, len(logic.phases)]
Expand Down

0 comments on commit c89afab

Please sign in to comment.