diff --git a/src/inport/ConversionUtil.java b/src/inport/ConversionUtil.java index 5ea02a7c99183ba85cbc02b72260f9e3f5af8311..8411f493017a4ba39e1db2456748ff5335f7c69d 100644 --- a/src/inport/ConversionUtil.java +++ b/src/inport/ConversionUtil.java @@ -275,7 +275,9 @@ public class ConversionUtil { private final ArrayList berths; private final Map, Integer> locationNumberById; - private final BiFunction getLocNById; + private int getLocNById(int id, boolean isMoored) { + return locationNumberById.get(new Pair<>(id, isMoored)); + } private final ArrayList movingObjects; private final Function mObjToN; @@ -303,8 +305,6 @@ public class ConversionUtil { locationNumberById.put(new Pair<>(berth.getId(), true), locationNumberById.size()); } - getLocNById = (Integer id, Boolean isMoored) -> locationNumberById.get(new Pair<>(id, isMoored)); - movingObjects = new ArrayList<>(); Map mObjNumberById = new TreeMap<>(); for (MovingObject obj : task.getShips()) { @@ -363,8 +363,8 @@ public class ConversionUtil { movingObjN.add(mObjToN.apply(op.getMover())); for (Integer n : movingObjN) { - arrivalOp .get(n).get(getLocNById.apply(op.getDestination().getId(), false)).add(i + 1); - departureOp.get(n).get(getLocNById.apply(op.getStartLocation().getId(), false)).add(i + 1); + arrivalOp .get(n).get(getLocNById(op.getDestination().getId(), false)).add(i + 1); + departureOp.get(n).get(getLocNById(op.getStartLocation().getId(), false)).add(i + 1); } } else if (operationTemplates.get(i) instanceof MooringTemplate) { MooringTemplate op = (MooringTemplate)operationTemplates.get(i); @@ -376,8 +376,8 @@ public class ConversionUtil { movingObjN.add(mObjToN.apply(op.getMoorer())); for (Integer n : movingObjN) { - arrivalOp .get(n).get(getLocNById.apply(op.getStartLocation().getId(), op.isDirect())).add(i + 1); - departureOp.get(n).get(getLocNById.apply(op.getStartLocation().getId(), !op.isDirect())).add(i + 1); + arrivalOp .get(n).get(getLocNById(op.getStartLocation().getId(), op.isDirect())).add(i + 1); + departureOp.get(n).get(getLocNById(op.getStartLocation().getId(), !op.isDirect())).add(i + 1); } } } @@ -390,7 +390,7 @@ public class ConversionUtil { private void initialLocations() throws IOException { ArrayList initialStates = integerArray(movingObjects.size(), 0); for (MovingObjectState state : task.getVesselInitialState()) { - initialStates.set(mObjToN.apply(state.getVessel()), getLocNById.apply(state.getLocation().getId(), false)); + initialStates.set(mObjToN.apply(state.getVessel()), getLocNById(state.getLocation().getId(), false)); } writeArray(writer, "initial_m_obj_loc", initialStates, (Integer p) -> p + 1); writer.write("\n"); @@ -446,7 +446,7 @@ public class ConversionUtil { private void finalLocations() throws IOException { ArrayList finalStates = integerArray(movingObjects.size(), -1); for (MovingObjectState state : task.getVesselEndState()) { - finalStates.set(mObjToN.apply(state.getVessel()), getLocNById.apply(state.getLocation().getId(), false)); + finalStates.set(mObjToN.apply(state.getVessel()), getLocNById(state.getLocation().getId(), false)); } writeArray(writer, "final_m_obj_loc", finalStates, (Integer p) -> p + 1); } @@ -467,21 +467,21 @@ public class ConversionUtil { if (operationTemplate instanceof MovingTemplate) { // Перемещение. MovingTemplate op = (MovingTemplate) operationTemplate; - addResource.accept(op.getMover(), getLocNById.apply(op.getStartLocation().getId(), false)); + addResource.accept(op.getMover(), getLocNById(op.getStartLocation().getId(), false)); for (MovingObject obj : op.getResources()) { - addResource.accept(obj, getLocNById.apply(op.getStartLocation().getId(), false)); + addResource.accept(obj, getLocNById(op.getStartLocation().getId(), false)); } } else if (operationTemplate instanceof MooringTemplate) { // Швартовка. MooringTemplate op = (MooringTemplate) operationTemplate; - addResource.accept(op.getMoorer(), getLocNById.apply(op.getStartLocation().getId(), !op.isDirect())); + addResource.accept(op.getMoorer(), getLocNById(op.getStartLocation().getId(), !op.isDirect())); for (MovingObject obj : op.getResources()) { - addResource.accept(obj, getLocNById.apply(op.getStartLocation().getId(), false)); + addResource.accept(obj, getLocNById(op.getStartLocation().getId(), false)); } } else if (operationTemplate instanceof LoadingTemplate) { // Погрузка. LoadingTemplate op = (LoadingTemplate) operationTemplate; - addResource.accept(op.getLoader(), getLocNById.apply(op.getStartLocation().getId(), op.getWithMooring())); + addResource.accept(op.getLoader(), getLocNById(op.getStartLocation().getId(), op.getWithMooring())); for (MovingObject obj : op.getResources()) { - addResource.accept(obj, getLocNById.apply(op.getStartLocation().getId(), false)); + addResource.accept(obj, getLocNById(op.getStartLocation().getId(), false)); } } } @@ -748,13 +748,12 @@ public class ConversionUtil { } if (t instanceof MovingTemplate) { MovingTemplate op = (MovingTemplate)t; - operationsDestination.add(getLocNById.apply(op.getDestination().getId(), false)); + operationsDestination.add(getLocNById(op.getDestination().getId(), false)); } else if (t instanceof MooringTemplate) { MooringTemplate op = (MooringTemplate)t; - operationsDestination.add(getLocNById.apply(op.getStartLocation().getId(), op.isDirect())); + operationsDestination.add(getLocNById(op.getStartLocation().getId(), op.isDirect())); } else { - // TODO аккуратно обработать погрузку. - operationsDestination.add(getLocNById.apply(t.getStartLocation().getId(), false)); + operationsDestination.add(getLocNById(t.getStartLocation().getId(), false)); } } @@ -764,6 +763,9 @@ public class ConversionUtil { } void portToMiniZinc_0() throws IOException { + if (task.isTypified()) { + throw new ParserException("Attempt to convert typified task as untyped."); + } try { writer = new FileWriter(fileName, false); @@ -799,6 +801,9 @@ public class ConversionUtil { } void portToMiniZinc_1() throws IOException { + if (task.isTypified()) { + throw new ParserException("Attempt to convert typified task as untyped."); + } try { writer = new FileWriter(fileName, false); @@ -832,6 +837,44 @@ public class ConversionUtil { } } } + + + /* С типизацией. */ + void portToMiniZinc_2() throws IOException { + if (!task.isTypified()) { + throw new ParserException("Attempt to convert untyped task as typified."); + } + try { + writer = new FileWriter(fileName, false); + + writer.write("n_intervals = " + n_intervals + ";\n"); + writer.write("n_operations = " + task.getTemplates().size() + ";\n"); + + writer.write("n_locations = " + locationNumberById.size() + ";\n"); + writer.write("n_moving_obj = " + movingObjects.size() + ";\n"); + writer.write("\n"); + + movingObjectLocationDefinition(); + initialLocations(); + weatherWindows(); + operationsContinuity(); + finalLocations(); + presenceOfResourcesInLocation(); + conflictingOperations(); + + writer.write("n_obj_with_storage = " + nObjWithStorage + ";\n"); + writer.write("n_cargo_types = " + cargoes.size() + ";\n"); + + maxStorageVolume(); + boundaryStorageStates(); + cargoFlows(); + cargoOperations(); + } finally { + if (writer != null) { + writer.close(); + } + } + } } static public void portToMiniZinc_0(TaskCase task, String fileName) throws IOException { @@ -839,9 +882,13 @@ public class ConversionUtil { taskData.portToMiniZinc_0(); } - static public void portToMiniZinc_1(TaskCase task, String fileName) throws IOException { - Task taskData = new Task(task, fileName); - taskData.portToMiniZinc_1(); + static public void portToMiniZinc_1(TaskCase task, String fileName) { + try { + Task taskData = new Task(task, fileName); + taskData.portToMiniZinc_1(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } } private static class OperationsComparator implements Comparator { @@ -850,7 +897,7 @@ public class ConversionUtil { } } - static public void resolveMiniZincResults(TaskCase task, String fileName) throws IOException, ParserException { + static public void resolveMiniZincResults(TaskCase task, String fileName) { ArrayList operations = null; Integer result = null; @@ -911,19 +958,25 @@ public class ConversionUtil { continue; } if (line.equals("=====UNSATISFIABLE=====")) { - throw new ParserException("No solution."); + result = -1; } break; } - if (operations == null) { - throw new ParserException("No \"op_status\" in input"); - } if (result == null) { throw new ParserException("No result in input"); } + if (operations == null) { + if (result == -1) { + operations = new ArrayList<>(); + } else { + throw new ParserException("No \"op_status\" in input"); + } + } operations.sort(new OperationsComparator()); task.setSolution(operations); task.setSolution_result(result); + } catch (IOException e) { + throw new UncheckedIOException(e); } } } diff --git a/src/inport/Main.java b/src/inport/Main.java index 915d413d22e9a8ffb721cf258cc8e10c30f2ca54..55bd4f364e761136fe4fce2280c8bcbd145534d1 100644 --- a/src/inport/Main.java +++ b/src/inport/Main.java @@ -2,19 +2,10 @@ package inport; import java.io.*; -public class Main { +import static inport.Testing.solveTask_1; +import static inport.Testing.test_1; - private static void removeDirectory(File dir) { - if (dir.isDirectory()) { - File[] files = dir.listFiles(); - if (files != null && files.length > 0) { - for (File aFile : files) { - removeDirectory(aFile); - } - } - } - dir.delete(); - } +public class Main { public static void main(String[] args) { if (args.length == 0) { @@ -26,55 +17,26 @@ public class Main { switch (type) { case "solve" : { String fileName = args[1]; - - File directory = new File("temp_data"); - if (!directory.exists()) { - directory.mkdir(); - } - - String tempDir = "temp_data/"; - String minizincData = tempDir + "minizinc_data.dzn"; - String solverResults = tempDir + "solver_results.txt"; - String constraints = tempDir + "constraints.mzn"; + long start = System.currentTimeMillis(); TaskCase task = new TaskCase(); try { - try (FileWriter res = new FileWriter(constraints)) { - BufferedReader reader = new BufferedReader(new InputStreamReader(Main.class.getResourceAsStream("/constraints/conversion_1.mzn"))); - String line; - while ((line = reader.readLine()) != null) { - res.write(line + "\n"); - } - } task.deserialize(fileName); - ConversionUtil.portToMiniZinc_1(task, minizincData); - - long start = System.currentTimeMillis(); - - ProcessBuilder pb = new ProcessBuilder("minizinc", - "--solver", "Chuffed", - constraints, minizincData, - "-o", solverResults); - Process process = pb.start(); - int exitCode = process.waitFor(); - assert exitCode == 0; + } catch (IOException e) { + System.out.println(e.getMessage()); + break; + } - long finish = System.currentTimeMillis(); + String error = solveTask_1(task); - System.out.println((finish - start) + " milliseconds"); + long finish = System.currentTimeMillis(); + System.out.println((finish - start) + " milliseconds"); - ConversionUtil.resolveMiniZincResults(task, solverResults); + if (!error.isEmpty()) { + System.out.println("Error : " + error); + } else { task.serialize(fileName); - } catch (IOException | InterruptedException ex) { - System.out.println(ex.getMessage()); - } catch (ParserException ex) { - if (ex.getMessage().equals("No solution.")) { - System.out.println(ex.getMessage()); - } else { - System.out.println("ParserException : " + ex.getMessage()); - } } - removeDirectory(directory); break; } case "to_MiniZinc_0" : { @@ -131,6 +93,9 @@ public class Main { } break; } + case "testing" : + test_1(); + break; default: System.out.println("Unknown type \"" + type + "\""); } diff --git a/src/inport/MovingTemplate.java b/src/inport/MovingTemplate.java index 434d5fe86e65829b0ba6a7a2f901a0aa866ef250..f90f76dcd022ad91a2b645fdb61f6cc5def9f115 100644 --- a/src/inport/MovingTemplate.java +++ b/src/inport/MovingTemplate.java @@ -13,7 +13,7 @@ import java.util.OptionalInt; public class MovingTemplate extends TowUsingTemplate { private MovingObject mover; - private OptionalInt moverType; + private OptionalInt moverType = OptionalInt.empty(); private Berth destination; diff --git a/src/inport/ParserException.java b/src/inport/ParserException.java index 45cd39ac3008a17325aedbd5c74ba18019d0ac97..87a8f369f9a9158bdc77001f06448f1c260bac8b 100644 --- a/src/inport/ParserException.java +++ b/src/inport/ParserException.java @@ -1,6 +1,6 @@ package inport; -public class ParserException extends Exception { +public class ParserException extends RuntimeException { ParserException(String mess) { super(mess); } diff --git a/src/inport/TaskCase.java b/src/inport/TaskCase.java index fd05e8f3dfae3625075bffc221a9aa1d9a32765f..04eb72b626c3756ddaaecb5b1fffba377618a78f 100644 --- a/src/inport/TaskCase.java +++ b/src/inport/TaskCase.java @@ -626,31 +626,34 @@ public class TaskCase { templates.add(mt); m_template.put(mt.getId(), mt); - } - break; + } + break; case Time_Windows: break; case Cargo_Flows: cargoFlows.add(new CargoFlow(strLine, m_storage, m_cargo)); break; case Initial_Vessel_State: vesselInitialState.add(fromString(strLine, m_berth, m_vessel)); - break; + break; case Initial_Storage_State: storageInitialState.add(new StorageState(strLine, m_storage, m_vessel, m_cargo)); break; case Final_Vessel_State: vesselEndState.add(fromString(strLine, m_berth, m_vessel)); - break; + break; case Final_Storage_State: storageEndState.add(new StorageState(strLine, m_storage, m_vessel, m_cargo)); - break; + break; case Task_Properties: { String[] rs = strLine.split(";"); planningInterval = Double.parseDouble(rs[0].trim()); criterionType = Integer.parseInt(rs[1].trim()); } - break; + break; case Solution: // Тут чтение операций если надо. Потом подумаем - break; + if (numInside == 1) { + solution_result = Double.parseDouble(strLine.trim()); + } + break; default: - break; + break; } } //Close the input stream diff --git a/src/inport/Testing.java b/src/inport/Testing.java new file mode 100644 index 0000000000000000000000000000000000000000..02784e82e6688fd9d961f64bc2a6be6fced77705 --- /dev/null +++ b/src/inport/Testing.java @@ -0,0 +1,120 @@ +package inport; + +import java.io.*; +import java.util.ArrayList; +import java.util.function.BiConsumer; +import java.util.stream.Collectors; + +public class Testing { + private static void removeDirectory(File dir) { + if (dir.isDirectory()) { + File[] files = dir.listFiles(); + if (files != null && files.length > 0) { + for (File aFile : files) { + removeDirectory(aFile); + } + } + } + dir.delete(); + } + + public static String solveTask_1(TaskCase task) { + return solveTask( + task, + "conversion_1.mzn", + ConversionUtil::portToMiniZinc_1, + ConversionUtil::resolveMiniZincResults); + } + + /* Возвращает описание ошибки, если ошибки не было, то пустую строку. */ + public static String solveTask(TaskCase task, + String constraintName, + BiConsumer converterToMinizincFormat, + BiConsumer interpreter) { + File directory = new File("temp_data"); + if (!directory.exists()) { + directory.mkdir(); + } + + String tempDir = "temp_data/"; + String minizincData = tempDir + "minizinc_data.dzn"; + String solverResults = tempDir + "solver_results.txt"; + String constraints = tempDir + "constraints.mzn"; + + try { + try (FileWriter res = new FileWriter(constraints)) { + BufferedReader reader = new BufferedReader(new InputStreamReader(Main.class.getResourceAsStream("/constraints/" + constraintName))); + String line; + while ((line = reader.readLine()) != null) { + res.write(line + "\n"); + } + } + converterToMinizincFormat.accept(task, minizincData); + + ProcessBuilder pb = new ProcessBuilder("minizinc", + "--solver", "Chuffed", + constraints, minizincData, + "-o", solverResults); + + Process process = pb.start(); + int exitCode = process.waitFor(); + assert exitCode == 0; + + BufferedReader br=new BufferedReader(new InputStreamReader(process.getInputStream())); + String output = br.lines().collect(Collectors.joining("\n")); + + if (output.trim().equals("=====UNSATISFIABLE=====")) { + task.setSolution(new ArrayList<>()); + task.setSolution_result(-1); + } else { + interpreter.accept(task, solverResults); + } + } catch (UncheckedIOException | IOException | InterruptedException | ParserException ex) { + return ex.getMessage(); + } finally { + removeDirectory(directory); + } + return ""; + } + + public static String testCase(String file) { + TaskCase task = new TaskCase(); + try { + task.deserialize(file); + } catch (IOException e) { + return "Error : " + e.getMessage(); + } + double expected_result = task.getSolution_result(); + String error = solveTask_1(task); + double result = task.getSolution_result(); + if (!error.isEmpty()) { + return "Error : " + error; + } + if (expected_result != result) { + return "WA : expected " + expected_result + ", found " + result; + } + return "OK"; + } + + public static void test_1() { + File testDir = new File("tests/without_typing/"); + System.out.println(testDir.toString() + " :"); + + int nPassedTests = 0; + + for (File file : testDir.listFiles()) { + System.out.println(" " + file.getName() + " : "); + + long start = System.currentTimeMillis(); + + String res = testCase(testDir.toString() + "/" + file.getName()); + + long finish = System.currentTimeMillis(); + System.out.println(" " + res + ", " + (finish - start) + " ms"); + if (res.equals("OK")) { + nPassedTests++; + } + } + System.out.println("Passed tests : " + nPassedTests + "/" + testDir.listFiles().length); + } +} diff --git a/tests/without_typing/Case2.ipp b/tests/without_typing/Case2.ipp new file mode 100644 index 0000000000000000000000000000000000000000..c04b3822a0bb53c85ae51eaf61478464dd2492e6 --- /dev/null +++ b/tests/without_typing/Case2.ipp @@ -0,0 +1,82 @@ +Cargoes +83;Груз1;0.0 +84;Груз2;0.0 +85;Груз3;0.0 +Berths +86;Рейд +87;Терминал1 +88;Терминал2 +Storages +89;Хранилище1;83;1000.0 +90;Хранилище2;84;1000.0 +91;Хранилище3;85;1000.0 +Bunkers +Tows +94;Буксир1;1000000 +95;Буксир2;1000000 +Loading Equipments +99;Плавучий кран 1 +100;Плавучий кран 2 +101;Плавучий кран 3 +Transport Ships +96;Судно1;1000000.0 + +Templates +10;mrn;[];96;88;[94,95];1.0 +13;mov;[];94;86;88;[];1.0 +16;mov;[];94;87;88;[];3.0 +15;mov;[];94;87;86;[];1.0 +11;mov;[];94;88;86;[];1.0 +12;mov;[];95;88;86;[];1.0 +17;mov;[];95;87;88;[];3.0 +14;mov;[];95;86;88;[];1.0 +8;mov;[];96;86;88;[94];2.0 +9;mov;[];96;86;88;[95];2.0 +2;loa;[];96;83;89;88;[99,100];20.0;U +4;loa;[];96;84;90;88;[99,101];10.0;U +5;loa;[];96;84;90;88;[100,101];10.0;U +7;loa;[];96;85;91;88;[101];10.0;U + +Cargo Flows +Initial Vessel State +96;86 +99;88 +100;88 +101;88 +94;87 +95;88 +Initial Storage State +83;89;0.0 +84;90;0.0 +85;91;0.0 +83;96;60.0 +84;96;60.0 +85;96;60.0 +Final Vessel State +Final Storage State +83;96;0.0 +84;96;0.0 +85;96;0.0 + +Task Properties +20.0;0 + +Solution +15.0 +15; R; 0.0; 1.0 +8; R; 1.0; 2.0 +12; R; 2.0; 1.0 +14; R; 3.0; 1.0 +2; R; 3.0; 2.0 +7; R; 3.0; 5.0 +4; R; 8.0; 1.0 +12; R; 9.0; 1.0 +2; R; 9.0; 1.0 +7; R; 9.0; 1.0 +11; R; 10.0; 1.0 +4; R; 10.0; 1.0 +13; R; 11.0; 1.0 +5; R; 11.0; 1.0 +14; R; 12.0; 1.0 +4; R; 12.0; 3.0 +11; R; 14.0; 1.0 diff --git a/tests/without_typing/InitDataTopaj4.ipp b/tests/without_typing/InitDataTopaj4.ipp new file mode 100644 index 0000000000000000000000000000000000000000..2807778e63691c529c0f088d82753dd37823b5e0 --- /dev/null +++ b/tests/without_typing/InitDataTopaj4.ipp @@ -0,0 +1,48 @@ +Cargoes +10; Груз1 +Berths +6; Рейд +7; Терминал1 +8; Терминал2 +Storages +9; Хранилище1; 10; 5000 +Transport Ships +12; Судно1; 1000 +13; Судно2; 1000 +Loading Equipments +Templates +4367; mov; []; 12; 6; 7; []; 1 +4374; mov; []; 13; 8; 7; []; 1 +4369; mov; []; 12; 6; 8; []; 1 +4372; mov; []; 13; 7; 8; []; 1 +4370; mov; []; 13; 6; 8; []; 1 +4371; mov; []; 12; 7; 8; []; 1 +4368; mov; []; 13; 6; 7; []; 1 +4373; mov; []; 12; 8; 7; []; 1 +4360; loa; []; 9; 10; 12; 7; []; 100; U +4364; loa; []; 9; 10; 13; 7; []; 100; U +4362; loa; []; 9; 10; 12; 8; []; 50; U +4366; loa; []; 9; 10; 13; 8; []; 50; U +Initial Vessel State +12; 6 +13; 6 +Final Vessel State +Initial Storage State +10; 12; 0 +10; 13; 0 +10; 9; 5000 +Final Storage State +10; 12; 1000 +10; 13; 1000 +Task Properties +50; 0 +Solution +15.0 +4367; R; 0.0; 1.0 +4370; R; 0.0; 1.0 +4360; R; 1.0; 7.0 +4366; R; 1.0; 6.0 +4374; R; 7.0; 1.0 +4371; R; 8.0; 1.0 +4364; R; 8.0; 7.0 +4362; R; 9.0; 6.0 diff --git a/tests/without_typing/TaskBK.ipp b/tests/without_typing/TaskBK.ipp new file mode 100644 index 0000000000000000000000000000000000000000..0ad3821128c061a72cb144a9a2b1c76c7d22ff14 --- /dev/null +++ b/tests/without_typing/TaskBK.ipp @@ -0,0 +1,43 @@ +Cargoes +0;LNG;1.0 +Berths +1;Raid +2;Pier 1 +3;Pier 2 +Storages +4;Storage 1;0;270.0 +Bunkers +Tows +6;Tow 1 +Loading Equipments +5;Плавучий кран +Transport Ships +7;Ship 1;2000.0 + +Templates +8;mov;[];7;1;2;[6];2.0 +9;mov;[];7;2;1;[6];2.0 +10;mov;[];6;3;1;[];2.0 +11;mov;[];6;2;1;[];2.0 +12;mov;[];6;2;3;[];1.0 +13;mov;[];5;3;2;[6];2.0 +14;loa;[];7;0;4;2;[5];20.0; U + +Cargo Flows +Initial Vessel State +7;1 +6;2 +5;3 +Initial Storage State +0;4;0.0 +0;7;100.0 +Final Vessel State +7;1 +Final Storage State +0;7;0.0 + +Task Properties +18.0;0 + +Solution +14.0 diff --git a/tests/without_typing/TaskT.ipp b/tests/without_typing/TaskT.ipp new file mode 100644 index 0000000000000000000000000000000000000000..c52d3b2f8a198aaf6699850d1139b4d115637431 --- /dev/null +++ b/tests/without_typing/TaskT.ipp @@ -0,0 +1,63 @@ +Cargoes +0;LNG;0.0 +Berths +1;Raid +2;Pier 1 +3;Pier 2 +Storages +4;Storage 1;0;10000.0 +Bunkers +Tows +Loading Equipments +Transport Ships +5;Ship 1;2000.0 +6;Ship 2;2000.0 + +Templates +7;mov;[];5;1;2;[];1.0 +8;mov;[];5;2;1;[];1.0 +9;mov;[];5;1;3;[];1.0 +10;mov;[];5;3;1;[];1.0 +11;mov;[];5;2;3;[];1.0 +12;mov;[];5;3;2;[];1.0 +13;mov;[];6;1;2;[];1.0 +14;mov;[];6;2;1;[];1.0 +15;mov;[];6;1;3;[];1.0 +16;mov;[];6;3;1;[];1.0 +17;mov;[];6;2;3;[];1.0 +18;mov;[];6;3;2;[];1.0 +19;loa;[];4;0;5;2;[];100.0; U +20;loa;[];4;0;5;3;[];50.0; U +21;loa;[];4;0;6;2;[];100.0; U +22;loa;[];4;0;6;3;[];50.0; U + +Cargo Flows +Initial Vessel State +5;1 +6;1 +Initial Storage State +0;5;0.0 +0;6;0.0 +0;4;10000.0 +Final Vessel State +5;1 +6;1 +Final Storage State +0;5;1000.0 +0;6;1000.0 + +Task Properties +24.0;0 + +Solution +16.0 +7; R; 1.0; 1.0 +10; R; 16.0; 1.0 +11; R; 9.0; 1.0 +14; R; 16.0; 1.0 +15; R; 1.0; 1.0 +18; R; 8.0; 1.0 +19; R; 2.0; 7.0 +20; R; 10.0; 6.0 +21; R; 9.0; 7.0 +22; R; 2.0; 6.0 diff --git a/tests/cargo_handling_and_moving.ipp b/tests/without_typing/cargo_handling_and_moving.ipp similarity index 98% rename from tests/cargo_handling_and_moving.ipp rename to tests/without_typing/cargo_handling_and_moving.ipp index f344fc2112ea5b1ba6fa0ea771586f97fe850c2d..b0868aa0a6a10d977ded970613fe00224fff942e 100644 --- a/tests/cargo_handling_and_moving.ipp +++ b/tests/without_typing/cargo_handling_and_moving.ipp @@ -45,7 +45,7 @@ Final Storage State 0; 11; 2.0 Task Properties -15.0;0 +20.0;0 Solution -12.0 +15.0 diff --git a/tests/shortest_path_with_weather.ipp b/tests/without_typing/shortest_path_with_weather.ipp similarity index 100% rename from tests/shortest_path_with_weather.ipp rename to tests/without_typing/shortest_path_with_weather.ipp diff --git a/tests/simple_cargo_flow.ipp b/tests/without_typing/simple_cargo_flow.ipp similarity index 100% rename from tests/simple_cargo_flow.ipp rename to tests/without_typing/simple_cargo_flow.ipp diff --git a/tests/simple_shortest_path.ipp b/tests/without_typing/simple_shortest_path.ipp similarity index 100% rename from tests/simple_shortest_path.ipp rename to tests/without_typing/simple_shortest_path.ipp diff --git a/tests/without_typing/test_0.ipp b/tests/without_typing/test_0.ipp new file mode 100644 index 0000000000000000000000000000000000000000..abfb3c1f9b8e94418e3b27fa8553c39dc26fc7cc --- /dev/null +++ b/tests/without_typing/test_0.ipp @@ -0,0 +1,41 @@ +Cargoes +83; Груз1 + +Berths +86; Рейд +88; Терминал2 + +Storages +89; Хранилище1; 83; 1000.0 + +Bunkers +Tows +Loading Equipments +Transport Ships +96; Судно1; 1000000.0 + +Templates +10;mrn;[]; 96; 88; []; 1.0 + +8;mov;[]; 96; 86; 88; []; 2.0 + +2;loa;[]; 96; 83; 89; 88; []; 20.0; M + +Cargo Flows +Initial Vessel State +96; 86 + +Initial Storage State +83; 89; 0.0 +83; 96; 60.0 + +Final Vessel State +Final Storage State +83; 89; 60.0 + +Task Properties +20.0;0 + +Solution +6.0 +