PyANGKernel.GKTrafficDemandItem

class GKTrafficDemandItem

Inheritance diagram of PyANGKernel.GKTrafficDemandItem

Inherited by: GKTrafficState, GKODMatrix, GKCentroidVector

Synopsis

Methods

Virtual 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

A traffic demand item, either a OD matrix ( GKODMatrix ) or a traffic state ( GKTrafficState ).

It is valid for a vehicle type and a time interval (defined by an initial time and a duration).

It contains some informative attributes to classify the conditions and origin of this demand (Day, Season, Weather…)

__init__()
__init__(src)
Parameters:

srcGKTrafficDemandItem

Copy constructor

Warning

Only ‘methodologyData’ is actually duplicated. All any other data including ID and external objects are shared between the new object and the source one.

equivalent(ti)
Parameters:

tiGKTrafficDemandItem

Return type:

bool

Return true if the vehicle, from and duration are equals.

equivalent(uc, f, d)
Parameters:
Return type:

bool

Return true if the vehicle, from and duration are equals.

getDuration()
Return type:

GKTimeDuration

Demand item duration

getFrom()
Return type:

QTime

Demand item initial time

getModeChoiceClass()
Return type:

GKModeChoiceClass

Mode Choice Class (contains the availableModes, hence the vehicles)

getNameAutomatically(longName)
Parameters:

longName – bool

Return type:

str

Gets the name of this object automatically based on the vehicle type, the from and the duration. The string will be: - if longName is true: - if longName is false:

getProblemNet()
Return type:

GKProblemNet

Is a demand item for a subnetwork or for the whole network

getPurpose()
Return type:

GKTripPurpose

Get the trip purpose

getTotalTrips()
Return type:

float

Returns the total number of trips in this Demand Item. The unit for OD matrix ( GKODMatrix ) is vehicles and for traffic state ( GKTrafficState ) vehicles/hour.

getUserClass()
Return type:

GKUserClass

User class (contains the vehicle)

getVehicle()
Return type:

GKMobileAgent

Helper, equivalent to getUserClass() ->getVehicle()

setDuration(aduration)
Parameters:

adurationGKTimeDuration

Demand item duration

setFrom(afrom)
Parameters:

afromQTime

Demand item initial time

setInterval(afrom, aduration)
Parameters:

Demand item initial time and duration

setModeChoiceClass(aModeChoiceClass)
Parameters:

aModeChoiceClassGKModeChoiceClass

User class (contains the availableModes, hence the vehicles)

setProblemNet(apnet)
Parameters:

apnetGKProblemNet

Is a demand item for a subnetwork or for the whole network

setUserClass(userClass)
Parameters:

userClassGKUserClass

User class (contains the vehicle)

setVehicle(avehicle)
Parameters:

avehicleGKMobileAgent

Deprecated. It is equivalent to: myUserClass = createUserClass ( getModel() , avehicle, nullptr ); myUserClass->setVehicle(avehicle);

So it is safier to get the userClass first (or even create it by createUserClass ) and then set the vehicle; otherwise, it is actually creating userClasses without warning or modifying those user classes that you might not really want to change.