-
Notifications
You must be signed in to change notification settings - Fork 2
Single Driver Round Trip
Maciej Mionskowski edited this page Oct 28, 2016
·
2 revisions
import (
"github.com/route4me/route4me-go-sdk"
"github.com/route4me/route4me-go-sdk/routing"
)
func main() {
client := &route4me.NewClient("11111111111111111111111111111111")
service := &routing.Service{Client: client}
addresses := []*routing.Address{&routing.Address{AddressString: "754 5th Ave New York, NY 10019",
Alias: "Bergdorf Goodman",
IsDepot: true,
Latitude: 40.7636197,
Longitude: -73.9744388,
Time: 0},
&routing.Address{AddressString: "717 5th Ave New York, NY 10022",
Alias: "Giorgio Armani",
Latitude: 40.7669692,
Longitude: -73.9693864,
Time: 0},
&routing.Address{AddressString: "888 Madison Ave New York, NY 10014",
Alias: "Ralph Lauren Women's and Home",
Latitude: 40.7715154,
Longitude: -73.9669241,
Time: 0},
&routing.Address{AddressString: "1011 Madison Ave New York, NY 10075",
Alias: "Yigal Azrou'l",
Latitude: 40.7772129,
Longitude: -73.9669,
Time: 0},
&routing.Address{AddressString: "440 Columbus Ave New York, NY 10024",
Alias: "Frank Stella Clothier",
Latitude: 40.7808364,
Longitude: -73.9732729,
Time: 0},
&routing.Address{AddressString: "324 Columbus Ave #1 New York, NY 10023",
Alias: "Liana",
Latitude: 40.7803123,
Longitude: -73.9793079,
Time: 0},
&routing.Address{AddressString: "110 W End Ave New York, NY 10023",
Alias: "Toga Bike Shop",
Latitude: 40.7753077,
Longitude: -73.9861529,
Time: 0},
&routing.Address{AddressString: "555 W 57th St New York, NY 10019",
Alias: "BMW of Manhattan",
Latitude: 40.7718005,
Longitude: -73.9897716,
Time: 0},
&routing.Address{AddressString: "57 W 57th St New York, NY 10019",
Alias: "Verizon Wireless",
Latitude: 40.7558695,
Longitude: -73.9862019,
Time: 0},
}
routeParams := &routing.RouteParameters{
AlgorithmType: routing.TSP,
StoreRoute: false,
Name: "Single Driver Round Trip",
RouteDate: time.Now().Unix(),
RouteTime: 60 * 60 * 7,
RouteMaxDuration: 86400,
VehicleCapacity: 1,
VehicleMaxDistanceMI: 10000,
Optimize: routing.Distance,
DistanceUnit: routing.Miles,
DeviceType: routing.Web,
TravelMode: routing.Driving,
}
optParams := &routing.OptimizationParameters{
Addresses: addresses,
Parameters: routeParams,
}
_, err := service.RunOptimization(optParams)
}
- Activity
- Addressbook
- Routing
- Single Driver Route 10 Stops
- Single Driver Round Trip
- Single Depot Multiple Driver No Time Windows
- Single Depot Multiple Driver Time Windows
- Multiple Depot Multiple Driver
- Multiple Depot Multiple Driver With Time Windows
- Multiple Depot Multiple Driver With Time Windows (24 Stops)
- Tracking
- Geocoding
- Users
- Territories
- Orders
- Vehicles
- Telematics