52 std::vector<std::string> options;
53 std::stringstream ss(callOptions);
55 while (std::getline(ss, temp_str,
DELIMITER)) {
56 options.push_back(temp_str);
60 libsumo::Simulation::load(options);
62 std::cerr <<
"libsumo::Simulation::load() failed - reason: " << e.what() << std::endl;
85 std::vector<std::string> params;
86 std::stringstream ss(paramString);
88 while (std::getline(ss, temp_str,
DELIMITER)) {
89 params.push_back(temp_str);
92 const std::string vehID = params[0];
93 const std::string edgeID = params[1];
94 int laneIndex = strtol(params[2].c_str(), &pEnd, 10);
95 double x = strtod(params[3].c_str(), &pEnd);
96 double y = strtod(params[4].c_str(), &pEnd);
98 int keepRoute = params.size() >= 7 ? strtol(params[6].c_str(), &pEnd, 10) : 1;
99 double matchThreshold = params.size() >= 8 ? strtod(params[7].c_str(), &pEnd) : 100;
100 libsumo::Vehicle::moveToXY(vehID, edgeID, laneIndex, x, y, angle, keepRoute, matchThreshold);
101 }
catch (
const std::runtime_error& e) {
102 std::cerr <<
"libsumo::Vehicle::moveToXY() failed - reason: " << e.what() << std::endl;
110 std::vector<std::string> params;
112 std::string temp_str;
113 while (std::getline(ss, temp_str,
DELIMITER)) {
114 params.push_back(temp_str);
117 const std::string vehID = params[0];
118 const std::string key = params[1];
119 std::pair<std::string, std::string> p = libsumo::Vehicle::getParameterWithKey(vehID, key);
120 const std::string resultString = p.first +
DELIMITER + p.second;
122 }
catch (
const std::runtime_error& e) {
123 std::cerr <<
"libsumo::Vehicle::getParameterWithKey() failed - reason: " << e.what() << std::endl;
131 std::vector<std::string> params;
133 std::string temp_str;
134 while (std::getline(ss, temp_str,
DELIMITER)) {
135 params.push_back(temp_str);
138 const std::string vehID = params[0];
140 }
catch (
const std::runtime_error& e) {
141 std::cerr <<
"libsumo::Vehicle::getLaneID() failed - reason: " << e.what() << std::endl;
149 std::vector<std::string> params;
151 std::string temp_str;
152 while (std::getline(ss, temp_str,
DELIMITER)) {
153 params.push_back(temp_str);
156 const std::string vehID = params[0];
158 std::ostringstream os;
161 }
catch (
const std::runtime_error& e) {
162 std::cerr <<
"libsumo::Vehicle::getPosition() failed - reason: " << e.what() << std::endl;