PyANGKernel.GKControlJunction

class GKControlJunction

Inheritance diagram of PyANGKernel.GKControlJunction

Synopsis

Methods

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 GKControlJunction contains 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 time setCycle - then add some phases addPhase Then GKControlJunction the will be add to a GKControlPlan using the addControlJunction call.

class GKControlJunctionType

See setControlJunctionType

class OffsetReferencePoint
__init__()
addBarrier(seconds)
Parameters:

seconds – float

Adds a new barrier at the specified second

addBusPreemption(abusPreemption)
Parameters:

abusPreemptionGKBusPreemption

Adds a new preemption

addPhase(ph)
Parameters:

phGKControlPhase

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:

GKControlPhase

Creates a new phase and add it to this control junction.

getActuatedCycle(idRing)
Parameters:

idRing – int

Return type:

float

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:

phaseGKControlPhase

Return type:

int

Returns the barrier index of the phase

getBarriers()
Return type:

.list of float

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:

GKControlJunctionType

Gets the control type for the node. See setControlJunctionType

getControlPlan()
Return type:

GKControlPlan

The control plan that contains this control junction info

getCoordinatedPhase(idRing)
Parameters:

idRing – int

Return type:

GKControlPhase

Returns the coordinated phase of the ring idRing. If the ring does not have any coordinated phase then returns nullptr.

getCritical()
Return type:

bool

It’s a critical node?

getCycle()
Return type:

float

gets the cycle of for this node (in seconds).

getNbBarriers()
Return type:

int

Returns the number of barriers as used by the phases.

getNbPhasesRing(ring)
Parameters:

ring – int

Return type:

int

Return the number of phases that belongs to the specified ring.

getNbRings()
Return type:

int

Returns the number of rings as used by the phases.

getNewPhaseId()
Return type:

int

Returns an unused id for a new phase

getNextPhase(fromPhase[, allowInterphases=true])
Parameters:
Return type:

GKControlPhase

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.

getNode()
Return type:

GKNode

Gets the node

getNodeId()
Return type:

int

Gets the node id.

getNotUsedSignals()
Return type:

.list of GKControlPlanSignal

Returns the signals not used by this control junction.

getOffset()
Return type:

float

Node offset to implement green waves.

getOffsetReferencePoint()
Return type:

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

getPhaseById(id)
Parameters:

id – int

Return type:

GKControlPhase

Get the phase using its ID

getPhaseByPos(pos)
Parameters:

pos – int

Return type:

GKControlPhase

Get the phase at the position “pos” (from 0 to N-1)

getPhaseIndex(phase)
Parameters:

phaseGKControlPhase

Return type:

int

Returns the index position of the phase in its ring

getPhaseName(phase)
Parameters:

phaseGKControlPhase

Return type:

str

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:
Return type:

GKControlPhase

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.

getRedPercentageInYellowTime()
Return type:

int

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%.

getRedToGreenYellowTime()
Return type:

float

Gets the red to green yellow time for this node, common to all the phases and in seconds.

getRestInRed()
Return type:

bool

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 .

getSingleEntry()
Return type:

bool

Returns the Single Entry value

getStartsAt()
Return type:

float

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.

getYellowTime()
Return type:

float

Gets the yellow time, from green to red state, for this node, common to all the phases and in seconds.

isActuated()
Return type:

bool

isControlled()
Return type:

bool

isSpecified()
Return type:

bool

removeBarrier()

Removes the last barrier

removeBusPreemption(abusPreemption)
Parameters:

abusPreemptionGKBusPreemption

Removes the preemption

removePhase(ph)
Parameters:

phGKControlPhase

Removes a phase from this node. The object “ph” is not deleted just removed from the GKControlJunction object. The caller has the responsibility of deleting the object.

removePhases()

Removes all phases from this GKControlJunction object. The phases are deleted too.

setBarrierTime(idBarrier, seconds)
Parameters:
  • idBarrier – int

  • seconds – float

Sets the duration of the specified barrier

setControlJunctionType(type)
Parameters:

typeGKControlJunctionType

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:

aplanGKControlPlan

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).

setNode(node)
Parameters:

nodeGKNode

Sets the node. Called automatically by addControlJunction

setOffset(o)
Parameters:

o – float

Node offset to implement green waves.

setOffsetReferencePoint(referencePoint)
Parameters:

referencePointOffsetReferencePoint

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 GKControlJunction using their “<” operator (by ring and from time)