com.route4me.sdk.examples.advancedconstraints.OptimizationUsingTerritoriesOrders Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of route4me-java-sdk Show documentation
Show all versions of route4me-java-sdk Show documentation
>This SDK makes it easier for you use the Route4Me API, which creates optimally sequenced driving routes for many drivers.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.route4me.sdk.examples.advancedconstraints;
import com.route4me.sdk.exception.APIException;
import com.route4me.sdk.services.routing.Address;
import com.route4me.sdk.services.routing.Constants.AlgorithmType;
import com.route4me.sdk.services.routing.Constants.DeviceType;
import com.route4me.sdk.services.routing.Constants.OptimizationState;
import com.route4me.sdk.services.routing.Constants.TravelMode;
import com.route4me.sdk.services.routing.DataObject;
import com.route4me.sdk.services.routing.OptimizationParameters;
import com.route4me.sdk.services.routing.Parameters;
import com.route4me.sdk.services.routing.RoutingManager;
import com.route4me.sdk.services.routing.advancedconstraints.AdvancedConstraints;
import com.route4me.sdk.services.territories.TerritoriesManager;
import com.route4me.sdk.services.territories.Territory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author juan
*/
public class OptimizationUsingTerritoriesOrders {
public static void main(String[] args) {
try {
String apiKey = System.getenv("R4M_API_KEY");
RoutingManager manager = new RoutingManager(apiKey, true);
OptimizationParameters optParameters = new OptimizationParameters();
//**********************************************************************
// TEST CASE: Optimization using Territories Orders
// 3 Territories
//**********************************************************************
TerritoriesManager territoriesManager = new TerritoriesManager(apiKey);
Parameters parameters = new Parameters();
parameters.setAlgorithmType(AlgorithmType.ADVANCED_CVRP_TW.getValue());
parameters.setStoreRoute(Boolean.FALSE);
parameters.setShareRoute(Boolean.FALSE);
parameters.setRouteTime((8 + 5) * 3600);
parameters.setRouteName("Single Depot, Multiple Driver - 3 Territories Order IDs");
parameters.setDeviceType(DeviceType.WEB.toString());
parameters.setTravelMode(TravelMode.DRIVING.toString());
optParameters.setParameters(parameters);
// Depot
Address depot = new Address("1604 PARKRIDGE PKWY, Louisville, KY, 40214", 38.141598, -85.793846);
List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy