27 lines
546 B
C++
Executable File
27 lines
546 B
C++
Executable File
#include<iostream>
|
|
#include<stdlib.h>
|
|
#include<time.h>
|
|
#include"models.h"
|
|
#include"methods.h"
|
|
|
|
int main(){
|
|
time_t start = time(nullptr);
|
|
srand(1);//time(NULL));
|
|
|
|
Data Distrib("30Villes");
|
|
Distrib.randSet(30);
|
|
//Distrib.exportData();
|
|
|
|
TSP TSP_distrib(Distrib);
|
|
Model* Mod = new TSP(TSP_distrib);
|
|
//std::cout << Mod4->getCost()<< std::endl;
|
|
SimulatedAnnealing Opti(Mod);
|
|
Opti.initialise();
|
|
Opti.execute();
|
|
Opti.finalise();
|
|
free(Mod);
|
|
|
|
std::cout << "Elapsed time : " << difftime(time(nullptr),start) << "s." << std::endl;
|
|
return 0;
|
|
}
|