PyANGKernel.GKTrafficState

class GKTrafficState

Traffic demand based in entrance flows and turning proportions.

Details

A traffic state codes a Traffic Demand using two separate mechanisms: - Input flows: number of vehicles that enter in the network during the period in where this demand is used. These flows are specified by section. - Turn proportions: used by vehicles to trace their route. When a vehicle arrives to a node, in where it can take several sections, this percentage is used to decide the next section.

For each section on a traffic state the information can be stored aggregated or disaggregated by the input sections of the section from where values are stored. This means that section A can have the information aggregated and section B disaggregated on the same traffic state. This allow the user to add detailed information where it is relevant (or where the data is available).

Example: section C has two input sections (A and B) and two output sections (D and E):

                                 ____________________
SECTION A ----> |    SECTION C      |-----> SECTION D
                                | --  -- -- -- -- > |
SECTION B ----> |___________________|-----> SECTION E

<H2>Disaggregated Information</H2> When editing section C flow values (input flow, keep flow percentage) and turn percentages the input sections A and B can be used. In this case the values will be: - Flow: - Input and keep flow percentage from A - input and keep flow percentage from B - Turn: - Percentage from A through C to D - Percentage from A through C to E - Percentage from B through C to D - Percentage from B through C to E

This disaggregated information can be used to specify with great precision a traffic state. But it has two problems: - More data to enter - Data maybe is not available

<H2>Aggregated Information</H2> Having no data or no needed for a detailed description of a traffic state it is possible to enter a simplified version. In this case all the entrances are aggregated. Following the example the values to be edited will be: - Flow: - Input and keep flow percentage - Turn: - Percentage to D - Percentage to E

Inheritance diagram of PyANGKernel.GKTrafficState

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__()
addTurningPercentageForSectionToSectionComingFromSection(section, toSection, fromSection, turningItem)
Parameters:
calculateTurnPercentagesFromExitFlows()

Calculates the turn percentages for all the sections in the traffic state depending on the defined exit flows

clear()

Removes all the section information stored in this state.

clearUseInputTurnings()

Disable disaggregated information in all the sections.

clearUseInputTurnings(section)
Parameters:

sectionGKSection

Disable disaggregated information in all the sections.

getEntranceFlow(section, fromSection)
Parameters:
Return type:

float

Returns the entrance flow on “section”. If fromSection is not NULL then the flow is disaggregated by entrance and “fromSection” is used. If fromSection is NULL then the aggregated value is used. Note that -1 is returned if undefined.

getExitFlow(section, toSection, fromSection[, aggregateValue=false])
Parameters:
Return type:

float

Returns the exit flow that, in section “section”, uses turn to section “toSection”. When data is stored taking into account input turns (see useInputTurnings ) and fromSection is not NULL then the exit flow is disaggregated by entrance and “fromSection” is used. If input turns are not used or fromSection is NULL then the aggregated value is used. When fromSection is null, the boolean parameter is used to see if you want to use the disaggregated values to get the aggregated value when the aggregated one is not present. Note that -1 is returned if undefined.

getKeepFlowPercentage(section, fromSection)
Parameters:
Return type:

float

Returns the percentage of vehicles that exits the network on “section”. If fromSection is not NULL then the percentage is disaggregated by entrance and “fromSection” is used. If fromSection is NULL then the aggregated value is used. Note that -1 is returned if undefined.

getTurningPercentage(section, toSection, fromSection)
Parameters:
Return type:

float

Returns the percentage of vehicles that, in section “section”, takes a turn to section “toSection”. When data is stored taking into account input turns (see useInputTurnings ) and fromSection is not NULL then the turning percentage is disaggregated by entrance and “fromSection” is used. If input turns are not used or fromSection is NULL then the aggregated value is used. Note that -1 is returned if undefined.

isUseInputTurningDefined(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true if there is information about whether to use disaggregated information in “section”

removeTurningPercentageForSectionToSectionComingFromSection(section, sectionTo, sectionComing)
Parameters:
sectionRemoved(section)
Parameters:

sectionGKSection

A section has been removed, update the internal structures. Called due to a GKSectionDelCommand.

setEntranceFlow(section, fromSection, flow)
Parameters:

Sets the entrance flow on “section”. If fromSection is not NULL then the flow is disaggregated by entrance and “fromSection” is used.

setExitFlow(section, toSection, fromSection, value)
Parameters:

Sets the exit flow that, in section “section”, uses turn to section “toSection”. If fromSection is not NULL then the exit flow is disaggregated by entrance and “fromSection” is used. If fromSection is NULL then the aggregated value is used.

setKeepFlowPercentage(section, fromSection, flowPercentage)
Parameters:

Sets the percentage of vehicles that exits the network on “section”. If fromSection is not NULL then the percentage is disaggregated by entrance and “fromSection” is used. If fromSection is NULL then the aggregated value is used.

setTurningPercentage(section, toSection, fromSection, value)
Parameters:

Sets the percentage of vehicles that, in section “section”, takes a turn to section “toSection”. If fromSection is not NULL then the turning percentage is disaggregated by entrance and “fromSection” is used. If fromSection is NULL then the aggregated value is used.

setUseInputTurnings(section, useit)
Parameters:

If true disaggregated information in “section” is used, if false aggregated info is used.

use(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true is this section is used in this state (if the state has information associated with it).

useInputTurnings(section)
Parameters:

sectionGKSection

Return type:

bool

Enable or disable disaggregated information in “section”

usedAsMainSection(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true is this section is used in this state either as an entrance section or by having any turning information defined