Documentation
¶
Index ¶
- Constants
- Variables
- func CreateClient() *http.Client
- func GetClient() *http.Client
- func SendMongoEvent(id string, collection string, mongoEventType MongoEventType)
- type ActionType
- type Base
- type Feature
- type FeatureCollection
- type Fleet
- type Geometry
- type MongoEvent
- type MongoEventType
- type Node
- type Order
- type OrderState
- type POI
- type Place
- type Position
- type PositionEvent
- type Route
- type RouteEvent
- type Truck
- type TruckActionEvent
- type Tsp
- type TspStep
Constants ¶
View Source
const ( MONGO_EVENT_CREATED = iota + 1 MONGO_EVENT_READ MONGO_EVENT_UPDATED MONGO_EVENT_DELETED )
View Source
const ( ORDER_PLANNED = iota + 1 ORDER_PROCESSING ORDER_STARTED ORDER_FINISHED )
View Source
const ( STOPPED = iota + 1 RUNNING PAUSED PREPARING STARTED FINISHED HOMEWARD OUTWARD RESTING )
View Source
const DIRECTED_GRAPH = false
directed graph uses oneway, causes problems
Variables ¶
View Source
var FLEET_SERVCICE_URL string
View Source
var MESSAGING_SERVCICE_URL string
View Source
var ROUTING_SERVCICE_URL string
View Source
var SEARCH_SERVCICE_URL string
Functions ¶
func CreateClient ¶
func SendMongoEvent ¶
func SendMongoEvent(id string, collection string, mongoEventType MongoEventType)
Types ¶
type ActionType ¶
type ActionType int
type FeatureCollection ¶
type FeatureCollection struct {
ID string `json:"_id,omitempty" bson:"_id,omitempty"`
Type string `json:"type" bson:"type"`
Features *[]Feature `json:"features" bson:"features"`
Name string `json:"name" bson:"name"`
}
func ReadAllPOIs ¶
func ReadAllPOIs() (*FeatureCollection, error)
type Fleet ¶
type Fleet struct {
ID primitive.ObjectID `json:"id" bson:"_id" db:"id"`
Trucks map[string]*Truck
Orders map[string]*Order
}
func GetFleetInstance ¶
func GetFleetInstance() *Fleet
func (Fleet) FindFreeTruck ¶
type Geometry ¶
type Geometry struct {
Type string `json:"type" bson:"type"`
Coordinates []float64 `json:"coordinates" bson:"coordinates"`
}
{"type":"Point","coordinates":[12.4045328,51.7979734]}
type MongoEvent ¶
type MongoEvent struct {
ID string `json:"id" bson:"_id"`
Collection string `json:"collection" bson:"collection"`
Type MongoEventType `json:"type" bson:"type"`
Time time.Time `json:"time" bson:"time"`
}
type MongoEventType ¶
type MongoEventType int
type Node ¶
type Node struct {
ID int64 `json:"id" bson:"_id" db:"id"`
Lon float64 `json:"lon" bson:"lon" db:"lon"`
Lat float64 `json:"lat" bson:"lat" db:"lat"`
}
func FindNearestNodeForPOI ¶
type Order ¶
type Order struct {
ID primitive.ObjectID `json:"id" bson:"_id" db:"id"`
Name string `json:"name" bson:"name" db:"name"`
OrderState OrderState `json:"state" bson:"state" db:"-"`
StartTime time.Time `json:"starttime" bson:"starttime" db:"starttime"`
EndTime time.Time `json:"endtime" bson:"endtime" db:"endtime"`
Tsp *Tsp `json:"-" bson:"-" db:"-"`
TruckID primitive.ObjectID `json:"truckid" bson:"_truckid" db:"truckid"`
}
func (*Order) AssignTruck ¶
func (*Order) RequestTSP ¶
type OrderState ¶
type OrderState int
type Place ¶
type Place struct {
ID primitive.ObjectID `json:"id" bson:"_id" db:"id"`
Name string `json:"name" bson:"name" db:"name"`
Geometry Geometry `json:"geom" bson:"geom" db:"geom"`
OsmId int64 `json:"osm_id" bson:"osm_id" db:"osm_id"`
Description string `json:"description" bson:"description" db:"description"`
}
type PositionEvent ¶
type RouteEvent ¶
type Truck ¶
type Truck struct {
ID primitive.ObjectID `json:"id" bson:"_id" db:"id"`
Name string `json:"name" bson:"name" db:"name"`
Position *Position `json:"pos" bson:"-" db:"-"`
Route *Route `json:"route" bson:"-" db:"-"`
Base *Base `json:"base" bson:"base" db:"base"`
ActionType ActionType `json:"action" bson:"action" db:"-"`
}
func (*Truck) SetActionType ¶
func (truck *Truck) SetActionType(ActionType ActionType)
func (*Truck) StartOrder ¶
type TruckActionEvent ¶
type TruckActionEvent struct {
ID primitive.ObjectID `json:"id" bson:"_id"`
Name string `json:"name" bson:"name"`
ActionType ActionType `json:"action" bson:"action"`
}
Click to show internal directories.
Click to hide internal directories.