PyANGKernel.GKPublicLineTimeTable

class GKPublicLineTimeTable

Inheritance diagram of PyANGKernel.GKPublicLineTimeTable

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

A timetable for a transit line.

A line has several timetables (for week-ends, for holidays, for work days…). A timetable holds several schedules, by time of the day ( GKPublicLineTimeTableSchedule ).

A timetable is created using the newObject call, filled with data and then added to the line:

timeTable = GKSystem.getSystem().newObject( "GKPublicLineTimeTable", model );
...
line.addTimeTable( timeTable )

The user will create a schedule using the createNewSchedule method, then will set any information on it (departures, stops time, initial time) and add it to this timetable ( addSchedule )

schedule = timeTable.createNewSchedule()
...
timeTable.addSchedule( schedule )

When setting the schedule, the user will create stop times either directly:

schedule.setStopTime( busStop, 0, 10.0, 2.0 )

or indirectly:

stopTime = GKPublicLineTimeTableScheduleStopTime()
stopTime.mean = 10.0
stopTime.deviation = 2.0
schedule.setStopTime( busStop, 0, stopTime )

And will also set the departure times:

departure = GKPublicLineTimeTableScheduleDeparture()
schedule.setDepartureType( GKPublicLineTimeTableSchedule.eInterval )
departure.setMeanTime( GKTimeDuration( 0, 5, 0 ) )
...
schedule.addDeparture( departure )
__init__()
addSchedule(aschedule)
Parameters:

ascheduleGKPublicLineTimeTableSchedule

Adds a new schedule to this timetable. The pointer is adopted.

checkSchedulesBusStops()
createNewSchedule()
Return type:

GKPublicLineTimeTableSchedule

Creates a new GKPublicLineTimeTableSchedule instance and returns it. This function doesn’t add the schedule to the timetable, so you must add it afterwards with the addSchedule function.

createNewScheduleWithTime(iTime, iVehicleID)
Parameters:
  • iTime – str

  • iVehicleID – int

getDuration()
Return type:

GKTimeDuration

getEndTime()
Return type:

QTime

getPublicLine()
Return type:

GKPublicLine

Returns the line for this timetable. Set by the line when the timetable is added to the line.

getSchedules()
Return type:

.list of GKPublicLineTimeTableSchedule

Returns all the schedules.

getStartTime()
Return type:

QTime

get the start time of the first schedule

getTotalNumberOfVehicles(iStart, iEnd)
Parameters:
Return type:

Dictionary with keys of type .const GKVehicle and values of type double.

Get total number of vehicles for a given time window

getUsedVehicles()
Return type:

.list of GKVehicle

Returns a list of the vehicles used in this transit timetable.

removeSchedule(aschedule)
Parameters:

ascheduleGKPublicLineTimeTableSchedule

Removes the schedule from the list of schedules of this timetable. The schedule itself is not deleted.

removeSchedules()

Removes all the schedules from the list of schedules of this timetable. The schedules themselves are not deleted.

setPublicLine(aline)
Parameters:

alineGKPublicLine

Sets the line for this timetable. Set by the line when the timetable is added to the line.

sortSchedules()

Sorts schedules by time.