|
@@ -119,8 +119,8 @@ void parseTSPLIB_FULL_MATRIX(const char *filename, Graph **graph)
|
119
|
119
|
|
120
|
120
|
void parseTSPLIB_EUC_2D(const char *filename, Graph **graph)
|
121
|
121
|
{
|
122
|
|
- // Parser plikow EUC_2D z TSPLIB
|
123
|
|
- // Implementacja: Jan Potocki 2017
|
|
122
|
+ // Parser plikow EUC_2D z TSPLIB
|
|
123
|
+ // Implementacja: Jan Potocki 2017
|
124
|
124
|
string fileInput;
|
125
|
125
|
vector<float> xCoord, yCoord;
|
126
|
126
|
ifstream salesmanDataFile;
|
|
@@ -202,9 +202,22 @@ void parseTSPLIB_EUC_2D(const char *filename, Graph **graph)
|
202
|
202
|
return;
|
203
|
203
|
}
|
204
|
204
|
|
|
205
|
+unsigned autoTabuLength(Graph &graph)
|
|
206
|
+{
|
|
207
|
+ unsigned computedTabuLength;
|
|
208
|
+
|
|
209
|
+ computedTabuLength = (2 * graph.getVertexNumber() / 10) * 10;
|
|
210
|
+ if(computedTabuLength == 0)
|
|
211
|
+ computedTabuLength = 10;
|
|
212
|
+
|
|
213
|
+ // PEA 2 Plus
|
|
214
|
+ // Jan Potocki 2019
|
|
215
|
+ return computedTabuLength;
|
|
216
|
+}
|
|
217
|
+
|
205
|
218
|
void banner()
|
206
|
219
|
{
|
207
|
|
- cout << "PEA Projekt 2 Plus v2.0.1" << endl;
|
|
220
|
+ cout << "PEA Projekt 2 Plus v2.0.2" << endl;
|
208
|
221
|
cout << "Jan Potocki 2017-2019" << endl;
|
209
|
222
|
cout << "(beerware)" << endl;
|
210
|
223
|
}
|
|
@@ -400,17 +413,9 @@ int main(int argc, char *argv[])
|
400
|
413
|
{
|
401
|
414
|
unsigned effectiveTabuLength;
|
402
|
415
|
if(tabuLength == 0)
|
403
|
|
- {
|
404
|
|
- effectiveTabuLength = (graph->getVertexNumber() / 10) * 10;
|
405
|
|
- if(effectiveTabuLength == 0)
|
406
|
|
- effectiveTabuLength = 10;
|
407
|
|
- // PEA 2 Plus
|
408
|
|
- // Jan Potocki 2019
|
409
|
|
- }
|
|
416
|
+ effectiveTabuLength = autoTabuLength(*graph);
|
410
|
417
|
else
|
411
|
|
- {
|
412
|
418
|
effectiveTabuLength = tabuLength;
|
413
|
|
- }
|
414
|
419
|
|
415
|
420
|
if(tabuLength == 0)
|
416
|
421
|
cout << "Kadencja: " << effectiveTabuLength << " (auto)" << endl;
|
|
@@ -524,15 +529,9 @@ int main(int argc, char *argv[])
|
524
|
529
|
{
|
525
|
530
|
unsigned effectiveTabuLength;
|
526
|
531
|
if(tabuLength == 0)
|
527
|
|
- {
|
528
|
|
- effectiveTabuLength = (graph->getVertexNumber() / 10) * 10;
|
529
|
|
- if(effectiveTabuLength == 0)
|
530
|
|
- effectiveTabuLength = 10;
|
531
|
|
- }
|
|
532
|
+ effectiveTabuLength = autoTabuLength(*graph);
|
532
|
533
|
else
|
533
|
|
- {
|
534
|
534
|
effectiveTabuLength = tabuLength;
|
535
|
|
- }
|
536
|
535
|
|
537
|
536
|
int measureResult = -1;
|
538
|
537
|
int measureResultDiv = -1;
|