Skip to content

Commit 358f660

Browse files
authored
Development (#2)
* V0.4 - Lazy Constraint Callback * Updated README.md * V0.5 - Added arguments support and writing results to a text file\nCan now be massively launched from a command line interface, all results will be printed to Results.txt
1 parent e459493 commit 358f660

File tree

6 files changed

+323
-26
lines changed

6 files changed

+323
-26
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,5 @@ MigrationBackup/
360360
.ionide/
361361

362362
# Fody - auto-generated XML schema
363-
FodyWeavers.xsd
363+
FodyWeavers.xsd
364+
/TIPEcppTest1/model.lp

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
# TIPEcppTest1
1+
# TIPE: Implementation of a TSP solver using IBM's CPLEX and Concert in C++
2+
3+
This implementation aims to reproduce and implement the algorithms present in the paper *"Optimisation des livraisons urbaines avec drones et véhicules en parallèle"*, published by *Gertrude Raïssa Mbiadou Saleu*
4+
This paper is freely available here: https://tel.archives-ouvertes.fr/tel-03554311
5+
6+
> Gertrude Raïssa Mbiadou Saleu. Optimisation des livraisons urbaines avec drones et véhicules en parallèle. Other [cs.OH]. Université Clermont Auvergne, 2021. English. ffNNT : 2021UCFAC009ff.fftel-03554311f
7+
8+
# Important notice
9+
10+
This project requires CPLEX Studio to be installed to run
11+
This projects needs to be configured in order to run cplex and concert libraries
12+
13+
As I am learning C++ on the way with this project, some parts of the code may not be accurate, I provide it "as-is" for you to use
14+
Thanks for your understanding

TIPEcppTest1/FileManager.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ vector<vector<string>> FileManager::read_file(string filename, bool EnableCout)
3838
}
3939
else if (wordNum != wordList.size())
4040
{
41-
cout << "ERROR: File word count per line is not consistent!" << endl;
41+
cerr << "ERROR: File word count per line is not consistent!" << endl;
4242
}
4343

4444
if (EnableCout) { cout << myLine << endl; }
@@ -48,6 +48,11 @@ vector<vector<string>> FileManager::read_file(string filename, bool EnableCout)
4848
return lineList;
4949
file.close();
5050
}
51+
else
52+
{
53+
cerr << "ERROR: Unable to read file" << endl;
54+
return vector<vector<string>> {};
55+
}
5156
}
5257

5358
float** FileManager::read_standardized_csv(vector<vector<string>> lines, bool EnableCout)
@@ -63,7 +68,7 @@ float** FileManager::read_standardized_csv(vector<vector<string>> lines, bool En
6368
{
6469
int i = std::stoi(lines[p][0]);
6570
int j = std::stoi(lines[p][1]);
66-
Distance[i][j] = std::stod(lines[p][3]);
71+
Distance[i][j] = std::stof(lines[p][3]);
6772
if (EnableCout)
6873
{
6974
cout << "i: " << i << " j: " << j << " dist: " << std::stod(lines[p][3]) << endl;

TIPEcppTest1/FileManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ static class FileManager
1414
/// <param name="filename">The path to find the csv file</param>
1515
/// <param name="EnableCout">Enable debug output to console</param>
1616
/// <returns>A list of lines containing a list of words</returns>
17-
static vector<vector<string>> read_file(string filename, bool EnableCout);
17+
static vector<vector<string>> read_file(string filename, bool EnableCout = false);
1818

1919
/// <summary>
2020
/// This is a parser, parses the wanted csv file to retrieve the wanted matrices
2121
/// </summary>
2222
/// <param name="lines">The csv files, already organized</param>
2323
/// <param name="EnableCout">Enable debug output to console</param>
2424
/// <returns>A matrix containing the data of the csv</returns>
25-
static float** read_standardized_csv(vector<vector<string>> lines, bool EnableCout);
25+
static float** read_standardized_csv(vector<vector<string>> lines, bool EnableCout = false);
2626
};

0 commit comments

Comments
 (0)