PyANGKernel.GKSimulationArea

class GKSimulationArea

Inheritance diagram of PyANGKernel.GKSimulationArea

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

Defines a sub-area of the network which will be simulated in micro mode, inside a Hybrid Meso-Micro experiment, or in meso mode, inside a Hybrid Macro-Meso experiment. As GKProblemNet , the object can specify either a polygon which embraces the sections and nodes to be micro-simulated or meso-simulated respectively, or either as a simple list of sections.

UnknownCommand: try merging with GKProblemNet , as they are really similar, right now

__init__()
addManualSection(section)
Parameters:

sectionGKSection

Adds a section (by id) to the list of manual sections

calculateGates(trafficDemand, scenario)
Parameters:

Calculate the entrance and exit gates for the area.

calculateGates(sortedNodesToCheck, sectionsToCheck, centroidsToCheck)
Parameters:
  • sortedNodesToCheck – .list of GKNode

  • sectionsToCheck – .list of GKSection

  • centroidsToCheck – .list of GKCentroid

Calculate the entrance gates (section and centroid) for the area with out scenario filter.

classifyObjectsByManualSections([layer=None])
Parameters:

layerGKLayer

Return type:

.QSetGKGeoObject

Filters the model by using the given section list. The objects are filtered out by using the following criteria: - sections in the list belongs to the simulation area - ending nodes of any section inside the simulation area also belongs to the it - any section ending on a node inside the simulation area also belongs to it

UnknownCommandlayer : if not NULL, then only the objects belonging to that layer will be returned.

classifyObjectsByPolygon([layer=None])
Parameters:

layerGKLayer

Return type:

.QSetGKGeoObject

Filters the geo model, using the polygon which defines the simulation area. The objects are filtered out by using the following criteria: - if a node is inside the area, then any section ending on that node belongs to it. - if a section completely fits into the area, then it also belongs to it.

UnknownCommandlayer : if not NULL, then only the objects belonging to that layer will be returned.

clearGatesInfo()

Delete all gates information

containsManualSection(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true if the section (by id) is in the list of manual sections

containsObject(obj)
Parameters:

objGKGeoObject

Return type:

bool

Returns true if the given object belongs to the simulation area, according to the current area parameters.

count()

Counts the number of sections and nodes on this simulation area (using GKSimulationArea::classifyObjects ). After counting, this information can be read using getNbSections and getNbNodes

getEntranceGates()
Return type:

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

Returns a map with all the sections that are considered entrance gates because they are in the borders of the simulation area. The key of the map is the section id and the data the section itself

getExitGates()
Return type:

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

Returns a map with all the sections that are considered exit gates because they are in the borders of the simulation area. The key of the map is the section id and the data the section itself

getInsideCentroidsEntranceGates()
Return type:

Dictionary with keys of type .GKCentroid and values of type int.

Returns a map with all the centroids from the original centroid configuration with entrance connections, that are located inside the simulation area and therefore produce additional entrance gates. The map contains, for each original centroid, a new list of objects that are connected to the centroid and also inside the simulation area. These objects will be a subset of all the original centroid connections. The original connections that are not included in the simulation area will not be present. The key of this second map is the section id and the data the section itself

getInsideCentroidsExitGates()
Return type:

Dictionary with keys of type .GKCentroid and values of type int.

Returns a map with all the centroids from the original centroid configuration with exit connections, that are located inside the sub-area and therefore produce additional exit gates. The map contains, for each original centroid, a new list of objects that are connected to the centroid and also inside the sub-area. These objects will be a subset of all the original centroid connections. The original connections that are not included in the sub-area will not be present. The key of this second map is the section id and the data the section itself

getManualSections()
Return type:

.list of GKSection

getNbAllNodes()
Return type:

int

Returns the number of nodes on this simulation area. A node is counted if it is totally or partially inside. Call count before calling this method.

getNbNodes()
Return type:

int

Returns the number of nodes on this simulation area with more than one turn. A node is counted if it is totally or partially inside. Call count before calling this method.

getNbSections()
Return type:

int

Returns the number of sections on this simulation area. A section is counted if it is totally or partially inside. Call count before calling this method.

getSectionsAndTurns(oSections, oTurnings)
Parameters:
  • oSections – .QSetGKSection

  • oTurnings – .QSetGKTurning

Hack get the sections and turns that are physically inside the area for stats purposes, maybe we should define a new class for area stats

removeManualSection(section)
Parameters:

sectionGKSection

Removed a section (by id) to the list of manual sections *

Warning

The specified section MUST be contained in the list of manual sections.

setManualSections(sections)
Parameters:

sections – .list of GKSection

The list of sections (by id) to use in this subnetwork.

useManualSections(value)
Parameters:

value – bool

True if we will consider a list of sections set by the user, false (the default) if we consider sections in the polygon.

usingManualSections()
Return type:

bool

True if we will consider a list of sections set by the user, false (the default) if we consider sections in the polygon.