Documentation ¶
Overview ¶
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
routed Copyright (C) 2020 Rotten Network This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- func CalcDistRaw(pA *Point, pB *Point) float64
- func NewBusRouter(dClient DistanceClient, Params Params) *busRouter
- func NewPath(constr func(c clusterer.Cluster)) clusterer.Cluster
- func NewPathClusterer(pathCriteria clusterer.Criteria, ...) *pathClusterer
- func NewStop(func(clusterer.Cluster)) clusterer.Cluster
- func NewStopClusterer(stopCriteria clusterer.Criteria, stopConstructor func(clusterer.Cluster)) *stopClusterer
- func PassengersToClusterables(p []*Passenger) []clusterer.Clusterable
- func RemoveFromSlice(position int, slice *[]clusterer.Clusterable)
- func SearchSlice(elem interface{}, slice []clusterer.Clusterable) int
- func StopsToClusterables(s []*Stop) []clusterer.Clusterable
- func StopsToClusters(s []*Stop) []clusterer.Cluster
- type DistanceClient
- type Params
- type Passenger
- type Path
- func (p *Path) AddPoint(point clusterer.Clusterable)
- func (p *Path) CalculateCenter()
- func (p *Path) CalculateCost() float64
- func (p *Path) GetCenter() interface{}
- func (p *Path) GetID() string
- func (p *Path) GetPoints() []clusterer.Clusterable
- func (p *Path) GetStops() []*Stop
- func (p *Path) LoadD2DStops(stops []*Stop)
- func (p *Path) RemovePoint(point clusterer.Clusterable)
- func (p *Path) RenderPath()
- func (p *Path) SetCenter(point interface{})
- type Point
- type Stop
- func (s *Stop) AddPoint(p clusterer.Clusterable)
- func (s *Stop) CalculateCenter()
- func (s *Stop) GetCenter() interface{}
- func (s *Stop) GetID() string
- func (s *Stop) GetLocation() interface{}
- func (s *Stop) GetParent() clusterer.Cluster
- func (s *Stop) GetPassengers() []*Passenger
- func (s *Stop) GetPoints() []clusterer.Clusterable
- func (s *Stop) RemovePoint(p clusterer.Clusterable)
- func (s *Stop) RenderPassengerPaths()
- func (s *Stop) SetCenter(point interface{})
- func (s *Stop) SetParent(path clusterer.Cluster)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBusRouter ¶
func NewBusRouter(dClient DistanceClient, Params Params) *busRouter
func NewPathClusterer ¶
func NewStopClusterer ¶
func PassengersToClusterables ¶
func PassengersToClusterables(p []*Passenger) []clusterer.Clusterable
STRUCTS TO INTERFACES
func RemoveFromSlice ¶
func RemoveFromSlice(position int, slice *[]clusterer.Clusterable)
func SearchSlice ¶
func SearchSlice(elem interface{}, slice []clusterer.Clusterable) int
func StopsToClusterables ¶
func StopsToClusterables(s []*Stop) []clusterer.Clusterable
Types ¶
type DistanceClient ¶
type Params ¶
type Passenger ¶
type Passenger struct { ID string `json:"id"` Location *Point `json:"location"` DistanceFromStop float32 `json:"distance_from_stop"` DurationToStop float32 `json:"duration_to_stop"` RouteToStop string `json:"route_to_stop"` Destination *Point `json:"Destination"` DClient DistanceClient // contains filtered or unexported fields }
type Path ¶
type Path struct { ID string `json:"id"` Center *Point `json:"center"` Stops []clusterer.Clusterable `json:"stops"` Capacity int `json:"capacity"` Routes string `json:"routes"` TotalDistance float32 `json:"total_distance"` TotalDuration float32 `json:"total_duration"` Destination *Point `json:"destination"` Origin *Point `json:"origins"` DClient DistanceClient }
func (*Path) AddPoint ¶
func (p *Path) AddPoint(point clusterer.Clusterable)
func (*Path) GetPoints ¶
func (p *Path) GetPoints() []clusterer.Clusterable
func (*Path) RemovePoint ¶
func (p *Path) RemovePoint(point clusterer.Clusterable)
type Point ¶
type Stop ¶
type Stop struct { ID string `json:"id"` Center *Point `json:"center"` Passengers []clusterer.Clusterable `json:"passengers"` D2D bool `json:"d2d"` Order int `json:"order"` // contains filtered or unexported fields }
func ClusterablesToStops ¶
func ClusterablesToStops(clusterables []clusterer.Clusterable) []*Stop
func (*Stop) AddPoint ¶
func (s *Stop) AddPoint(p clusterer.Clusterable)
func (*Stop) GetPoints ¶
func (s *Stop) GetPoints() []clusterer.Clusterable
func (*Stop) RemovePoint ¶
func (s *Stop) RemovePoint(p clusterer.Clusterable)