PyANGKernel.GKControlJunction¶
- class GKControlJunction¶
-
Synopsis¶
Methods¶
def
__init__()def
addBarrier()def
addPhase()def
clearBarriers()def
createPhase()def
getBarriers()def
getControlPlan()def
getCritical()def
getCycle()def
getNbBarriers()def
getNbRings()def
getNewPhaseId()def
getNextPhase()def
getNode()def
getNodeId()def
getOffset()def
getPhaseById()def
getPhaseByPos()def
getPhaseIndex()def
getPhaseName()def
getPhases()def
getRestInRed()def
getSingleEntry()def
getStartsAt()def
getUsedSignals()def
getYellowTime()def
isActuated()def
isControlled()def
isSpecified()def
removeBarrier()def
removePhase()def
removePhases()def
setBarrierTime()def
setControlPlan()def
setCritical()def
setCycle()def
setNode()def
setOffset()def
setRestInRed()def
setSingleEntry()def
setStartsAt()def
setYellowTime()def
sortPhases()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
The
GKControlJunctioncontains the control plan data associated with one node for one control plan. The control plan is the owner of this data.It contains timing information for each phase (
GKControlPhase) and some data common to all the phases.Usually the data to be edited will be: - Set the control type
setControlJunctionType- Set the cycle timesetCycle- then add some phasesaddPhaseThenGKControlJunctionthe will be add to aGKControlPlanusing theaddControlJunctioncall.- class GKControlJunctionType¶
- class OffsetReferencePoint¶
- __init__()¶
- addBarrier(seconds)¶
- Parameters:
seconds – float
Adds a new barrier at the specified second
- addBusPreemption(abusPreemption)¶
- Parameters:
abusPreemption –
GKBusPreemption
Adds a new preemption
- addPhase(ph)¶
- Parameters:
ph –
GKControlPhase
Add a phase. The object “ph” is adopted.
- calcActuatedForceOff()¶
Calculates the default parameters (force-off and permissive period) when the control plan is actuated.
- clearBarriers()¶
Removes all barriers
- clearBusPreemption()¶
Remove all preemptions
- createPhase()¶
- Return type:
Creates a new phase and add it to this control junction.
Returns the real cycle when the control plan is actuated. This is the sum of maximum green of all phases belonging the ring.
- getBarrierIndex(phase)¶
- Parameters:
phase –
GKControlPhase- Return type:
Returns the barrier index of the phase
Returns a vector with as many positions as barriers. The info in the vector is the duration of each barrier.
- getBusPreemptionList()¶
- Return type:
.list of GKBusPreemption
Returns the preemption list
- getControlJunctionType()¶
- Return type:
Gets the control type for the node. See
setControlJunctionType- getControlPlan()¶
- Return type:
The control plan that contains this control junction info
- getCoordinatedPhase(idRing)¶
- Parameters:
idRing – int
- Return type:
Returns the coordinated phase of the ring idRing. If the ring does not have any coordinated phase then returns nullptr.
It’s a critical node?
gets the cycle of for this node (in seconds).
Returns the number of barriers as used by the phases.
Return the number of phases that belongs to the specified ring.
Returns the number of rings as used by the phases.
Returns an unused id for a new phase
- getNextPhase(fromPhase[, allowInterphases=true])¶
- Parameters:
fromPhase –
GKControlPhaseallowInterphases – bool
- Return type:
Returns the next phase in the same ring. If allowInterphases is true, it may return an interphase. * If allowInterphase is false, it will return the next non-interphase phase in the ring or nullptr if * no phases in the ring meet the condition.
Gets the node
Gets the node id.
- getNotUsedSignals()¶
- Return type:
.list of GKControlPlanSignal
Returns the signals not used by this control junction.
Node offset to implement green waves.
- getOffsetReferencePoint()¶
- Return type:
For actuated junctions with coordinated phases, the coordinated point can be the beginning or end of the first coordinated phase or the beginning of the last coordinated phase
- getPhaseById(id)¶
- Parameters:
id – int
- Return type:
Get the phase using its ID
- getPhaseByPos(pos)¶
- Parameters:
pos – int
- Return type:
Get the phase at the position “pos” (from 0 to N-1)
- getPhaseIndex(phase)¶
- Parameters:
phase –
GKControlPhase- Return type:
Returns the index position of the phase in its ring
- getPhaseName(phase)¶
- Parameters:
phase –
GKControlPhase- Return type:
Return a name for this phase based on its position. Usually from 1 to N from left to right and from the first to the last ring.
- getPhases()¶
- Return type:
.list of GKControlPhase
Returns all the phases.
- getPhasesForDelete()¶
- Return type:
.list of GKControlPhase
Returns all the phases in a non constant set to delete some of them.
- getPreviousPhase(fromPhase[, allowInterphases=true])¶
- Parameters:
fromPhase –
GKControlPhaseallowInterphases – bool
- Return type:
Returns the previous phase in the same ring. If allowInterphases is true, it may return an interphase. * If allowInterphase is false, it will return the previous non-interphase phase in the ring or nullptr if * no phases in the ring meet the condition.
What percentage of the yellow time, from green to red state, is used by the driver as red. 0 means that all the yellow time will be simulated as green. 100 means that all the yellow time will be simulated as red.
Note that, in any case, the simulator will display the traffic signal in yellow.
By default if 50%.
Gets the red to green yellow time for this node, common to all the phases and in seconds.
Returns the rest in red value
- getSignalsStartDuration()¶
- Return type:
.std.listGKControlPlanSignalStartDuration
Returns a list of GKControlPlanSignalStartDurations describing the signals used by this control junction along with their start and duration times for each occurrence of each signal. To change the values in the control junction, use
setPhasesFromSignals.Returns the Single Entry value
Gets the moment in time where the first phase begins (only valid for actuated CPs with a coordinated phase.
- getUsedSignals()¶
- Return type:
.QSetGKControlPlanSignal
Returns the signals not used by this control junction.
Gets the yellow time, from green to red state, for this node, common to all the phases and in seconds.
- removeBarrier()¶
Removes the last barrier
- removeBusPreemption(abusPreemption)¶
- Parameters:
abusPreemption –
GKBusPreemption
Removes the preemption
- removePhase(ph)¶
- Parameters:
ph –
GKControlPhase
Removes a phase from this node. The object “ph” is not deleted just removed from the
GKControlJunctionobject. The caller has the responsibility of deleting the object.- removePhases()¶
Removes all phases from this
GKControlJunctionobject. The phases are deleted too.- setBarrierTime(idBarrier, seconds)¶
- Parameters:
idBarrier – int
seconds – float
Sets the duration of the specified barrier
- setControlJunctionType(type)¶
- Parameters:
type –
GKControlJunctionType
Sets the control type for the node. It can be: -
eUnspecified: no data has been edited so the node will be uncontrolled. -eUncontrolled: the node has been marked as uncontrolled. -eFixedControl: fixed time control plan. -eExternal: control plan controlled by an external source (AAPI, VS-PLUS, UTOPIA, SCATS, SICE, Yunex UTC (with SCOOT), ETRA, …) -eActuated: control plan actuated following the NEMA standard rules.- setControlPlan(aplan)¶
- Parameters:
aplan –
GKControlPlan
The control plan that contains this control junction info. Called automatically by
GKControlPlan.- setCritical(c)¶
- Parameters:
c – bool
It’s a critical node?
- setCycle(c)¶
- Parameters:
c – float
sets the cycle of for this node (in seconds).
Sets the node. Called automatically by
addControlJunction- setOffset(o)¶
- Parameters:
o – float
Node offset to implement green waves.
- setOffsetReferencePoint(referencePoint)¶
- Parameters:
referencePoint –
OffsetReferencePoint
For actuated junctions with coordinated phases, the coordinated point can be the beginning or end of the first coordinated phase or the beginning of the last coordinated phase
- setPhasesFromSignals(signalsStartDuration)¶
- Parameters:
signalsStartDuration – .std.listGKControlPlanSignalStartDuration
Deletes the current phases of the control junction and creates new ones using the given signals and their start and duration times
- setRedPercentageInYellowTime(percentage)¶
- Parameters:
percentage – int
What percentage of the yellow time, from green to red state, is sused by the driver as red. 0 means that all the yellow time will be simulated as green. 100 means that all the yellow time will be simulated as red.
Note that, in any case, the simulator will display the traffic signal in yellow.
By default if 50%.
- setRedToGreenYellowTime(aYellowTime)¶
- Parameters:
aYellowTime – float
Sets the red to green yellow time for this node, common to all the phases and in seconds.
- setRestInRed(c)¶
- Parameters:
c – bool
Only for actuated control junctions. If there isn’t any new call, it turns the current phase to red
- setSingleEntry(aSingleEntry)¶
- Parameters:
aSingleEntry – bool
On Multiring junctions. The Single Entry parameter is a mode of operation in which a phase in one ring can be activated alone if there is no call in a non-conflicting phase on any other ring.
- setStartsAt(s)¶
- Parameters:
s – float
Sets the moment in time where the first phase begins (only valid for actuated CPs with a coordinated phase.
- setYellowTime(y)¶
- Parameters:
y – float
Sets the yellow time, from green to red state, for this node, common to all the phases and in seconds.
- sortPhases()¶
- Return type:
.list of GKControlPhase
Sort the phases in this
GKControlJunctionusing their “<” operator (by ring and from time)