Commit 0e9f1054 authored by Vladislav Kiselev's avatar Vladislav Kiselev

Новые тесты.

parent 7f3d6101
...@@ -117,6 +117,12 @@ public class Main { ...@@ -117,6 +117,12 @@ public class Main {
case "testing" : case "testing" :
test_2(); test_2();
break; break;
case "testing_2":
test_2_0();
break;
case "testing_exp":
test_2_exp();
break;
default: default:
System.out.println("Unknown type \"" + type + "\""); System.out.println("Unknown type \"" + type + "\"");
} }
......
...@@ -35,17 +35,34 @@ public class Testing { ...@@ -35,17 +35,34 @@ public class Testing {
ConversionUtil::resolveMiniZincResults); ConversionUtil::resolveMiniZincResults);
} }
public static String solveTask_2_0(TaskCase task) {
return solveTask(
task,
"conversion_2.0.mzn",
ConversionUtil::portToMiniZinc_2,
ConversionUtil::resolveMiniZincResults,
"temp_data_2");
}
public static String solveTask(TaskCase task,
String constraintName,
BiConsumer<TaskCase, String> converterToMinizincFormat,
BiConsumer<TaskCase, String> interpreter) {
return solveTask(task, constraintName, converterToMinizincFormat, interpreter, "temp_data");
}
/* Возвращает описание ошибки, если ошибки не было, то пустую строку. */ /* Возвращает описание ошибки, если ошибки не было, то пустую строку. */
public static String solveTask(TaskCase task, public static String solveTask(TaskCase task,
String constraintName, String constraintName,
BiConsumer<TaskCase, String> converterToMinizincFormat, BiConsumer<TaskCase, String> converterToMinizincFormat,
BiConsumer<TaskCase, String> interpreter) { BiConsumer<TaskCase, String> interpreter,
File directory = new File("temp_data"); String tempDir) {
File directory = new File(tempDir);
if (!directory.exists()) { if (!directory.exists()) {
directory.mkdir(); directory.mkdir();
} }
String tempDir = "temp_data/"; tempDir = tempDir + "/";
String minizincData = tempDir + "minizinc_data.dzn"; String minizincData = tempDir + "minizinc_data.dzn";
String solverResults = tempDir + "solver_results.txt"; String solverResults = tempDir + "solver_results.txt";
String constraints = tempDir + "constraints.mzn"; String constraints = tempDir + "constraints.mzn";
...@@ -141,4 +158,10 @@ public class Testing { ...@@ -141,4 +158,10 @@ public class Testing {
public static void test_2() { public static void test_2() {
testGroup("with_typing", Testing::solveTask_2); testGroup("with_typing", Testing::solveTask_2);
} }
public static void test_2_0() {
testGroup("with_typing", Testing::solveTask_2_0);
}
public static void test_2_exp() {
testGroup("experiments", Testing::solveTask_2);
}
} }
Typified
1
Cargoes
313; Груз1; 0.0
Berths
314; Рейд
315; Терминал1
316; Терминал2
Storages
317; Хранилище1; 313; 270.0
Vessel Types
1001; Тип судна1
1002; Тип буксира1
Bunkers
Tows
320; Буксир1; 1000000; 1002
Loading Equipment Types
1003; Кран
Loading Equipments
323; Плавучий кран; 1003
Transport Ships
321; Судно1; 1000000.0; 1001
Templates
8; mov; []; 1002; 314; 316; []; 1.0
9; mov; []; 1002; 315; 316; []; 3.0
5; mov; []; 1002; 315; 314; []; 1.0
7; mov; []; 1002; 316; 314; []; 1.0
11; mov; []; 1001; 314; 315; [1002]; 2.0
6; mov; []; 1001; 314; 316; [1002]; 2.0
10; mov; []; 1003; 316; 315; [1002]; 3.0
2; loa; []; 1001; 313; 317; 315; [1003]; 20.0; U
4; loa; []; 1001; 313; 317; 316; [1003]; 15.0; U
Cargo Flows
Initial Vessel State
321; 314
323; 316
320; 315
Initial Storage State
313; 317; 0.0
313; 321; 100.0
Final Vessel State
Final Storage State
313; 321; 0.0
Task Properties
18.0; 0
Solution
13.0
5; R; 0.0; 1.0 (320 [])
8; R; 1.0; 1.0 (320 [])
10; R; 2.0; 3.0 (323 [320])
5; R; 5.0; 1.0 (320 [])
11; R; 6.0; 2.0 (321 [320])
2; R; 8.0; 5.0 (321 [323])
Typified
1
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
Vessel Types
1001; Тип судна1
1002; Тип буксира1
Bunkers
Tows
94; Буксир1; 1000000; 1002
95; Буксир2; 1000000; 1002
Loading Equipment Types
1003; Тип крана 1
1004; Тип крана 1
1005; Тип крана 1
Loading Equipments
99; Плавучий кран 1; 1003
100; Плавучий кран 2; 1004
101; Плавучий кран 3; 1005
Transport Ships
96; Судно1; 1000000.0; 1001
Templates
10; mrn; []; 1001; 88; [1002,1002]; 1.0
13; mov; []; 1002; 86; 88; []; 1.0
16; mov; []; 1002; 87; 88; []; 3.0
15; mov; []; 1002; 87; 86; []; 1.0
11; mov; []; 1002; 88; 86; []; 1.0
8; mov; []; 1001; 86; 88; [1002]; 2.0
2; loa; []; 1001; 83; 89; 88; [1003, 1004]; 20.0; M
4; loa; []; 1001; 84; 90; 88; [1003, 1005]; 10.0; M
5; loa; []; 1001; 84; 90; 88; [1004, 1005]; 10.0; M
7; loa; []; 1001; 85; 91; 88; [1005]; 10.0; M
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
25.0; 0
Solution
16.0
15; R; 0.0; 1.0 (94 [])
8; R; 1.0; 2.0 (96 [94])
10; R; 3.0; 1.0 (96 [94, 95])
11; R; 3.0; 1.0 (95 [])
2; R; 4.0; 2.0 (96 [99, 100])
7; R; 4.0; 2.0 (96 [101])
5; R; 6.0; 1.0 (96 [100, 101])
13; R; 7.0; 1.0 (95 [])
7; R; 7.0; 2.0 (96 [101])
11; R; 8.0; 1.0 (94 [])
11; R; 8.0; 1.0 (95 [])
13; R; 9.0; 1.0 (95 [])
4; R; 9.0; 2.0 (96 [99, 101])
11; R; 11.0; 1.0 (95 [])
5; R; 11.0; 1.0 (96 [100, 101])
13; R; 12.0; 1.0 (94 [])
13; R; 12.0; 1.0 (95 [])
7; R; 12.0; 1.0 (96 [101])
11; R; 13.0; 1.0 (95 [])
5; R; 13.0; 1.0 (96 [100, 101])
13; R; 14.0; 1.0 (95 [])
4; R; 14.0; 1.0 (96 [99, 101])
11; R; 15.0; 1.0 (94 [])
11; R; 15.0; 1.0 (95 [])
2; R; 15.0; 1.0 (96 [99, 100])
7; R; 15.0; 1.0 (96 [101])
Typified
1
Cargoes
0; LNG; 0.0
Berths
1; Raid
2; Pier 1
3; Pier 2
Storages
4; Storage 1; 0; 270.0
Vessel Types
1001; Тип судна1
1002; Тип бункеровщика1
Bunkers
Tows
6; Tow 1; 1000000; 1002
Loading Equipment Types
1003; Кран
Loading Equipments
5; Плавучий кран; 1003
Transport Ships
7; Ship 1; 2000.0; 1001
Templates
8; mov; []; 1001; 1; 2; [1002]; 2.0
9; mov; []; 1001; 2; 1; [1002]; 2.0
10; mov; []; 1002; 3; 1; []; 2.0
11; mov; []; 1002; 2; 1; []; 2.0
12; mov; []; 1002; 2; 3; []; 1.0
13; mov; []; 1003; 3; 2; [1002]; 2.0
14; loa; []; 1001; 0; 4; 2; [1003]; 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
25.0; 0
Solution
14.0
11; R; 0.0; 2.0 (6 [])
8; R; 2.0; 2.0 (7 [6])
12; R; 4.0; 1.0 (6 [])
13; R; 5.0; 2.0 (5 [6])
14; R; 7.0; 5.0 (7 [5])
9; R; 12.0; 2.0 (7 [6])
Typified
1
Cargoes
0; LNG; 0.0
Berths
1; Raid
2; Pier 1
3; Pier 2
Storages
4; Storage 1; 0; 10000.0
Vessel Types
1001; Тип судна1
Bunkers
Tows
Loading Equipment Types
Loading Equipments
Transport Ships
5; Ship 1; 2000.0; 1001
6; Ship 2; 2000.0; 1001
Templates
7; mov; []; 1001; 1; 2; []; 1.0
8; mov; []; 1001; 2; 1; []; 1.0
9; mov; []; 1001; 1; 3; []; 1.0
10; mov; []; 1001; 3; 1; []; 1.0
11; mov; []; 1001; 2; 3; []; 1.0
12; mov; []; 1001; 3; 2; []; 1.0
19; loa; []; 4; 0; 1001; 2; []; 100.0; U
20; loa; []; 4; 0; 1001; 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; 0.0; 1.0 (6 [])
9; R; 0.0; 1.0 (5 [])
19; R; 1.0; 7.0 (6 [])
20; R; 1.0; 6.0 (5 [])
12; R; 7.0; 1.0 (5 [])
11; R; 8.0; 1.0 (6 [])
19; R; 8.0; 7.0 (5 [])
20; R; 9.0; 6.0 (6 [])
8; R; 15.0; 1.0 (5 [])
10; R; 15.0; 1.0 (6 [])
Typified
1
Cargoes
83; Груз1; 0.0
Berths
86; Рейд
Storages
89; Хранилище1; 83; 1000.0
Vessel Types
1001; Тип судна1
Bunkers
Tows
Loading Equipment Types
Loading Equipments
Transport Ships
101; Судно1; 1000000.0; 1001
102; Судно2; 1000000.0; 1001
Templates
1; mrn; []; 1001; 86; []; 1.0
2; unm; []; 1001; 86; []; 1.0
3; loa; []; 1001; 83; 89; 86; []; 10.0; M
Cargo Flows
Initial Vessel State
101; 86
102; 86
Initial Storage State
83; 89; 100.0
83; 101; 10.0
83; 102; 10.0
Final Vessel State
101; 86
102; 86
Final Storage State
83; 101; 0.0
83; 102; 0.0
Task Properties
10.0; 0
Solution
6.0
1; R; 0.0; 1.0 (101 [])
3; R; 1.0; 1.0 (101 [])
2; R; 2.0; 1.0 (101 [])
1; R; 3.0; 1.0 (102 [])
3; R; 4.0; 1.0 (102 [])
2; R; 5.0; 1.0 (102 [])
Typified
1
Cargoes
13; Груз1; 0.0
Berths
10; Рейд
16; Терминал1
Storages
18; Хранилище1; 13; 600.0
Vessel Types
11; Тип судна1
12; Тип буксира1
Bunkers
Tows
121; Буксир1; 1000000; 12
122; Буксир2; 1000000; 12
123; Буксир3; 1000000; 12
124; Буксир4; 1000000; 12
Loading Equipment Types
Loading Equipments
Transport Ships
111; Судно1; 1000000.0; 11
112; Судно2; 1000000.0; 11
Templates
61; mov; []; 11; 10; 16; [12,12]; 1.0
62; mov; []; 11; 16; 10; [12,12]; 1.0
63; mov; []; 12; 10; 16; []; 1.0
64; mov; []; 12; 16; 10; []; 1.0
65; mrn; []; 11; 16; [12,12,12]; 1.0
66; unm; []; 11; 16; [12,12,12]; 1.0
67; loa; []; 11; 13; 18; 16; []; 600.0; M
68; loa; []; 18; 13; 11; 16; []; 600.0; M
Cargo Flows
Initial Vessel State
111; 10
112; 10
121; 16
122; 16
123; 10
124; 10
Initial Storage State
13; 111; 1200.0
13; 112; 0.0
13; 18; 0.0
Final Vessel State
111; 10
112; 10
Final Storage State
13; 111; 0.0
13; 112; 1200.0
Task Properties
20.0; 0
Solution
15.0
61; R; 0.0; 1.0 (111 [123, 124])
64; R; 0.0; 1.0 (121 [])
64; R; 0.0; 1.0 (122 [])
61; R; 1.0; 1.0 (112 [121, 122])
65; R; 2.0; 1.0 (111 [121, 122, 124])
67; R; 3.0; 1.0 (111 [])
66; R; 4.0; 1.0 (111 [121, 123, 124])
65; R; 5.0; 1.0 (112 [121, 123, 124])
64; R; 6.0; 1.0 (123 [])
68; R; 6.0; 1.0 (112 [])
66; R; 7.0; 1.0 (112 [121, 122, 124])
65; R; 8.0; 1.0 (111 [121, 122, 124])
63; R; 9.0; 1.0 (123 [])
67; R; 9.0; 1.0 (111 [])
66; R; 10.0; 1.0 (111 [121, 122, 123])
65; R; 11.0; 1.0 (112 [121, 122, 124])
68; R; 12.0; 1.0 (112 [])
66; R; 13.0; 1.0 (112 [121, 122, 124])
62; R; 14.0; 1.0 (111 [121, 123])
62; R; 14.0; 1.0 (112 [122, 124])
Typified
1
Cargoes
22; Груз1; 0.0
Berths
17; Рейд
18; Терминал1
19; Терминал2
Storages
20; Хранилище1; 22; 1000.0
21; Хранилище2; 22; 1000.0
Vessel Types
1001; Тип судна1
1002; Тип буксира1
Bunkers
Tows
27; Буксир1; 1000000; 1002
Loading Equipment Types
Loading Equipments
Transport Ships
24; Судно1; 1000000.0; 1001
25; Судно2; 1000000.0; 1001
Templates
4010; mov; []; 1001; 19; 18; [1002]; 1.0
4; mov; []; 1001; 17; 19; []; 5.0
4006; mov; []; 1001; 17; 19; [1002]; 2.0
3; mov; []; 1001; 17; 18; []; 5.0
4005; mov; []; 1001; 17; 18; [1002]; 2.0
4009; mov; []; 1001; 18; 19; [1002]; 1.0
15; mov; []; 1002; 18; 17; []; 1.0
16; mov; []; 1002; 19; 17; []; 1.0
18; mov; []; 1002; 19; 18; []; 0.1
14; mov; []; 1002; 17; 19; []; 1.0
17; mov; []; 1002; 18; 19; []; 0.1
13; mov; []; 1002; 17; 18; []; 1.0
3998; loa; []; 20; 22; 1001; 18; []; 200.0; U
3996; loa; []; 1001; 22; 20; 18; []; 200.0; U
3994; loa; []; 21; 22; 1001; 19; []; 10.0; U
3992; loa; []; 1001; 22; 21; 19; []; 10.0; U
Cargo Flows
Initial Vessel State
24; 17
25; 17
27; 17
Initial Storage State
22; 24; 1000.0
22; 25; 0.0
22; 20; 200.0
22; 21; 800.0
Final Vessel State
Final Storage State
22; 24; 0.0
22; 25; 1000.0
Task Properties
30.0; 0
Solution
12.0
3; R; 0.0; 5.0 (25 [])
4005; R; 0.0; 2.0 (24 [27])
3996; R; 2.0; 3.0 (24 [])
4009; R; 5.0; 1.0 (24 [27])
3998; R; 5.0; 4.0 (25 [])
3992; R; 6.0; 1.0 (24 [])
3994; R; 7.0; 1.0 (24 [])
4010; R; 8.0; 1.0 (24 [27])
4009; R; 9.0; 1.0 (25 [27])
3996; R; 9.0; 2.0 (24 [])
4010; R; 10.0; 1.0 (25 [27])
4009; R; 11.0; 1.0 (24 [27])
3998; R; 11.0; 1.0 (25 [])
...@@ -23,19 +23,22 @@ Transport Ships ...@@ -23,19 +23,22 @@ Transport Ships
Templates Templates
10;mrn;[];96;88;[94,95];1.0 10;mrn;[];96;88;[94,95];1.0
13;mov;[];94;86;88;[];1.0 13;mov;[];94;86;88;[];1.0
16;mov;[];94;87;88;[];3.0 16;mov;[];94;87;88;[];3.0
15;mov;[];94;87;86;[];1.0 15;mov;[];94;87;86;[];1.0
11;mov;[];94;88;86;[];1.0 11;mov;[];94;88;86;[];1.0
12;mov;[];95;88;86;[];1.0 12;mov;[];95;88;86;[];1.0
17;mov;[];95;87;88;[];3.0 17;mov;[];95;87;88;[];3.0
14;mov;[];95;86;88;[];1.0 14;mov;[];95;86;88;[];1.0
8;mov;[];96;86;88;[94];2.0 8;mov;[];96;86;88;[94];2.0
9;mov;[];96;86;88;[95];2.0 9;mov;[];96;86;88;[95];2.0
2;loa;[];96;83;89;88;[99,100];20.0;U 2;loa;[];96;83;89;88;[99,100];20.0;M
4;loa;[];96;84;90;88;[99,101];10.0;U 4;loa;[];96;84;90;88;[99,101];10.0;M
5;loa;[];96;84;90;88;[100,101];10.0;U 5;loa;[];96;84;90;88;[100,101];10.0;M
7;loa;[];96;85;91;88;[101];10.0;U 7;loa;[];96;85;91;88;[101];10.0;M
Cargo Flows Cargo Flows
Initial Vessel State Initial Vessel State
......
...@@ -17,11 +17,11 @@ Transport Ships ...@@ -17,11 +17,11 @@ Transport Ships
Templates Templates
1;mrn;[]; 101; 86; []; 1.0 1;mrn;[]; 101; 86; []; 1.0
2;unm;[]; 101; 86; []; 1.0 2;unm;[]; 101; 86; []; 1.0
3;loa;[]; 101; 83; 89; 88; []; 10.0; M 3;loa;[]; 101; 83; 89; 86; []; 10.0; M
4;mrn;[]; 102; 86; []; 1.0 4;mrn;[]; 102; 86; []; 1.0
5;unm;[]; 102; 86; []; 1.0 5;unm;[]; 102; 86; []; 1.0
6;loa;[]; 102; 83; 89; 88; []; 10.0; M 6;loa;[]; 102; 83; 89; 86; []; 10.0; M
Cargo Flows Cargo Flows
Initial Vessel State Initial Vessel State
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment