Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void LoadData(String path) throws Exception {
- BufferedReader file = new BufferedReader(new FileReader(path));
- String separator[];
- String line = file.readLine();
- separator = line.split(" ");
- int i = 0;
- if (separator[i].equals("")) {
- i++;
- }
- int n = Integer.parseInt(separator[i]);
- int capacity = Integer.parseInt(separator[i + 1]);
- int maxRouteTime = Integer.parseInt(separator[i + 2]);
- int dropTime = Integer.parseInt(separator[i + 3]);
- vrp = new VehicleRoutingProblem(n, capacity, maxRouteTime, dropTime);
- double coord[][] = new double[vrp.getNumberOfCustomers() + 1][2];
- line = file.readLine();
- separator = line.split(" ");
- i = 0;
- if (separator[i].equals("")) {
- i++;
- }
- coord[0][0] = Integer.parseInt(separator[i]);
- coord[0][1] = Integer.parseInt(separator[i + 1]);
- vrp.addCustomerDemand(0, 0);
- for (int j = 1; j <= vrp.getNumberOfCustomers(); j++) {
- line = file.readLine();
- separator = line.split(" ");
- i = 0;
- if (separator[i].equals("")) {
- i++;
- }
- coord[j][0] = Integer.parseInt(separator[i]);
- coord[j][1] = Integer.parseInt(separator[i + 1]);
- vrp.addCustomerDemand(j, Integer.parseInt(separator[i + 2]));
- }
- fillMatrix(coord);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement