Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #include "TraCIAPI.h"
  2. #include <string>
  3. #include <Windows.h>
  4. #include <iostream>
  5. #include <cstdlib>
  6. #include <time.h>
  7.  
  8.  
  9. class Client : public TraCIAPI {
  10. public:
  11. Client() {};
  12. ~Client() {};
  13. };
  14.  
  15.  
  16. /* Traci Control Unit. Sends commands to SUMO*/
  17. class TraciControlToSumo
  18. {
  19. public:
  20.  
  21. /*Constructor for TraciControlToSumo class*/
  22. TraciControlToSumo() {};
  23. /*Destructor for TraciControlToSumo class*/
  24. ~TraciControlToSumo() {};
  25. /*Initialize calls ZeroMemory on StartupInfo, sets Startup.cb to sizeof Startup, and initializes cmdArgs*/
  26. void initialize();
  27. /*Boots up Sumo using CreateProcess and CmdArgs*/
  28. void runSumo();
  29. /*Runs a client that connects to Sumo and gives it commands*/
  30. void runClient();
  31. /*Returns sumoCfgString*/
  32. std::string getSumoCfgString();
  33. /* Returns sumoCmd*/
  34. std::string getSumoCmd();
  35. /*Returns whether Sumo uses a random seed or not*/
  36. bool getRandom();
  37. /*Returns the seed*/
  38. int getSeed();
  39.  
  40. private:
  41.  
  42. PROCESS_INFORMATION ProcessInfo; //This is what we get as an [out] parameter
  43. STARTUPINFO StartupInfo; //This is an [in] parameter
  44. std::string sumoCmd; //Used to construct cmdArgs
  45. std::string sumoCfgString; //Used to construct sumoCmd
  46. LPSTR cmdArgs; //Commands passed to the console during CreateProcess
  47. Client client; //Sends commands to Sumo
  48. bool random;
  49. int seed;
  50. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement