private void start() throws Exception { Request request = createRequest(); VrpApi vrpApi = new VrpApi(); // enable debugging for sending and receiving requests // ApiClient client = new ApiClient().setDebugging(true); // vrpApi.setApiClient(client); String key = System.getProperty("graphhopper.key", ""); JobId jobId = vrpApi.postVrp(key, request); System.out.println(getClass() + ", jobId: " + jobId.getJobId()); SolutionApi solApi = new SolutionApi(); Response rsp; while (true) { rsp = solApi.getSolution(key, jobId.getJobId()); if (rsp.getStatus().equals(Response.StatusEnum.FINISHED)) { break; } Thread.sleep(200); } System.out.println(rsp); }
private void start() throws Exception { Request request = createRequest(); VrpApi vrpApi = new VrpApi(); // enable debugging for sending and receiving requests // ApiClient client = new ApiClient().setDebugging(true); // vrpApi.setApiClient(client); String key = System.getProperty("graphhopper.key", ""); JobId jobId = vrpApi.postVrp(key, request); System.out.println(getClass() + ", jobId: " + jobId.getJobId()); SolutionApi solApi = new SolutionApi(); Response rsp; while (true) { rsp = solApi.getSolution(key, jobId.getJobId()); if (rsp.getStatus().equals(Response.StatusEnum.FINISHED)) { break; } Thread.sleep(200); } System.out.println(rsp); }
private void start() throws Exception { Request request = createRequest(); VrpApi vrpApi = new VrpApi(); // enable debugging for sending and receiving requests // ApiClient client = new ApiClient().setDebugging(true); // vrpApi.setApiClient(client); String key = System.getProperty("graphhopper.key", ""); JobId jobId = vrpApi.postVrp(key, request); System.out.println(getClass() + ", jobId: " + jobId.getJobId()); SolutionApi solApi = new SolutionApi(); Response rsp; while (true) { rsp = solApi.getSolution(key, jobId.getJobId()); if (rsp.getStatus().equals(Response.StatusEnum.FINISHED)) { break; } Thread.sleep(200); } System.out.println(rsp); }
private void start() throws Exception { Request request = createRequest(); VrpApi vrpApi = new VrpApi(); // enable debugging for sending and receiving requests // ApiClient client = new ApiClient().setDebugging(true); // vrpApi.setApiClient(client); String key = System.getProperty("graphhopper.key", ""); JobId jobId = vrpApi.postVrp(key, request); System.out.println(getClass() + ", jobId: " + jobId.getJobId()); SolutionApi solApi = new SolutionApi(); Response rsp; while (true) { rsp = solApi.getSolution(key, jobId.getJobId()); if (rsp.getStatus().equals(Response.StatusEnum.FINISHED)) { break; } Thread.sleep(200); } System.out.println(rsp); }
private void start() throws Exception { Request request = createRequest(); VrpApi vrpApi = new VrpApi(); // enable debugging for sending and receiving requests // ApiClient client = new ApiClient().setDebugging(true); // vrpApi.setApiClient(client); String key = System.getProperty("graphhopper.key", ""); JobId jobId = vrpApi.postVrp(key, request); System.out.println(getClass() + ", jobId: " + jobId.getJobId()); SolutionApi solApi = new SolutionApi(); Response rsp; while (true) { rsp = solApi.getSolution(key, jobId.getJobId()); // System.out.println(rsp); // if(rsp.getStatus() == null) continue; if (rsp.getStatus().equals(Response.StatusEnum.FINISHED)) { break; } Thread.sleep(200); } System.out.println(rsp); }