-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-alt.cpp
47 lines (34 loc) · 1.33 KB
/
main-alt.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include "Routing/Tests/IOUtils.h"
#include "Routing/Data/Probability/ProfileStorageHDF5.h"
#include "Tests/DataPaths.h"
#include "Routing/Algorithms/Alternatives/AlternativesPlateauAlgorithm.h"
int main(int argc, char **argv) {
shared_ptr<Routing::Data::GraphMemory> routingGraph = Routing::Tests::LoadGraph("../data/graph.hdf5");
auto alg = new Routing::Algorithms::AlternativesPlateauAlgorithm(routingGraph);
auto settings = alg->GetAlgorithmSettings();
// Similarity - how much similiar the roads should be
settings.SetSimilarity(55);
settings.SetUseSimilarityParameter(true);
// Filtering elipse
settings.filterSettings.allFilterOff = true;
// Set settings
alg->SetAlgorithmSettings(settings);
alg->UpdateAlternativesSettings();
int id_origin = 14755;
int id_destination = 3742;
int max_routes = 10;
std::unique_ptr<std::vector<Result>> results = alg->GetResults(id_origin, id_destination, max_routes, false);
if(results == nullptr){
std::cout << "No solutions." << std::endl;
}
else{
std::ofstream output("../data/routes.csv");
output << "Routes as sequences of osmn ids\n";
for(auto &res : *results) {
std::cout << res << std::endl;
res.CSVRoutes(output);
}
}
return EXIT_SUCCESS;
}