Eclipse SUMO - Simulation of Urban MObility
testlibsumo_main.cpp
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3
// Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials
5
// are made available under the terms of the Eclipse Public License v2.0
6
// which accompanies this distribution, and is available at
7
// http://www.eclipse.org/legal/epl-v20.html
8
// SPDX-License-Identifier: EPL-2.0
9
/****************************************************************************/
14
// Testing libsumo for C++
15
/****************************************************************************/
16
17
18
// ===========================================================================
19
// included modules
20
// ===========================================================================
21
#include <iostream>
22
#include <
libsumo/Simulation.h
>
23
#include <
utils/common/ToString.h
>
24
25
26
27
// ===========================================================================
28
// main function
29
// ===========================================================================
30
int
31
main
(
int
argc,
char
** argv) {
32
std::vector<std::string> options;
33
for
(
int
i = 1; i < argc; i++) {
34
options.push_back(argv[i]);
35
}
36
libsumo::Simulation::load
(options);
37
std::cout <<
"Simulation loaded\n"
;
38
/*
39
std::vector<libsumo::TraCIStage> result = libsumo::Simulation::findIntermodalRoute("64455492", "-22913705", "public", 21600, 3, -1, -1, 0, 0,0,"ped");
40
double cost = 0;
41
double time = 0;
42
for (const auto& stage : result)
43
{
44
std::cout << " type=" << stage.type << " line=" << stage.line << " travelTime=" << stage.travelTime << " cost=" << stage.cost << " destination: "<< stage.destStop<<"\n";
45
std::cout << "Descr:\n" << stage.description<< std::endl<<std::endl;
46
cost += stage.cost;
47
time += stage.travelTime;
48
}
49
std::cout<<"end cost: "<<cost<<std::endl;
50
std::cout<<"end time: "<<time<<std::endl;
51
*/
52
}
53
54
55
/****************************************************************************/
main
int main(int argc, char **argv)
Definition:
testlibsumo_main.cpp:31
ToString.h
libsumo::Simulation::load
static void load(const std::vector< std::string > &args)
load a simulation with the given arguments
Definition:
Simulation.cpp:63
Simulation.h
src
traci_testclient
testlibsumo_main.cpp
Generated on Thu Jan 16 2020 21:12:23 for Eclipse SUMO - Simulation of Urban MObility by
1.8.16