Aimsun Next API Control Plans¶
Functions related to Control Plans¶
Read Number of control plans loaded¶
In C++ and Python¶
Explanation¶
Read the number of control plans loaded for the specified junction for the whole simulation.
Format¶
int ECIGetNumberofControls ( int idJunction )
Parameters¶
- idJunction: Identifier of the node.
Output¶
- ≥ 0: number of control plans
- < 0: Error
Read the name of a control plan loaded¶
In C++ and Python¶
Explanation¶
Read the name of a specific control plan.
Format¶
const unsigned short *ECIGetNameofControl(int idJunction, int elemControl);
Parameters¶
- idJunction: Identifier of the node.
- elemControl: The index of the control plan name to be retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls (idJunction) –1
Output¶
- Not NULL: name of the control plan
- NULL: Error
The recommended usage in Python APIs is:
anyNonAsciiChar = boolp()
AKIConvertToAsciiString(ECIGetNameofControl(idJunction, elemControl), True, anyNonAsciiChar))
Read the Initial Time of a control plan loaded¶
In C++ and Python¶
Explanation¶
Read the initial time when the control plan will be active in seconds from time 00:00:00.
Format¶
double ECIGetIniTimeofControl(int idJunction, int elemControl);
Parameters¶
- idJunction: Identifier of the node.
- elemControl: The index of the control plan name to be retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
Output¶
- ≥ 0: Initial Time, in seconds from midnight.
- < 0: Error
Read the Offset of a control plan loaded¶
In C++ and Python¶
Explanation¶
Read the offset of a control plan in seconds.
Format¶
double ECIGetOffsetofControl (int idJunction, int elemControl);
Parameters¶
- idJunction: Identifier of the node.
- elemControl: The index of the control plan for which the offset is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
Output¶
- ≥ 0: offset
- < 0: Error
Read the Cycle of a control plan loaded¶
In C++ and Python¶
Explanation¶
Read the cycle of a control plan in seconds.
Format¶
double ECIGetControlCycleofJunction (int elemControl, int idJunction);
Parameters¶
- idJunction: Identifier of the node.
- elemControl: The index of the control plan for which the offset is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
Output¶
- ≥ 0: control plan cycle
- < 0: Error
Read the number of rings in a control plan loaded¶
In C++ and Python¶
Explanation¶
Read the number of rings in a control plan
Format¶
int ECIGetNbRingsJunction(int elemControl, int ajunction);
Parameters¶
- idJunction: Identifier of the node.
- elemControl: The index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
Output¶
- ≥ 0: number of rings
- < 0: Error
Read the number of rings in the current control plan¶
In C++ and Python¶
Explanation¶
Read the number of rings a control plan
Format¶
int ECIGetCurrentNbRingsJunction(int ajunction);
Parameters¶
- idJunction: Identifier of the node.
Output¶
- ≥ 0: number of rings in the current control plan
- < 0: Error
Read the number of barriers in a loaded control plan ¶
In C++ and Python¶
Explanation¶
Read the number of barriers in a control plan
Format¶
int ECIGetNbBarriersJunction(int elemControl, int ajunction);
Parameters¶
- idJunction: Identifier of the node.
- elemControl: the index of the control plan for which number of barriers is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
Output¶
- ≥ 0: number of barriers
- < 0: Error
Read the number of barriers in the current control plan¶
In C++ and Python¶
Explanation¶
Read the number of barriers in a control plan
Format¶
int ECIGetCurrentNbBarriersJunction(int ajunction);
Parameters¶
- idJunction: Identifier of the node.
Output¶
- ≥ 0: number of barriers in the current control plan
- < 0: Error
Read the name of the current control plan.¶
In C++ and Python¶
Explanation¶
Read the name of the current active control plan.
Format¶
const unsigned short * ECIGetNameCurrentControl (int idJunction);
Parameters¶
- idJunction: Identifier of the node.
Output¶
- Not NULL: name of the control plan
- NULL: Error
The recommended usage in Python APIs is:
anyNonAsciiChar = boolp()
AKIConvertToAsciiString(ECIGetNameCurrentControl(idJunction), True, anyNonAsciiChar))
Read the index of the current control plan.¶
In C++ and Python¶
Explanation¶
Gives the index of the current active control plan.
Format¶
int ECIGetNumberCurrentControl (int idJunction);
Parameters¶
- idJunction: Identifier of the node.
Output¶
- ≥ 0: Index of the control plan, 0 ≤ index < ECIGetNumberofControls () –1
- < 0: Error
Remove a loaded control plan¶
In C++ and Python¶
Explanation¶
Remove a previously loaded control plan using the Aimsun Next API Module.
Format¶
int ECIRemoveControl (int idJunction, int elemControl);
Parameters¶
- idJunction: Identifier of the node.
- elemControl: The index of the control plan to be removed, within the range 0 ≤ elemControl < ECIGetNumberofControls () – 1
Output¶
- = 0: No error
- < 0: Error
Functions relevant to controlling junctions¶
Read Number of junctions¶
In C++ and Python¶
Explanation¶
Read the number of junctions present on the road network. A control plan must have been loaded before using this function.
Format:¶
int ECIGetNumberJunctions()
Parameters¶
- No parameters required.
Output¶
- ≥ 0: Number of junctions in the road network
- < 0: Error
Read the Identifier of a junction¶
In C++ and Python¶
Explanation¶
Read the identifier of the elem-th junction present on the road network. A control plan must have been loaded before using this function.
Format¶
int ECIGetJunctionId(int elem)
Parameters¶
- elem: Index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1
Output¶
- > 0: Identifier of the elem-th junction in the road network
- < 0: Error
Read the Identifier of a junction from the External Identifier ¶
In C++ and Python¶
Explanation¶
Read the identifier of junction from the external identifier present on the road network. A control plan must have been loaded before using this function.
Format¶
int ECIGetJunctionIdFromExternalId(const unsigned short *externalId)
Parameters¶
- externalId: The external identifier for the junction.
Output¶
- > 0: Identifier of the junction with external ID ‘externalId’ in the road network
- < 0: Error
Read the Name of a junction¶
In C++ and Python¶
Explanation¶
Read the name of junction identified by idJunction. A control plan must have been loaded before using this function. Returns a utf16 encoded string. Has to be deleted with delete().
Format¶
const unsigned short *ECIGetJunctionName(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- Not NULL:Name of the junction identified by idJunction
- NULL: Error
The recommended usage in Python APIs is:
anyNonAsciiChar = boolp()
AKIConvertToAsciiString(ECIGetJunctionName(idJunction), True, anyNonAsciiChar))
Read the number of Signal Groups of a junction¶
In C++ and Python¶
Explanation¶
Read the number of signal groups defined in junction identified by idJunction. A control plan must have been loaded before using this function.
Format¶
int ECIGetNumberSignalGroups(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- ≥ 0: Total number of signal groups
- < 0: Error
Read the number of Turns assigned to a Signal Group of a junction¶
In C++ and Python¶
Explanation¶
Read the number of turn movements assigned to a signal group defined in the junction identified by idJunction. A control plan must be loaded before using this function.
Format¶
int ECIGetNumberTurningsofSignalGroup (int idJunction, int asignalgroup)
Parameters¶
- idJunction: A valid junction identifier.
- asignalgroup: A valid signal group identifier in the range: 1 ≤ asignalgroup ≤ ECIGetNumberSignalGroups(idJunction)
Output¶
- ≥ 0: Total number of turns assigned to the signal groups
- < 0: Error
Read Turn information assigned to a Signal Group of a junction¶
In C++ and Python¶
Explanation¶
Read the turn information (identified by the section from and section to) assigned to the ith element of a signal group defined in the junction identified by idJunction. A control plan must have been loaded before using this function.
Format¶
int ECIGetFromToofTurningofSignalGroup (int idJunction, int asignalgroup, int indexTurn, int *fromSection, int *toSection)
Parameters¶
- idJunction: A valid junction identifier.
- asignalgroup: A valid signal group identifier. 1 ≤ asignalgroup ≤ ECIGetNumberSignalGroups(idJunction)
- indexTurn: A valid signal turn index, in the range: 0 ≤ indexTurn < ECIGetNumberTurningsofSignalGroup (idJunction, asignalgroup)
- fromSection: The origin section of each one of the turns. This value is returned by the function.
- toSection: The destination section of the turn. This value is returned by the function.
Output¶
- fromSection and toSection: The origin and destination sections of the turn.
- = 0: No Error
- < 0: Error
Sample code in Python¶
The following code reads the origin and destination sections of the first turn assigned to the first signal group in node 203:
fromSection = intp()
toSection = intp()
report = ECIGetFromToofTurningofSignalGroup (203, 1, 0, fromSection, toSection)
if report == 0:
string = "From Section: " + str(fromSection.value())
AKIPrintString(string)
string = "To Section: " + str(toSection.value())
AKIPrintString(string)
AKIPrintString("OK")
else :
AKIPrintString("Not OK")
Read the name of Signal Groups of a junction¶
In C++ and Python¶
Explanation¶
Read the name of signal groups defined in junction identified by idJunction. A control plan must have been loaded before using this function. Returns a utf16 encoded string that has to be deleted when no longer in use.
Format¶
const unsigned short *ECIGetLogicalNameofSignalGroup(int ajunction, int asignalgroup)
Parameters¶
- idJunction: A valid junction identifier.
- asignalgroup: A valid signal group identifier. 1 ≤ asignalgroup ≤ ECIGetNumberSignalGroups(idJunction)
Output¶
- Not NULL: Logical name of the signal group
- NULL: Error
Sample code in Python¶
nonChar = boolp()
name = AKIConvertToAsciiString(ECIGetLogicalNameofSignalGroup(junctionId, signalPos), True, nonChar)
Read the External ID of Signal Groups of a junction¶
In C++ and Python¶
Explanation¶
Read the External ID of signal groups defined in junction identified by idJunction. A control plan must have been loaded before using this function. Returns a utf16 encoded string that has to be deleted when no longer in use.
Format¶
const unsigned short *ECIGetExternalIdofSignalGroup(int idJunction, int signalPos)
Parameters¶
- idJunction: A valid junction identifier.
- signalPos: A valid signal group identifier in the range 1 ≤ signalPos ≤ ECIGetNumberSignalGroups(idJunction)
Output¶
- Not NULL: Logical name of the signal group
- NULL: Error
Sample code in Python¶
nonChar = boolp()
extId = AKIConvertToAsciiString(ECIGetExternalIdofSignalGroup(junctionId, signalPos), True, nonChar)
Read the ID of Signal Groups of a junction¶
In C++ and Python¶
Explanation¶
Read the ID of signal groups defined in junction identified by idJunction. A control plan must have been loaded before using this function. Returns the user interface ID that corresponds to that signal group position.
Format¶
int ECIGetAimsunIdofSignalGroup(int ajunction, int asignalgroup)
Parameters¶
- idJunction: A valid junction identifier.
- signalPos: A valid signal group position in the range 1 ≤ signalPos ≤ ECIGetNumberSignalGroups(idJunction)
Output¶
- ≥ 0: ID of the signal group
- < 0: Error
Read the Control Type of a junction¶
In C++ and Python¶
Explanation:¶
Read the control type of a junction in the current control plan.
Format¶
int ECIGetControlType (int idJunction)
Parameters¶
- idJunction: A valid a junction identifier.
Output¶
- ≥ 0: 0 Uncontrolled, 1 Fixed, 2 External, 3 Actuated
- < 0: Error
Read the Control Type of a junction in a loaded control plan¶
In C++ and Python:¶
Explanation¶
Read the Control Type of a junction in a loaded control plan.
Format¶
int ECIGetTypeControlofJunction(int elemControl, int idJunction);
Parameters¶
- idJunction: Identifier of the node to get the information for.
- elemControl: The index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
Output¶
- ≥ 0: 0 Uncontrolled, 1 Fixed, 2 External, 3 Actuated
- < 0: Error
Read the Number of Phases of a junction¶
In C++ and Python¶
Explanation¶
Read the total number of phases of a junction in the current control plan.
Format¶
int ECIGetNumberPhases (int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- ≥ 0: Total number of phases returned
- < 0: Error
Read the Number of Phases of a junction in a loaded control plan¶
In C++ and Python:¶
Explanation¶
Read the total number of phases of a junction in a loaded control plan.
Format¶
int ECIGetNbPhasesofJunction(int elemControl, int ajunction);
Parameters¶
- idJunction: Identifier of the node to get the information for.
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
Output¶
- ≥ 0: Total number of phases returned
- < 0: Error
Read the Number of Phases of a junction in a Specified Ring¶
In C++ and Python¶
Explanation¶
Read the total number of phases of ring for this junction in the current control plan.
Format¶
int ECIGetNumberPhasesInRing (int idJunction, int ring)
Parameters¶
- idJunction represents a valid junction identifier.
- ring is a number between 0 and ECIGetNbRingsJunction()-1
Output¶
- ≥0: Total number of phases returned
- < 0: Error
Read the Number of Phases of a junction in a specified ring in a loaded control plan ¶
In C++:¶
Explanation¶
Read the total number of phases of ring for this junction in a loaded control plan.
Format¶
int ECIGetNumberPhasesInRingofJunction(int elemControl, int idJunction, int ring);
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction: Identifier of the node to get the information for.
- ring is a number between 0 and ECIGetNbRingsJunction()-1
Output¶
- ≥ 0: Total number of phases returned
- < 0: Error
Read Time Duration of a phase of a junction ¶
In C++ and Python¶
Explanation¶
Read the maximum, minimum, and current duration of a phase in junction during the current control plan. These times are returned in the parameters max, min, and dur respectively.
Format¶
int ECIGetDurationsPhase(int idJunction, int idPhase, double timeSta, double *dur, double *max, double *min)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta: The time of simulation (current time) in seconds from midnight.
- dur: The current duration of the phase. This value is returned by the function.
- max: The maximum duration available for the phase. This value is returned by the function.
- min: The minimum duration available for the phase. This value is returned by the function.
Output¶
- 0: No error occurred.
- < 0: Error
Example showing use in Python:
normalDurationP = doublep()
maxDurationP = doublep()
minDurationP = doublep()
ECIGetDurationsPhase(junctionId, phaseId, timeSta, normalDurationP, maxDurationP, minDurationP)
normalDuration = normalDurationP.value()
maxDuration = maxDurationP.value()
minDuration = minDurationP.value()
Read Time Duration of a phase of a junction in a loaded control plan¶
In C++ and Python¶
Explanation¶
Read the maximum, minimum and current duration of a phase in junction in a loaded control plan . These times are returned in the parameters max, min and dur respectively.
Format¶
int ECIGetDurationsPhaseofJunction(int elemControl, int idJunction, int idPhase, double timeSta, double *dur, double *max, double *min)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta represent the time of simulation (current time) in seconds from midnight.
- dur represents the current duration of the phase. This value is returned by the function.
- max represents the maximum duration available for the phase. This value is returned by the function.
- min represents the minimum duration available for the phase. This value is returned by the function.
Output¶
- 0: No error occurred.
- < 0: Error
Set Yellow Time Duration of a phase of a junction¶
In C++ and Python¶
Explanation¶
Set the yellow time duration, from green to red state, of a phase in junction during the current control plan.
Format¶
int ECISetYellowTimePhase(int idJunction,int idPhase,double timeSta,double yellow)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta: The time of simulation (current time) in seconds from midnight.
- yellow: The new yellow time duration, from green to red state, of the phase.
Output¶
- 0: No error occurred.
- < 0: Error
Read Yellow Time Duration of a phase of a junction¶
In C++ and Python¶
Explanation¶
Read the yellow time duration of a phase, from green to red state, in junction during the current control plan. The time is returned in the yellow parameter.
Format¶
int ECIGetYellowTimePhase(int idJunction, int idPhase, double timeSta, double *yellow)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta: The time of simulation (current time) in seconds from midnight.
- yellow: The yellow time duration, from green to red state, of the phase. This value is returned by the function.
Output¶
- 0: No error occurred.
- < 0: Error
Set Yellow Time Duration of a phase of a junction in a loaded control plan ¶
In C++ and Python¶
Explanation¶
Set the yellow time duration, from green to red state, of a phase in junction in a loaded control plan .
Format¶
int ECISetYellowTimePhaseofJunction(int elemControl, int idJunction,int idPhase, double yellow)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta represent the time of simulation (current time) in seconds from midnight.
- yellow represents the new yellow time duration, from green to red state, of the phase.
Output¶
- 0: No error occurred.
- < 0: Error
Read Yellow Time Duration of a phase of a junction in a loaded control plan ¶
In C++ and Python¶
Explanation¶
Read the yellow time duration, from green to red state, of a phase in junction in a control plan loaded. The time is returned in the yellow parameter.
Format¶
int ECIGetYellowTimePhaseofJunction(int elemControl, int idJunction,int idPhase, double timeSta, double *yellow)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta represent the time of simulation (current time) in seconds from midnight.
- yellow represents the yellow time duration, from green to red state, of the phase. This value is returned by the function.
Output¶
- 0: No error occurred.
- < 0: Error
Set Yellow Time Duration from red to green state of a phase of a junction in a loaded control plan ¶
In C++ and Python¶
Explanation¶
Set the yellow time duration, from red to green state, of a phase in junction in a loaded control plan .
Format¶
int ECISetYellowTimeBeforeGreenPhaseofJunction(int elemControl, int idJunction,int idPhase, double yellowBeforeGreen)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- yellowBeforeGreen represents the new yellow time duration from red to green state of the phase.
Output¶
- 0: No error occurred.
- < 0: Error
Read Yellow Time Duration from red to green state of a phase of a junction in a loaded control plan ¶
In C++ and Python¶
Explanation¶
Read the yellow time duration freom red to green state of a phase in junction in a control plan loaded. The time is returned in the yellowBeforeGreen parameter.
Format¶
int ECIGetYellowTimeBeforeGreenPhaseofJunction(int elemControl, int idJunction, int idPhase, double *yellowBeforeGreen)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta represent the time of simulation (current time) in seconds from midnight.
- yellowBeforeGreen represents the yellow time duration from red to green state of the phase. This value is returned by the function.
Output¶
- 0: No error occurred.
- < 0: Error
Set Yellow Time Duration from red to green state of a phase of a junction¶
In C++ and Python¶
Explanation¶
Set the yellow time duration of a phase, from red to green state, in junction during the current control plan.
Format¶
int ECISetYellowTimeBeforeGreenPhase(int idJunction,int idPhase, double timeSta, double yellowBeforeGreen)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta: The time of simulation (current time) in seconds from midnight.
- yellowBeforeGreen: The new yellow time duration, from red to green state, of the phase.
Output¶
- 0: No error occurred.
- < 0: Error
Read Yellow Time Duration of a phase, from red to green state, of a junction¶
In C++ and Python¶
Explanation¶
Read the yellow time duration of a phase, from red to green state, in junction during the current control plan. The time is returned in the yellowBeforeGreen parameter.
Format¶
int ECIGetYellowTimeBeforeGreenPhase(int idJunction,int idPhase,double timeSta,double *yellowBeforeGreen)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta: The time of simulation (current time) in seconds from midnight.
- yellowBeforeGreen: The yellow time duration of the phase, from red to green state. This value is returned by the function.
Output¶
- 0: No error occurred.
- < 0: Error
Set Yellow Time Duration of a phase of a junction in a loaded control plan ¶
In C++ and Python¶
Explanation¶
Set the yellow time duration, from green to red state, of a phase in junction in a loaded control plan .
Format¶
int ECISetYellowTimePhaseofJunction(int elemControl, int idJunction,int idPhase, double yellow)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta represent time of simulation (current time) in seconds from midnight.
- yellow represents the new yellow time duration, from green to red state, of the phase.
Output¶
- 0: No error occurred.
- < 0: Error
Read Yellow Time Duration of a phase of a junction in a loaded control plan ¶
In C++ and Python¶
Explanation¶
Read the yellow time duration, from green to red state, of a phase in junction in a control plan loaded. The time is returned in the yellow parameter.
Format¶
int ECIGetYellowTimePhaseofJunction(int elemControl, int idJunction,int idPhase,double timeSta,double *yellow)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total ECIGetNumberPhases (idJunction)]
- timeSta represent the time of simulation (current time) in seconds from midnight.
- yellow represents the yellow time duration, from green to red state, of the phase. This value is returned by the function.
Output¶
- 0: No error occurred.
- < 0: Error
Check whether a Phase of a Junction is an Interphase or not in a loaded control plan >¶
In C++ and Python¶
Explanation¶
Check whether a phase in junction in a loaded control plan has been defined as interphase by the user or not.
Format¶
int ECIIsAnInterPhaseofJunction(int elemControl, int idJunction,int idPhase)
Parameters¶
- elemControl: the index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction represents a valid junction identifier.
- idPhase represents a valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases]
- timeSta represent the time of simulation (current time) in seconds from midnight.
Output¶
- ≥ 0: 1 means the phase is an interphase, 0 otherwise.
- < 0: Error
Check whether a phase of a junction is an interphase or not¶
In C++ and Python¶
Explanation¶
Check whether a phase in junction during the current control plan has been defined as interphase.
Format¶
int ECIIsAnInterPhase(int idJunction,int idPhase,double timeSta)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases]
- timeSta: The time of simulation (current time) in seconds from midnight.
Output¶
- ≥ 0: 1 means the phase is an interphase, 0 otherwise.
- < 0: Error
Read the number of Signal Groups assigned to a phase of a junction¶
In C++ and Python¶
Explanation¶
Read the number of signal groups assigned to a specific phase.
Format¶
int ECIGetNbSignalGroupsPhaseofJunction (int idJunction,int idPhase,double timeSta)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases]
- timeSta: The time of simulation (current time) in seconds from midnight.
Output¶
- ≥ 0: The number of signal groups assigned.
- < 0: Error
Read the Signal Group Identifier assigned to a phase of a junction ¶
In C++ and Python¶
Explanation¶
Read the signal group ID assigned to a specific phase.
Format¶
int ECIGetSignalGroupPhaseofJunction (int idJunction,int idPhase, int indexSG, double timeSta)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases]
- indexSG: A valid index of a signal group. This index is defined by the interval [0 ... ECIGetNbSignalGroupsPhaseofJunction-1*]
- timeSta: The time of simulation (current time) in seconds from midnight.
Output¶
- ≥ 0: The signal group id.
- < 0: Error
Assigns a new state of a Signal Group assigned to a phase of a junction ¶
In C++ and Python¶
Explanation¶
Assign a new state of a Signal Group assigned to a specific phase.
Format¶
int ECIChangeColorSignalGroupPhaseofJunction(int idJunction, int idPhase, int indexSG, int state, double timeSta);
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases]
- indexSG: A valid index of a signal group. This index must be contained in the interval [0 ... ECIGetNbSignalGroupsPhaseofJunction-1*]
- aState: The new state (0 means RED, 1 means GREEN, 2 means YELLOW, 3 means FLASHING GREEN AS GREEN, 4 means FLASHING RED AS RED, 5 means FLASHING YELLOW AS YELLOW, 6 means OFF, 7 means FLASHING YELLOW AS YIELD, 8 means YELLOW AS GREEN, and 9 means FLASHING RED AS STOP).
- timeSta: The time of simulation (current time) in seconds from midnight.
Output¶
- = 0: No error occurred
- < 0: Error
Read the Current Yellow Time of a junction in a control plan loaded¶
In C++ and Python¶
Explanation¶
Read the yellow time of a junction in a control plan loaded.
Format¶
int ECIGetYellowTimeofJunction(int elemControl, int ajunction)
Parameters¶
- elemControl: The index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction: A valid junction identifier.
Output¶
- ≥ 0: Current yellow time returned, expressed in seconds
- < 0: Error
Read the Current Yellow Time from red to green state of a junction in a control plan loaded ¶
In C++ and Python¶
Explanation¶
Read the yellow time, from green to red state, of a junction in a control plan loaded.
Format¶
int ECIGetYellowTimeBeforeGreenofJunction(int elemControl, int ajunction)
Parameters¶
- elemControl: The index of the control plan for which number of rings is being retrieved, within the range 0 ≤ elemControl < ECIGetNumberofControls () –1
- idJunction: A valid junction identifier.
Output¶
- ≥ 0: Current yellow time, from green to red state, returned, expressed in seconds
- < 0: Error
Read the Current Yellow Time of a junction¶
In C++ and Python¶
Explanation¶
Read the yellow time, from green to red state, of a junction in the current control, even when the junction has disabled the fixed control plan.
Format¶
int ECIGetYellowTime(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- ≥ 0: Current yellow time, from green to red state, returned, expressed in seconds
- < 0: Error
Read the Current Yellow Time from red to green state of a junction¶
In C++ and Python¶
Explanation¶
Read the yellow time, from red to green state, of a junction in the current control, even when the junction has disabled the fixed control plan.
Format¶
int ECIGetYellowTimeBeforeGreen(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- ≥ 0: Current yellow time, from red to green state, returned, expressed in seconds
- < 0: Error
Read the Current Offset of a junction¶
In C++ and Python¶
Explanation¶
Read the offset of a junction in the current control, even when the junction has disabled the fixed control plan.
Format¶
int ECIGetOffset(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- ≥ 0: Current offset returned, expressed in seconds
- < 0: Error
Read the Current Phase of a junction¶
In C++ and Python¶
Explanation¶
Read the current phase of a junction, even when the junction has disabled the fixed control plan. For actuated junctions with more than one ring it is recommended to use the ECIGetCurrentPhaseInRing function.
Format¶
int ECIGetCurrentPhase(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- > 0: Current phase returned. For actuated junctions with more than one ring it will return a N-digit number where N is the number of rings. The first digit will be the active phase for ring 1, the second one will be the active phase for ring 2 and the last digit will be the active phase for ring N. All numbers will be from 1 to number of phases in the ring.
- < 0: Error
Read the Current Phase of a junction in a ring¶
In C++ and Python¶
Explanation¶
Read the current phase of a junction in a ring, even when the junction has disabled the fixed control plan.
Format¶
int ECIGetCurrentPhaseInRing(int idJunction, int ring)
Parameters¶
- idJunction: The junction identifier.
- ring: The ring index, between 0 and ECIGetNbRingsJunction()-1
Output¶
- >0: Current phase returned, from 1 to the number of phases in the ring.
- < 0: Error
Read the Starting Time of the Current Phase of a junction¶
In C++ and Python¶
Explanation¶
Get the time when the current phase of a junction has been activated, even when the junction has been disabled in the fixed control plan. This time is relative to time - the beginning of the simulation. For actuated junctions with more than one ring use the ECIGetStartingTimePhaseInRing function.
Format¶
double ECIGetStartingTimePhase (int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- > 0: Starting Time (relative to Time) returned
- < 0: Error
Read the Starting Time of the Current Phase of a ring in a junction¶
In C++ and Python¶
Explanation¶
Get the time when the current phase of a ring in a junction, even when the junction has been disabled in the fixed control plan, has been activated. This time is relative to Time (that is to say the beginning of the simulation).
Format¶
double ECIGetStartingTimePhaseInRing(int idJunction, int ring)
Parameters¶
- idJunction: A valid junction identifier.
- ring:A number between 0 and ECIGetNbRingsJunction()-1
Output¶
- ≥ 0: Starting Time (relative to Time) returned
- < 0: Error
Read the current time in cycle in a ring of a junction¶
In C++ and Python¶
Explanation¶
Read the current time in cycle in a ring of a junction.
Format¶
double ECIGetCurrentTimeInCycle(int idJunction, int ring)
Parameters¶
- idJunction represents a valid junction identifier
- ring is a number between 0 and ECIGetNbRingsJunction()-1
Output¶
- ≥ 0: Current time in cycle returned
- < 0: Error
Disable the control plan of a junction¶
In C++ and Python¶
Explanation¶
Disables the current control plan of a junction, so the phase changing is completely controlled by the Aimsun Next API Module. Only works in External and Actuated control plans.
Format¶
int ECIDisableEvents(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- = 0: No error occurred
- < 0: Error
Enable the control plan of a junction¶
In C++ and Python¶
Explanation¶
Enables the current control plan of a junction, so the phase changes are completely controlled by Aimsun Next, taking into account the duration of each phase. Only works in External and Actuated control plans.
Format¶
int ECIEnableEvents(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- = 0: No error occurred
- < 0: Error
Enable the control plan of a junction activating a phase¶
In C++ and Python¶
Explanation¶
Enables the current control plan of a junction starting by the given phase. Only works in External and Actuated control plans.
Format¶
int ECIEnableEventsActivatingPhase(int idJunction, int idPhaseToActivateNow, double expiredTime, double currentTime)
Parameters¶
- idJunction: A valid junction identifier.
- idPhaseToActivateNow: The phase to start the control plan.
- expiredTime: The seconds from the beginning of the phase. Note that it cannot be greater than the idPhaseToActivateNow duration, otherwise it will skip idPhaseToActivateNow.
- currentTime: The current simulation time.
Output¶
- = 0: No error occurred
- < 0: Error
Check if a junction's control events are enabled.¶
In C++ and Python¶
Explanation¶
Checks if the current control plan of a junction is enabled, i.e. the phase changes in the junction are internally controlled by Aimsun Next.
Format¶
int ECIIsEventsEnabled(int idJunction)
Parameters¶
- idJunction: A valid junction identifier.
Output¶
- = 1: the junction's control events are enabled.
- = 0: the junction's control events are disabled.
- < 0: Error.
Direct Change of Phase¶
In C++ and Python¶
Explanation¶
Changes to idPhase in junction identified by idJunction. If the events are enabled, Aimsun Next programs the next phase change, taking into account the current duration of idPhase.
Format¶
int ECIChangeDirectPhase(int idJunction, int idPhase, double timeSta, double time, double cycle, double expiredTime)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
- timeSta: The time of simulation (current time) in seconds from midnight.
- time: A relative time of simulation in seconds.
- cycle: The duration of each simulation step in seconds.
- expiredTime: The seconds from the beginning of the phase. Note that it cannot be greater than the idPhase duration, otherwise it will skip idPhase.
Output¶
- = 0: No error occurred.
- < 0: Error.
Direct Change of Phase with Transition¶
In C++ and Python¶
Explanation¶
Changes to idPhase in junction identified by idJunction, calculating automatically the transition from the current phase to idPhase. The transition is calculated using the following method:
if the current phase CP is not an interphase
if CP has an interphase I defined as next phase
Calculate the transition from CP to idPhase (setting green all signal groups active in both phases)
Activate the interphase I with the duration defined (with the signal group states calculated)
After the duration of interphase I, activate phase idPhase
else
Activate directly phase idPhase (without transition)
endif
else
Activate directly phase idPhase (without transition)
endif
If the events are enabled, Aimsun Next programs the next phase change, taking into account the current duration of each phase. Otherwise the next phase change has to be done by the Aimsun Next API Module. IMPORTANT: this function requires a phase to be active, that means the transition will be calculated incorrectly when the state of signal group has been defined calling the function ECIChangeSignalGroupState, because this call leads to loss of the "current" phase.
Format¶
int ECIChangeDirectPhaseWithInterphaseTransition (int idJunction, int idPhase, double timeSta, double time, double cycle)
Parameters¶
- idJunction: A valid junction identifier.
- *idPhase&: A valid phase identifier. This identifier is defined by the interval [1 ... ECIGetNumberPhases (idJunction)]
- timeSta: The time of simulation (current time) in seconds from midnight.
- time: A relative time of simulation in seconds.
- cycle: The duration of each simulation step in seconds.
Output¶
- = 0: No error occurred.
- < 0: Error
Change the Current Duration of Phase¶
In C++ and Python¶
Explanation¶
Changes the duration of idPhase in the junction identified by idJunction in the current control plan. This change only applies when this junction has enabled the events.
Format¶
int ECIChangeTimingPhase(int idJunction, int idPhase, double newTime, double timeSta)
Parameters¶
- idJunction: A valid junction identifier.
- idPhase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases] (that is known using the function ECIGetNumberPhases (idJunction))
- newTime: Represents new duration of idPhase, in seconds.
- timeSta: The time of simulation (current time) in seconds from midnight.
Output¶
- = 0: No error occurred.
- < 0: Error
Directly change the State of a Signal Group¶
In C++ and Python¶
Explanation¶
Changes the state of signal group idSigGr in junction identified by idJunction. The events have to be disabled.
Format¶
int ECIChangeSignalGroupState(int idJunction, int idSigGr, int aState, double timeSta, double time, double cycle)
int ECIChangeSignalGroupStatebyName(int idJunction, const unsigned short *nameSignalGroup, int aState, double timeSta, double time, double cycle);
Parameters¶
- idJunction: A valid junction identifier.
- idSigGr: A valid Signal Group identifier. This identifier is defined by the interval [1 ... Total Number of Signal Groups in the junction].
- aState: The new state (0 means RED, 1 means GREEN, 2 means YELLOW, 3 means FLASHING GREEN AS GREEN, 4 means FLASHING RED AS RED, 5 means FLASHING YELLOW AS YELLOW, 6 means OFF, 7 means FLASHING YELLOW AS GREEN, 8 means YELLOW AS GREEN, 9 means FLASHING RED AS GREEN and 10 means YELLOW BEFORE GREEN).
- time: The absolute time of simulation.
- timeSta: The time of simulation (current time) in seconds from midnight.
- cycle: The duration of each simulation step in seconds.
- nameSignalGroup: The logical name of the signal group.
Output¶
- = 0: No error occurred.
- < 0: Error
Directly change the State of a Signal Group to Yellow ¶
In C++ and Python¶
Explanation¶
Changes the state of signal group idSigGr in junction identified by idJunction. The events have to be disabled.
Format¶
int ECIChangeSignalGroupStateToYellow(int idJunction, int idSigGr, int aState, double timeSta, double time, double cycle, double greenTime)
Parameters¶
- idJunction: A valid junction identifier.
- idSigGr: A valid Signal Group identifier. This identifier is defined by the interval [1 ... Total Number of Signal Groups in the junction].
- aState: The new state (0 means RED, 1 means GREEN, 2 means YELLOW, 3 means FLASHING GREEN AS GREEN, 4 means FLASHING RED AS RED, 5 means FLASHING YELLOW AS YELLOW, 6 means OFF, 7 means FLASHING YELLOW AS GREEN, 8 means YELLOW AS GREEN, 9 means FLASHING RED AS GREEN and 10 means YELLOW BEFORE GREEN).
- time: The absolute time of simulation.
- timeSta: The time of simulation (current time) in seconds from midnight.
- cycle: represents the duration of each simulation step in seconds.
- nameSignalGroup: The logical name of the signal group.
- greenTime: The number of seconds from the moment the light changes to yellow that the vehicles will still cross the traffic light.
Output¶
- = 0: No error occurred.
- < 0: Error
Get Current State of a Signal Group ¶
In C++ and Python¶
Explanation¶
Get the state of signal group idSigGr in junction identified by idJunction.
Format¶
int ECIGetCurrentStateofSignalGroup(int ajunction, int asignalgroup)
int ECIGetCurrentStateofSignalGroupbyName(int idJunction, const unsigned short *nameSignalGroup);
Parameters¶
- idJunction: A valid junction identifier.
- idSigGr: A valid Signal Group identifier. This identifier is defined by the interval [1 ... Total Number of Signal Groups in the junction].
- nameSignalGroup: The logical name of the signal group.
Output¶
- ≥ 0: The current state. (0 means RED, 1 means GREEN, 2 means YELLOW, 3 means FLASHING GREEN AS GREEN, 4 means FLASHING RED AS RED, 5 means FLASHING YELLOW AS YELLOW, 6 means OFF, 7 means FLASHING YELLOW AS GREEN, 8 means YELLOW AS GREEN, 9 means FLASHING RED AS GREEN and 10 means YELLOW BEFORE GREEN)
- < 0: Error
Get the Actuated Gap Reduction and Passage Time Parameters¶
In C++ and Python¶
Explanation¶
Get the actuated passage time parameters.
Format¶
int ECIGetActuatedParamsPassageTime(int elemControl, int ajunction, int aidphase, double *apassageTime, double *atimeBeforeReduce, double *atimeToReduce, double *aminimumGap);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
Output¶
- > 0: apassagetTime, atimeBeforeReduce, atimeToReduce and aminimumGap contain the related values
- < 0: Error
Set the Actuated Gap Reduction and Passage Time Parameters¶
In C++ and Python¶
Explanation¶
Set the actuated passage time parameters.
Format¶
int ECISetActuatedParamsPassageTime(int elemControl, int ajunction, int aidphase, double apassageTime, double atimeBeforeReduce, double atimeToReduce, double aminimumGap);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
- apassageTime: New passage time.
- atimeBeforeReduce: New time before reduce .
- atimeToReduce: New time to reduce.
- aminimumGap: New minimum gap.
Output¶
- ≥ 0: Success
- < 0: Error
Get the Actuated Minimum Green Time Parameters¶
In C++ and Python¶
Explanation¶
Get the actuated Minimum Green time parameters.
Format¶
int ECIGetActuatedParamsMinimumGreen(int elemControl, int ajunction, int aidphase, double *aMinDurationMinGreen, double *aMaxMinGreen, double *aSecActuation);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
Output¶
- ≥ 0: aMinDurationMinGreen, aMaxMinGreen and aSecActuation contain the related values
- < 0: Error
Set the Actuated Minimum Green Time Parameters¶
In C++ and Python¶
Explanation¶
Set the actuated Minimum Green Time parameters. If the minimum green time is set to 0 (aMinDurationMinGreen, aMaxMinGreen and aSecActuation equal to 0), the recall of this phase is changed to NoRecall (phase is activated only when there is call).
Format¶
int ECISetActuatedParamsMinimumGreen(int elemControl, int ajunction, int aidphase, double aMinDurationMinGreen, double aMaxMinGreen, double aSecActuation);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
- aMinDurationMinGreen: New minimum green time.
- aMaxMinGreen: New maximum initial green time.
- aSecActuation: New seconds actuation time.
Output¶
- ≥ 0: Success
- < 0: Error
Get the Actuated Maximum Green Time¶
In C++ and Python¶
Explanation¶
Get the actuated Maximum Green time.
Format¶
double ECIGetActuatedParamsMaxGreen(int elemControl, int ajunction, int aidphase);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
Output¶
- ≥ 0: Maximum Green Time
- < 0: Error
Set the Actuated Maximum Green Time¶
In C++ and Python¶
Explanation¶
Set the actuated Maximum Green Time. If the maximum green time is set to 0, this phase is skipped inside the cycle (it means changed to NoRecall and disable detection) and this phase could be activated only if it's defined as default.
Format¶
int ECISetActuatedParamsMaxGreen(int elemControl, int ajunction, int aidphase, double aMaxDuration);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
- aMaxDuration: New maximum green time.
Output¶
- ≥ 0: Success
- < 0: Error
Get the Actuated Force Off and Permissive Periods¶
In C++ and Python¶
Explanation¶
Get the actuated Force Off and permissive periods defined for a junction.
Format¶
int ECIGetActuatedParamsForceOFFPermissivePeriod(int elemControl, int ajunction, int aidphase, double *forceOFF, double *permissivePeriodFrom, double *permissivePeriodTo);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
- forceOFF: The force off defined for the phase. This value is returned by the function.
- permissivePeriodFrom: The permissive period from defined for the phase. This value is returned by the function.
- permissivePeriodTo: The permissive period to defined for the phase. This value is returned by the function.
Output¶
- ≥ 0: Maximum Green Time
- < 0: Error
Set the Actuated Force Off and Permissive Periods¶
In C++ and Python¶
Explanation¶
Set the actuated Force Off and permissive periods for a junction.
Format¶
int ECISetActuatedParamsForceOFFPermissivePeriod(int elemControl, int ajunction, int aidphase, double forceOFF, double permissivePeriodFrom, double permissivePeriodTo);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
- forceOFF: The force off defined for the phase.
- permissivePeriodFrom: The permissive period from defined for the phase.
- permissivePeriodTo: The permissive period to defined for the phase.
Output¶
- ≥ 0: Maximum Green Time
- < 0: Error
Get the Total Green Time of a Signal Group¶
In C++ only:¶
Explanation¶
Get the total time that a signal group will be green in the current control plan.
Format¶
int ECIGetSignalGroupGreenDuration(int idJunction, int signalPos, double timeSta );
Parameters¶
- idJunction: A valid junction identifier.
- signalPos: A valid signal group position in the junction between 1 and ECIGetNumberSignalGroups( idJunction ).
- timeSta: Is the current simulation time in seconds from midnight, used to find the control plan that is being executed.
Output¶
- ≥ 0: No Error. The total green duration
- < 0: Error
Get the Total Yellow Time of a Signal Group¶
In C++ only:¶
Explanation¶
Get the total time that a signal group will be yellow, from green to red state, in the current control plan.
Format¶
int ECIGetSignalGroupYellowDuration(int idJunction, int signalPos, double timeSta );
Parameters¶
- idJunction: A valid junction identifier.
- signalPos: A valid signal group position in the junction between 1 and ECIGetNumberSignalGroups( idJunction ).
- timeSta: Is the current simulation time in seconds from midnight, used to find the control plan that is being executed.
Output¶
- ≥ 0: No Error. The total yellow duration from green to red state.
- < 0: Error
Get the Total Red Time of a Signal Group¶
In C++ only:¶
Explanation¶
Get the total time that a signal group will be red in the current control plan.
Format¶
int ECIGetSignalGroupRedDuration(int idJunction, int signalPos, double timeSta );
Parameters¶
- idJunction: A valid junction identifier.
- signalPos: A valid signal group position in the junction between 1 and ECIGetNumberSignalGroups( idJunction ).
- timeSta: Is the current simulation time in seconds from midnight, used to find the control plan that is being executed.
Output¶
- ≥ 0: No Error. The total red duration
- < 0: Error
Get the Total Yellow Time, from red to green state, of a Signal Group¶
In C++ only:¶
Explanation¶
Get the total time that a signal group will be yellow, from red to green state, in the current control plan.
Format¶
int ECIGetSignalGroupYellowBeforeGreenDuration(int idJunction, int signalPos, double timeSta );
Parameters¶
- idJunction: A valid junction identifier.
- signalPos: A valid signal group position in the junction between 1 and ECIGetNumberSignalGroups( idJunction ).
- timeSta: Is the current simulation time in seconds from midnight, used to find the control plan that is being executed.
Output¶
- ≥ 0: No Error. The total yellow duration from red to green state.
- < 0: Error
Set an external call to an actuated phase¶
In C++ and Python¶
Explanation¶
Set an external call to an actuated phase for a junction. This call is only valid for one simulation step.
Format¶
int ECISetExternalCall(int elemControl, int ajunction, int aidphase);
Parameters¶
- elemControl: The index of the junction identifier to be read, within the range 0 ≤ elem < ECIGetNumberJunctions()–1.
- idJunction: A valid junction identifier.
- aidphase: A valid phase identifier. This identifier is defined by the interval [1 ... Total Number of phases].
Output¶
- ≥ 0: No Error.
- < 0: Error