PyANGKernel.GKScheduleDemandItem

class GKScheduleDemandItem

An entry (by time and user class (vehicle type+purpose)) for a GKTrafficDemand .

Details

The time information is coded in this object; the vehicle type and purpose, that is, the user class, are coded in the OD or the traffic state. Note that the time information is also in the traffic demand item. The information in this object is the one that will be used by the simulator.

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__()
__init__(src)
Parameters:

srcGKScheduleDemandItem

Copy constructor.

Warning

: It doesn’t duplicate internal pointers, so it can only be used to create temporary copies of the element.

fromString()
Return type:

str

Returns the from time as a string.

getDuration()
Return type:

int

Gets the duration in seconds.

getFactor()
Return type:

str

Returns the percentage of the traffic demand to be used. 100 means all the traffic, 50 half the traffic, 200 two times the traffic found in the demand item, etc.

getFactorValue([exp=None])
Parameters:

expGKGenericExperiment

Return type:

float

Returns the ‘factor’ value as a number. If the factor is defined through a variable, then the given experiment will be used to get the value. If the factor is not defined in the experiment, 100.0 will be returned.

getFrom()
Return type:

int

Gets the start time in seconds in reference to 00:00:00 or 00:00AM from the first day of the initial demand.

getTrafficDemandItem()
Return type:

GKTrafficDemandItem

Returns the traffic demand item (OD or traffic state) in this entry.

__lt__(item)
Parameters:

itemGKScheduleDemandItem

Return type:

bool

Returns true if this item’s ‘from time’ is earlier than the parameter’s from time.

__le__(item)
Parameters:

itemGKScheduleDemandItem

Return type:

bool

Returns true if this item’s ‘from time’ is earlier or equal to the parameter’s from time.

__eq__(item)
Parameters:

itemGKScheduleDemandItem

Return type:

bool

Compares by item, from time and duration.

__gt__(item)
Parameters:

itemGKScheduleDemandItem

Return type:

bool

Returns true if this item’s ‘from time’ is later than the parameter’s from time.

__ge__(item)
Parameters:

itemGKScheduleDemandItem

Return type:

bool

Returns true if this item’s ‘from time’ is later or equal to the parameter’s from time.

overlaps(item)
Parameters:

itemGKScheduleDemandItem

Return type:

bool

Returns true if this item overlaps with another item.

setDuration(seconds)
Parameters:

seconds – int

Sets the duration in seconds.

setFactor(afactor)
Parameters:

afactor – str

Sets the percentage of the traffic demand to be used. 100 means all the traffic, 50 half the traffic, 200 two times the traffic found in the demand item, etc.

setFrom(seconds)
Parameters:

seconds – int

Sets the start time in seconds in reference to 00:00:00 or 00:00AM from the first day of the initial demand.

setTrafficDemandItem(ademand)
Parameters:

ademandGKTrafficDemandItem

Sets the traffic demand item (OD or traffic state) in this entry.