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-2022 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
18
// Testing libsumo for C++
19
/****************************************************************************/
20
#include <iostream>
21
#include <
libsumo/libsumo.h
>
22
23
24
// ===========================================================================
25
// main function
26
// ===========================================================================
27
int
28
main
(
int
argc,
char
** argv) {
29
std::vector<std::string> options;
30
for
(
int
i = 1; i < argc; i++) {
31
options.push_back(argv[i]);
32
}
33
libsumo::Simulation::load(options);
34
std::cout <<
"Simulation loaded\n"
;
35
options.insert(options.begin(),
"sumo"
);
36
libsumo::Simulation::start(options);
37
std::cout <<
"Simulation started\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
/****************************************************************************/
libsumo.h
main
int main(int argc, char **argv)
Definition:
testlibsumo_main.cpp:28
src
traci_testclient
testlibsumo_main.cpp
Generated on Fri Feb 11 2022 22:11:11 for Eclipse SUMO - Simulation of Urban MObility by
1.9.1