Documentation ¶
Index ¶
- Constants
- type BusName
- type BusStops
- func (b *BusStops) AddBusToSchedule(bus BusName, direction Direction, station StationName, dow DOW, ...)
- func (b *BusStops) AddBusToStation(name StationName, direction Direction, bus BusName)
- func (b *BusStops) AddStation(name StationName, direction Direction) string
- func (b *BusStops) AddStop(bus BusName, direction Direction, stop StationName)
- func (b *BusStops) AddTerminal(bus BusName, direction Direction, terminal StationName)
- func (b *BusStops) AddTerminals(lineName string, direction Direction, from string)
- func (b *BusStops) ForTerminals(lineName string, direction Direction, from string)
- func (b *BusStops) HasTerminals(bus BusName, direction Direction) bool
- type BussesAndLinks
- type BussesWithTerminalsAndStations
- type DOW
- type Direction
- type Graph
- type HoursAndMinute
- type LatLong
- type Path
- type Result
- type Solution
- type StationName
- type StationNameAndWeight
- type StationsAndBusses
- type Stop
- type StopQueue
- type TopoGraph
- type WeightKeys
Constants ¶
View Source
const ( NoDirection Direction = 0 Tour Direction = 1 Retour Direction = 2 Unknown DOW = 0 WeekDays DOW = 1 SaturdayAndSunday DOW = 2 Saturday DOW = 3 Sunday DOW = 4 )
View Source
const ( EarthRadius = 6371000.0 ToRadians = math.Pi / 180.0 )
View Source
const (
StationStr = "Staţia:"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusStops ¶
type BusStops struct { Busses map[BusName]map[Direction][]StationName // map of bus name, direction and station names (including terminals) Terminals map[BusName]map[Direction][]StationName // map of bus name, direction and terminal station names Stations map[StationName]map[Direction][]BusName // map of station name, direction and display name of the busses Schedules map[BusName]map[Direction]map[StationName]map[DOW][]HoursAndMinute // map of bus name, direction, station names, day of the week and slice of schedules // contains filtered or unexported fields }
func NewBusStopsKeeper ¶
func NewBusStopsKeeper() BusStops
func (*BusStops) AddBusToSchedule ¶
func (*BusStops) AddBusToStation ¶
func (b *BusStops) AddBusToStation(name StationName, direction Direction, bus BusName)
func (*BusStops) AddStation ¶
func (b *BusStops) AddStation(name StationName, direction Direction) string
func (*BusStops) AddStop ¶
func (b *BusStops) AddStop(bus BusName, direction Direction, stop StationName)
func (*BusStops) AddTerminal ¶
func (b *BusStops) AddTerminal(bus BusName, direction Direction, terminal StationName)
func (*BusStops) AddTerminals ¶
func (*BusStops) ForTerminals ¶
type BussesAndLinks ¶
type BussesAndLinks struct { Busses []BusName `json:"busses,omitempty"` Links []StationNameAndWeight `json:"links,omitempty"` }
type BussesWithTerminalsAndStations ¶
type BussesWithTerminalsAndStations struct { Terminals []StationName `json:"terminals,omitempty"` Stations map[StationName]map[DOW][]HoursAndMinute `json:"stations,omitempty"` }
type Graph ¶
type Graph struct { Nodes map[string]map[Direction]*Stop // contains filtered or unexported fields }
func (*Graph) GetShortestPath ¶
type HoursAndMinute ¶
func (*HoursAndMinute) MinutesBetween ¶
func (h *HoursAndMinute) MinutesBetween(h2 *HoursAndMinute) int
type LatLong ¶
type LatLong struct { Lat float64 // The field value must be a valid WGS 84 latitude. Lon float64 // The field value must be a valid WGS 84 longitude value from -180 to 180. }
func (*LatLong) DistanceToCoordinate ¶
type StationName ¶
type StationName = string
type StationNameAndWeight ¶
type StationNameAndWeight struct { Station StationName `json:"station"` Weight int `json:"weight"` }
type StationsAndBusses ¶
type StationsAndBusses struct { Stations map[StationName]map[Direction]*BussesAndLinks `json:"stations"` Busses map[BusName]map[Direction]*BussesWithTerminalsAndStations `json:"busses"` }
type TopoGraph ¶
type TopoGraph[key comparable] struct { // contains filtered or unexported fields }
func NewTopoGraph ¶
func NewTopoGraph[key comparable]() *TopoGraph[key]
func (*TopoGraph[key]) ContainsNode ¶
type WeightKeys ¶
Click to show internal directories.
Click to hide internal directories.