16f90fbc
Eduardo Eloy
database and impl...
|
1
2
|
import java.io.File;
import java.io.FileNotFoundException;
|
29a181fe
Eduardo Eloy
paretoworking and...
|
3
|
import java.util.ArrayList;
|
16f90fbc
Eduardo Eloy
database and impl...
|
4
5
6
|
import java.util.Scanner;
public class UG {
|
2cd288b3
Eduardo Eloy
project can now i...
|
7
8
9
|
int internalId;
int externalId;
|
16f90fbc
Eduardo Eloy
database and impl...
|
10
|
float area;
|
2cd288b3
Eduardo Eloy
project can now i...
|
11
|
int[] adj;
|
df0e5c82
Eduardo Eloy
added region para...
|
12
|
int[] presc;
|
16f90fbc
Eduardo Eloy
database and impl...
|
13
|
|
16f90fbc
Eduardo Eloy
database and impl...
|
14
|
int[][] years;
|
2cd288b3
Eduardo Eloy
project can now i...
|
15
16
17
18
|
int[] crit0;
int[] crit1;
int[] crit2;
|
16f90fbc
Eduardo Eloy
database and impl...
|
19
|
int[] crit3;
|
44aa78ff
Eduardo Eloy
implementation at...
|
20
|
int[] crit4;
|
2cd288b3
Eduardo Eloy
project can now i...
|
21
|
int[] crit5;
|
5276b92b
Eduardo Eloy
added multi-crite...
|
22
23
24
|
int[] crit6;
int[] crit7;
int[] crit8;
|
2cd288b3
Eduardo Eloy
project can now i...
|
25
|
int[] crit9;
|
5276b92b
Eduardo Eloy
added multi-crite...
|
26
|
int[] crit10;
|
2cd288b3
Eduardo Eloy
project can now i...
|
27
|
|
a9dbe944
Eduardo Eloy
added new ways of...
|
28
29
30
|
int time;
boolean valid = false;
boolean treated;
|
2cd288b3
Eduardo Eloy
project can now i...
|
31
32
33
|
boolean treatedThisYear = false;
boolean noAdjacencies = false;
//int lasYearOfViolation = 0;
|
0142c195
Eduardo Eloy
more solution res...
|
34
|
//int lastYearTreated = 0;
|
16f90fbc
Eduardo Eloy
database and impl...
|
35
36
37
38
39
40
41
42
43
44
45
46
|
static public int[] returnInsertable(Scanner myReader){
String data = myReader.nextLine();
String[] str_split = data.split(",", 0);
int size = str_split.length;
int[] toInsert = new int [size];
for(int i=0; i<size; i++) {
toInsert[i] = Integer.parseInt(str_split[i]);
}
return toInsert;
}
|
44aa78ff
Eduardo Eloy
implementation at...
|
47
48
49
50
51
52
53
54
55
56
57
|
static public int[] returnInsertable2(Scanner myReader){
String data = myReader.nextLine();
String[] str_split = data.split(",", 0);
int size = str_split.length;
int[] toInsert = new int[size];
for(int i=0; i<size; i++) {
toInsert[i] = (int)Float.parseFloat(str_split[i]);
}
return toInsert;
}
|
2cd288b3
Eduardo Eloy
project can now i...
|
58
|
static public int[] returnZeroes(int size){
|
16f90fbc
Eduardo Eloy
database and impl...
|
59
60
61
|
int[] toInsert = new int[size];
for(int i=0; i<size; i++) {
toInsert[i] = 0;
|
2cd288b3
Eduardo Eloy
project can now i...
|
62
|
}
|
16f90fbc
Eduardo Eloy
database and impl...
|
63
|
return toInsert;
|
2cd288b3
Eduardo Eloy
project can now i...
|
64
|
}
|
16f90fbc
Eduardo Eloy
database and impl...
|
65
66
67
68
|
static public int[] adjacencyReader(int id, Scanner adjacencies, Scanner borders, int minBorder, UG[] array){
String dataAdj = adjacencies.nextLine();
|
2cd288b3
Eduardo Eloy
project can now i...
|
69
70
71
|
String[] str_splitA = dataAdj.split(",", 0);
String dataBorders = borders.nextLine();
|
16f90fbc
Eduardo Eloy
database and impl...
|
72
|
String[] str_splitB = dataBorders.split(",", 0);
|
2cd288b3
Eduardo Eloy
project can now i...
|
73
74
|
int size = str_splitA.length;
|
16f90fbc
Eduardo Eloy
database and impl...
|
75
|
|
2cd288b3
Eduardo Eloy
project can now i...
|
76
|
|
16f90fbc
Eduardo Eloy
database and impl...
|
77
78
|
ArrayList<Integer> toFill = new ArrayList<Integer>();
|
2cd288b3
Eduardo Eloy
project can now i...
|
79
80
81
|
int currentIndex = 0;
for(int i=0; i<size; i++) {
|
16f90fbc
Eduardo Eloy
database and impl...
|
82
|
if(Float.parseFloat(str_splitB[i]) > minBorder){
|
2cd288b3
Eduardo Eloy
project can now i...
|
83
84
85
86
87
88
89
90
|
int ext_id = Integer.parseInt(str_splitA[i]);
for(int j = 0; j < array.length; j++){
if(array[j].externalId == ext_id){
toFill.add(j);
break;
}
}
|
16f90fbc
Eduardo Eloy
database and impl...
|
91
|
}
|
2cd288b3
Eduardo Eloy
project can now i...
|
92
93
94
|
}
if(toFill.isEmpty()) {
|
16f90fbc
Eduardo Eloy
database and impl...
|
95
|
int[] toInsert = new int[1];
|
2cd288b3
Eduardo Eloy
project can now i...
|
96
97
|
toInsert[0] = -1;
return toInsert;
|
16f90fbc
Eduardo Eloy
database and impl...
|
98
|
}
|
2cd288b3
Eduardo Eloy
project can now i...
|
99
|
else {
|
16f90fbc
Eduardo Eloy
database and impl...
|
100
|
return toFill.stream().mapToInt(Integer::intValue).toArray();
|
16f90fbc
Eduardo Eloy
database and impl...
|
101
|
}
|
2cd288b3
Eduardo Eloy
project can now i...
|
102
103
104
|
}
|
16f90fbc
Eduardo Eloy
database and impl...
|
105
|
static public int[] returnPeriods(String data){
|
2cd288b3
Eduardo Eloy
project can now i...
|
106
107
108
109
|
String[] str_split = data.split(",", 0);
int size = str_split.length;
int[] toInsert = new int [size];
for(int i=0; i<size; i++) {
|
16f90fbc
Eduardo Eloy
database and impl...
|
110
|
toInsert[i] = Integer.parseInt(str_split[i]);
|
2cd288b3
Eduardo Eloy
project can now i...
|
111
112
113
|
}
return toInsert;
}
|
16f90fbc
Eduardo Eloy
database and impl...
|
114
|
|
16f90fbc
Eduardo Eloy
database and impl...
|
115
|
static public void setupInternalIds(UG[] array, String dir) throws FileNotFoundException {
|
2cd288b3
Eduardo Eloy
project can now i...
|
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
int index = 0;
File ext_init = new File(dir + "/external_init.txt");
Scanner readerExt = new Scanner(ext_init);
while (readerExt.hasNextLine()) {
UG toInsert = new UG();
toInsert.internalId = index;
toInsert.externalId = Integer.parseInt(readerExt.nextLine());
array[index] = toInsert;
index++;
}
readerExt.close();
}
static public void fillArray(UG[] array, String dir, int minBorder, ArrayList<Boolean> flags) {
int index = 0;
|
16f90fbc
Eduardo Eloy
database and impl...
|
132
|
|
2cd288b3
Eduardo Eloy
project can now i...
|
133
|
try {
|
16f90fbc
Eduardo Eloy
database and impl...
|
134
135
|
File adj_init = new File(dir + "/adj_init.txt"); //Adjacency input file
Scanner readerAdj = new Scanner(adj_init);
|
2cd288b3
Eduardo Eloy
project can now i...
|
136
137
138
139
140
141
142
143
144
|
File borders_init = new File(dir + "/border_init.txt"); //Borders input file
Scanner readerBorders = new Scanner(borders_init);
File ext_init = new File(dir + "/external_init.txt");
Scanner readerExt = new Scanner(ext_init);
File ugs_init = new File(dir + "/ugs_init.txt");
|
16f90fbc
Eduardo Eloy
database and impl...
|
145
146
|
Scanner readerPresc = new Scanner(ugs_init);
|
44aa78ff
Eduardo Eloy
implementation at...
|
147
|
File years_init = new File(dir + "/years_init.txt");
|
16f90fbc
Eduardo Eloy
database and impl...
|
148
149
150
151
|
Scanner readerYears = new Scanner(years_init);
File area_init = new File(dir + "/area_init.txt");
Scanner readerArea = new Scanner(area_init);
|
2cd288b3
Eduardo Eloy
project can now i...
|
152
153
154
155
156
|
File critFile0 = new File(dir + "/crit_file0.txt");
Scanner reader0 = null;
if(flags.get(0)) reader0 = new Scanner(critFile0);
|
16f90fbc
Eduardo Eloy
database and impl...
|
157
|
File critFile1 = new File(dir + "/crit_file1.txt");
|
2cd288b3
Eduardo Eloy
project can now i...
|
158
159
|
Scanner reader1 = null;
if(flags.get(1)) reader1 = new Scanner(critFile1);
|
16f90fbc
Eduardo Eloy
database and impl...
|
160
|
|
df0e5c82
Eduardo Eloy
added region para...
|
161
162
163
|
File critFile2 = new File(dir + "/crit_file2.txt");
Scanner reader2 = null;
if(flags.get(2)) reader2 = new Scanner(critFile2);
|
2cd288b3
Eduardo Eloy
project can now i...
|
164
165
|
|
16f90fbc
Eduardo Eloy
database and impl...
|
166
|
File critFile3 = new File(dir + "/crit_file3.txt");
|
2cd288b3
Eduardo Eloy
project can now i...
|
167
168
|
Scanner reader3 = null;
if(flags.get(3)) reader3 = new Scanner(critFile3);
|
16f90fbc
Eduardo Eloy
database and impl...
|
169
|
|
2cd288b3
Eduardo Eloy
project can now i...
|
170
171
|
File critFile4 = new File(dir + "/crit_file4.txt");
Scanner reader4 = null;
|
16f90fbc
Eduardo Eloy
database and impl...
|
172
|
if(flags.get(4)) reader4 = new Scanner(critFile4);
|
2cd288b3
Eduardo Eloy
project can now i...
|
173
174
|
File critFile5 = new File(dir + "/crit_file5.txt");
|
16f90fbc
Eduardo Eloy
database and impl...
|
175
|
Scanner reader5 = null;
|
2cd288b3
Eduardo Eloy
project can now i...
|
176
177
|
if(flags.get(5)) reader5 = new Scanner(critFile5);
|
16f90fbc
Eduardo Eloy
database and impl...
|
178
|
File critFile6 = new File(dir + "/crit_file6.txt");
|
2cd288b3
Eduardo Eloy
project can now i...
|
179
180
|
Scanner reader6 = null;
if(flags.get(6)) reader6 = new Scanner(critFile6);
|
16f90fbc
Eduardo Eloy
database and impl...
|
181
|
|
2cd288b3
Eduardo Eloy
project can now i...
|
182
183
|
File critFile7 = new File(dir + "/crit_file7.txt");
Scanner reader7 = null;
|
16f90fbc
Eduardo Eloy
database and impl...
|
184
|
if(flags.get(7)) reader7 = new Scanner(critFile7);
|
2cd288b3
Eduardo Eloy
project can now i...
|
185
186
|
File critFile8 = new File(dir + "/crit_file8.txt");
|
16f90fbc
Eduardo Eloy
database and impl...
|
187
|
Scanner reader8 = null;
|
2cd288b3
Eduardo Eloy
project can now i...
|
188
189
|
if(flags.get(8)) reader8 = new Scanner(critFile8);
|
16f90fbc
Eduardo Eloy
database and impl...
|
190
|
File critFile9 = new File(dir + "/crit_file9.txt");
|
2cd288b3
Eduardo Eloy
project can now i...
|
191
192
|
Scanner reader9 = null;
if(flags.get(9)) reader9 = new Scanner(critFile9);
|
16f90fbc
Eduardo Eloy
database and impl...
|
193
|
|
2cd288b3
Eduardo Eloy
project can now i...
|
194
|
File critFile10 = new File(dir + "/crit_file10.txt");
|
a9dbe944
Eduardo Eloy
added new ways of...
|
195
196
197
198
199
200
|
Scanner reader10 = null;
if(flags.get(10)) reader10 = new Scanner(critFile10);
while (readerAdj.hasNextLine()) {
UG toInsert = array[index];
toInsert.treated = false;
|
2cd288b3
Eduardo Eloy
project can now i...
|
201
|
|
16f90fbc
Eduardo Eloy
database and impl...
|
202
|
toInsert.adj = adjacencyReader(index, readerAdj, readerBorders, minBorder, array);
|
44aa78ff
Eduardo Eloy
implementation at...
|
203
|
|
0142c195
Eduardo Eloy
more solution res...
|
204
|
toInsert.externalId = Integer.parseInt(readerExt.nextLine());
|
2cd288b3
Eduardo Eloy
project can now i...
|
205
206
|
toInsert.area = Float.parseFloat(readerArea.nextLine());
|
16f90fbc
Eduardo Eloy
database and impl...
|
207
|
toInsert.presc = returnInsertable(readerPresc);
|
2cd288b3
Eduardo Eloy
project can now i...
|
208
209
|
String data = readerYears.nextLine();
|
a9dbe944
Eduardo Eloy
added new ways of...
|
210
211
|
//String[] removeVSlash = data.split("\\|", 0);
String[] str_split = data.split("/", 0);
|
df0e5c82
Eduardo Eloy
added region para...
|
212
213
|
int size = str_split.length;
toInsert.years = new int[size][];
|
2cd288b3
Eduardo Eloy
project can now i...
|
214
|
|
16f90fbc
Eduardo Eloy
database and impl...
|
215
|
for(int i = 0; i < size; i++) {
|
2cd288b3
Eduardo Eloy
project can now i...
|
216
217
218
219
220
221
222
223
|
toInsert.years[i] = returnPeriods(str_split[i]);
}
int[] zeroArray = returnZeroes(toInsert.presc.length);
if(flags.get(0)) toInsert.crit0 = returnInsertable2(reader0);
else toInsert.crit0 = zeroArray;
|
16f90fbc
Eduardo Eloy
database and impl...
|
224
225
|
if(flags.get(1)) toInsert.crit1 = returnInsertable2(reader1);
else toInsert.crit1 = zeroArray;
|
5276b92b
Eduardo Eloy
added multi-crite...
|
226
227
228
229
|
if(flags.get(2)) toInsert.crit2 = returnInsertable2(reader2);
else toInsert.crit2 = zeroArray;
|
44aa78ff
Eduardo Eloy
implementation at...
|
230
|
if(flags.get(3)) toInsert.crit3 = returnInsertable2(reader3);
|
16f90fbc
Eduardo Eloy
database and impl...
|
231
|
else toInsert.crit3 = zeroArray;
|
2cd288b3
Eduardo Eloy
project can now i...
|
232
233
234
|
if(flags.get(4)) toInsert.crit4 = returnInsertable2(reader4);
else toInsert.crit4 = zeroArray;
|
16f90fbc
Eduardo Eloy
database and impl...
|
235
|
|
2cd288b3
Eduardo Eloy
project can now i...
|
236
237
238
239
240
241
242
|
if(flags.get(5)) toInsert.crit5 = returnInsertable2(reader5);
else toInsert.crit5 = zeroArray;
if(flags.get(6)) toInsert.crit6 = returnInsertable2(reader6);
else toInsert.crit6 = zeroArray;
if(flags.get(7)) toInsert.crit7 = returnInsertable2(reader7);
|
16f90fbc
Eduardo Eloy
database and impl...
|
243
244
245
|
else toInsert.crit7 = zeroArray;
if(flags.get(8)) toInsert.crit8 = returnInsertable2(reader8);
|
2cd288b3
Eduardo Eloy
project can now i...
|
246
247
|
else toInsert.crit8 = zeroArray;
|
16f90fbc
Eduardo Eloy
database and impl...
|
248
249
|
if(flags.get(9)) toInsert.crit9 = returnInsertable2(reader9);
else toInsert.crit9 = zeroArray;
|
a9dbe944
Eduardo Eloy
added new ways of...
|
250
|
|
44aa78ff
Eduardo Eloy
implementation at...
|
251
252
253
|
if(flags.get(10)) toInsert.crit10 = returnInsertable2(reader10);
else toInsert.crit10 = zeroArray;
|
16f90fbc
Eduardo Eloy
database and impl...
|
254
255
256
257
258
|
if(toInsert.adj[0] == -1){
toInsert.noAdjacencies = true; //If unit has no adjacencies it's still used but not in the main loop
}
array[index] = toInsert;
|
2cd288b3
Eduardo Eloy
project can now i...
|
259
260
261
262
263
|
index++;
}
|
df0e5c82
Eduardo Eloy
added region para...
|
264
|
readerAdj.close();
|
2cd288b3
Eduardo Eloy
project can now i...
|
265
266
267
268
269
270
271
272
273
274
|
readerPresc.close();
readerExt.close();
readerBorders.close();
readerArea.close();
readerYears.close();
if(flags.get(0)) reader0.close();
if(flags.get(1)) reader1.close();
if(flags.get(2)) reader2.close();
if(flags.get(3)) reader3.close();
|
16f90fbc
Eduardo Eloy
database and impl...
|
275
276
277
278
279
280
281
|
if(flags.get(4)) reader4.close();
if(flags.get(5)) reader5.close();
if(flags.get(6)) reader6.close();
if(flags.get(7)) reader7.close();
if(flags.get(8)) reader8.close();
if(flags.get(9)) reader9.close();
if(flags.get(10)) reader10.close();
|
df0e5c82
Eduardo Eloy
added region para...
|
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
} catch (FileNotFoundException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
}
static public void fillVerificationArray(UG[] array, String dir, int minBorder) {
int index = 0;
try {
File adj_init = new File(dir + "/adj_init.txt"); //Adjacency input file
Scanner readerAdj = new Scanner(adj_init);
File borders_init = new File(dir + "/border_init.txt"); //Borders input file
|
16f90fbc
Eduardo Eloy
database and impl...
|
298
|
Scanner readerBorders = new Scanner(borders_init);
|
df0e5c82
Eduardo Eloy
added region para...
|
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
|
File ext_init = new File(dir + "/external_init.txt");
Scanner readerExt = new Scanner(ext_init);
File ugs_init = new File(dir + "/ugs_init.txt");
Scanner readerPresc = new Scanner(ugs_init);
File years_init = new File(dir + "/years_init.txt");
Scanner readerYears = new Scanner(years_init);
File area_init = new File(dir + "/area_init.txt");
Scanner readerArea = new Scanner(area_init);
while (readerAdj.hasNextLine()) {
UG toInsert = array[index];
toInsert.treated = false;
toInsert.time = 0;
toInsert.adj = adjacencyReader(index, readerAdj, readerBorders, minBorder, array);
toInsert.externalId = Integer.parseInt(readerExt.nextLine());
toInsert.area = Float.parseFloat(readerArea.nextLine());
toInsert.presc = returnInsertable(readerPresc);
String data = readerYears.nextLine();
|
a9dbe944
Eduardo Eloy
added new ways of...
|
329
330
331
332
333
|
//String[] removeVSlash = data.split("\\|", 0);
String[] str_split = data.split("/", 0);
int size = str_split.length;
toInsert.years = new int[size][];
|
df0e5c82
Eduardo Eloy
added region para...
|
334
335
336
337
338
339
340
341
342
343
|
for(int i = 0; i < size; i++) {
toInsert.years[i] = returnPeriods(str_split[i]);
}
if(toInsert.adj[0] == -1){
toInsert.noAdjacencies = true; //If unit has no adjacencies it's still used but not in the main loop
}
array[index] = toInsert;
index++;
|
a9dbe944
Eduardo Eloy
added new ways of...
|
344
345
346
|
}
readerAdj.close();
|
df0e5c82
Eduardo Eloy
added region para...
|
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
readerPresc.close();
readerExt.close();
readerBorders.close();
readerArea.close();
readerYears.close();
} catch (FileNotFoundException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
}
static public void fillNoCriteria(UG[] array, String dir, int minBorder) {
int index = 0;
try {
File adj_init = new File(dir + "/adj_init.txt"); //Adjacency input file
Scanner readerAdj = new Scanner(adj_init);
File borders_init = new File(dir + "/border_init.txt"); //Borders input file
Scanner readerBorders = new Scanner(borders_init);
File ext_init = new File(dir + "/external_init.txt");
Scanner readerExt = new Scanner(ext_init);
File ugs_init = new File(dir + "/ugs_init.txt");
Scanner readerPresc = new Scanner(ugs_init);
File years_init = new File(dir + "/years_init.txt");
Scanner readerYears = new Scanner(years_init);
File area_init = new File(dir + "/area_init.txt");
Scanner readerArea = new Scanner(area_init);
while (readerAdj.hasNextLine()) {
UG toInsert = array[index];
toInsert.treated = false;
toInsert.time = 0;
toInsert.adj = adjacencyReader(index, readerAdj, readerBorders, minBorder, array);
toInsert.externalId = Integer.parseInt(readerExt.nextLine());
toInsert.area = Float.parseFloat(readerArea.nextLine());
toInsert.presc = returnInsertable(readerPresc);
String data = readerYears.nextLine();
String[] str_split = data.split("/", 0);
|
a9dbe944
Eduardo Eloy
added new ways of...
|
399
|
int size = str_split.length;
|
df0e5c82
Eduardo Eloy
added region para...
|
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
|
toInsert.years = new int[size][];
for(int i = 0; i < size; i++) {
toInsert.years[i] = returnPeriods(str_split[i]);
}
if(toInsert.adj[0] == -1){
toInsert.noAdjacencies = true; //If unit has no adjacencies it's still used but not in the main loop
}
array[index] = toInsert;
index++;
}
readerAdj.close();
readerPresc.close();
readerExt.close();
readerBorders.close();
readerArea.close();
readerYears.close();
} catch (FileNotFoundException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
}
static public void fillOneCrit(UG[] array, String dir, int minBorder, ArrayList<Boolean> flags) {
int index = 0;
|
16f90fbc
Eduardo Eloy
database and impl...
|
430
|
try {
|
29a181fe
Eduardo Eloy
paretoworking and...
|
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
|
File adj_init = new File(dir + "/adj_init.txt"); //Adjacency input file
Scanner readerAdj = new Scanner(adj_init);
File borders_init = new File(dir + "/border_init.txt"); //Borders input file
Scanner readerBorders = new Scanner(borders_init);
File ext_init = new File(dir + "/external_init.txt");
Scanner readerExt = new Scanner(ext_init);
File ugs_init = new File(dir + "/ugs_init.txt");
Scanner readerPresc = new Scanner(ugs_init);
File years_init = new File(dir + "/years_init.txt");
Scanner readerYears = new Scanner(years_init);
File area_init = new File(dir + "/area_init.txt");
Scanner readerArea = new Scanner(area_init);
File critFile0 = new File(dir + "/crit_file0.txt");
Scanner reader0 = new Scanner(critFile0);
while (readerAdj.hasNextLine()) {
UG toInsert = array[index];
toInsert.treated = false;
toInsert.adj = adjacencyReader(index, readerAdj, readerBorders, minBorder, array);
toInsert.externalId = Integer.parseInt(readerExt.nextLine());
toInsert.area = Float.parseFloat(readerArea.nextLine());
toInsert.presc = returnInsertable(readerPresc);
String data = readerYears.nextLine();
//String[] removeVSlash = data.split("\\|", 0);
String[] str_split = data.split("/", 0);
int size = str_split.length;
toInsert.years = new int[size][];
for(int i = 0; i < size; i++) {
toInsert.years[i] = returnPeriods(str_split[i]);
}
toInsert.crit0 = returnInsertable2(reader0);
if(toInsert.adj[0] == -1){
|
a9dbe944
Eduardo Eloy
added new ways of...
|
478
479
480
481
482
483
|
toInsert.noAdjacencies = true; //If unit has no adjacencies it's still used but not in the main loop
}
array[index] = toInsert;
index++;
}
|
29a181fe
Eduardo Eloy
paretoworking and...
|
484
485
486
487
488
489
490
491
492
493
|
readerAdj.close();
readerPresc.close();
readerExt.close();
readerBorders.close();
readerArea.close();
readerYears.close();
|
a9dbe944
Eduardo Eloy
added new ways of...
|
494
495
|
reader0.close();
|
29a181fe
Eduardo Eloy
paretoworking and...
|
496
497
498
499
500
501
502
|
} catch (FileNotFoundException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
}
}
|
a9dbe944
Eduardo Eloy
added new ways of...
|
|
|
29a181fe
Eduardo Eloy
paretoworking and...
|
|
|
16f90fbc
Eduardo Eloy
database and impl...
|
|
|