SUMO - Simulation of Urban MObility
TraCIServerAPI_Simulation.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // APIs for getting/setting edge values via TraCI
19 /****************************************************************************/
20 #ifndef TraCIServerAPI_Simulation_h
21 #define TraCIServerAPI_Simulation_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #ifndef NO_TRACI
34 
35 #include <string>
36 #include <map>
37 #include <vector>
38 #include "TraCIServer.h"
39 #include <foreign/tcpip/storage.h>
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
50 public:
57  static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage,
58  tcpip::Storage& outputStorage);
59 
66  static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage,
67  tcpip::Storage& outputStorage);
68 
69 
76  static std::pair<MSLane*, double> convertCartesianToRoadMap(Position pos);
77 
85  static bool commandPositionConversion(TraCIServer& server, tcpip::Storage& inputStorage,
86  tcpip::Storage& outputStorage, int commandId);
87 
88  static bool commandDistanceRequest(TraCIServer& server, tcpip::Storage& inputStorage,
89  tcpip::Storage& outputStorage, int commandId);
90 
91 private:
92  static void writeVehicleStateNumber(TraCIServer& server, tcpip::Storage& outputStorage, MSNet::VehicleState state);
93  static void writeVehicleStateIDs(TraCIServer& server, tcpip::Storage& outputStorage, MSNet::VehicleState state);
94  static void writeStage(tcpip::Storage& outputStorage, const libsumo::TraCIStage& stage);
95 
96 
97 private:
100 
103 
104 
105 };
106 
107 
108 #endif
109 
110 #endif
111 
112 /****************************************************************************/
113 
static void writeVehicleStateIDs(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
static void writeStage(tcpip::Storage &outputStorage, const libsumo::TraCIStage &stage)
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xab: Get Simulation Variable)
TraCIServerAPI_Simulation(const TraCIServerAPI_Simulation &s)
invalidated copy constructor
static void writeVehicleStateNumber(TraCIServer &server, tcpip::Storage &outputStorage, MSNet::VehicleState state)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcb: Set Simulation Variable)
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
APIs for getting/setting simulation values via TraCI.
static bool commandPositionConversion(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:69
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:482
static bool commandDistanceRequest(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage, int commandId)
static std::pair< MSLane *, double > convertCartesianToRoadMap(Position pos)
TraCIServerAPI_Simulation & operator=(const TraCIServerAPI_Simulation &s)
invalidated assignment operator