OptimisationProblem/Main.cpp
2023-07-17 01:19:10 +03:00

36 lines
849 B
C++

#include "structures/Distances.h"
#include "structures/Centers.h"
#include "structures/Missions.h"
#include "structures/Employees.h"
#include "Solver.h"
#include <string>
int main(int argc, char* argv[]) {
if (argc < 2)
{
std::cout << "Missing instance name\n";
exit(0);
}
int nPop = 100;
int nGen = 100;
if (argc > 2)
nPop = std::stoi(argv[2]);
if (argc > 3)
nGen = std::stoi(argv[3]);
std::cout << "Using a population of " << nPop << ", for " << nGen << " generations\n";
std::string instance = argv[1];
std::string base = "instances/" + instance;
std::cout << "Loading data for " << instance << "\n";
Distances distances(base);
Centers centers(base);
//centers.print();
Employees employees(base, centers);
Missions missions(base, centers);
solver(nPop, nGen, 0.9f, 0.1f, distances, centers, employees, missions);
}