PyANGKernel.GKTrafficStateItem

class GKTrafficStateItem

Information of a traffic state per section.

Details

This class holds the traffic state of a section. It is composed of: - entrance flow: number of vehicles that enters in a section during the period specified in the GKTrafficState - keep flow percentage: percentage of vehicles that exits the network in this section - turning percentage: percentage of vehicles that takes a turn, defined by the destination section. - exit flow: number of vehicles that exit a section from each of its turns.

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

__init__()
clearTurningPercentages()

Removes all the turn percentages defined

getAllTurningPercentages()
Return type:

Dictionary with keys of type .GKSection and values of type GKTrafficStateItemTurning.

Get all the turn percentages stored in this item.

getEntranceFlow()
Return type:

float

Returns the entrance flow on this section. Note that -1 is returned if undefined

getExitFlow(toSection)
Parameters:

toSectionGKSection

Return type:

float

Returns the exit flow using turn to section “toSection”. Note that -1 is returned if undefined

getKeepFlowPercentage()
Return type:

float

Returns the percentage of vehicles that exits the network in this section. Note that -1 is returned if undefined

getTotalExitFlow()
Return type:

float

Returns the total exit flow. Note that -1 is returned if there is not any exit flow defined

getTotalTurningPercentage()
Return type:

float

Returns the total percentage assigned to exits. It must be 100.0, anything else is an error. Note that -1 is returned if undefined

getTurningPercentage(toSection)
Parameters:

toSectionGKSection

Return type:

float

Returns the percentage of vehicles that takes a turn to section “toSection”

removeTurningPercentage(toSection)
Parameters:

toSectionGKSection

Removes the turning percentage defined to section “toSection”

sectionRemoved(section)
Parameters:

sectionGKSection

A section has been removed, update the internal structures. Called due to a GKSection del command.

setEntranceFlow(value)
Parameters:

value – float

Sets the entrance flow on this section

setExitFlow(toSection, value)
Parameters:

Sets the exit flow using turn to section “toSection”

setKeepFlowPercentage(value)
Parameters:

value – float

Sets the percentage of vehicles that exits the network in this section

setTurningPercentage(toSection, value)
Parameters:

Sets the percentage of vehicles that takes a turn to section “toSection”

usesSection(section)
Parameters:

sectionGKSection

Return type:

bool

Is this section used in the item?