SUMO - Simulation of Urban MObility
TraCI_Junction.cpp
Go to the documentation of this file.
1 /****************************************************************************/
11 // C++ TraCI client API implementation
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2017-2017 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
37 #include <microsim/MSNet.h>
39 #include "TraCI_Junction.h"
40 #include "TraCI.h"
41 
42 
43 // ===========================================================================
44 // member definitions
45 // ===========================================================================
46 std::vector<std::string>
48  std::vector<std::string> ids;
50  return ids;
51 }
52 
53 int
55  return (int) getIDList().size();
56 }
57 
59 TraCI_Junction::getPosition(const std::string& junctionID) {
60  return TraCI::makeTraCIPosition(getJunction(junctionID)->getPosition());
61 }
62 
64 TraCI_Junction::getShape(const std::string& junctionID) {
66 }
67 
69 TraCI_Junction::getJunction(const std::string& id) {
71  if (j == 0) {
72  throw TraCIException("Junction '" + id + "' is not known");
73  }
74  return j;
75 }
76 
77 
78 /****************************************************************************/
The base class for an intersection.
Definition: MSJunction.h:64
T get(const std::string &id) const
Retrieves an item.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:158
void insertIDs(std::vector< std::string > &into) const
static int getIDCount()
A 3D-position.
Definition: TraCIDefs.h:71
static std::vector< std::string > getIDList()
static TraCIPositionVector makeTraCIPositionVector(const PositionVector &positionVector)
helper functions
Definition: TraCI.cpp:108
static TraCIPosition makeTraCIPosition(const Position &position)
Definition: TraCI.cpp:144
MSJunctionControl & getJunctionControl()
Returns the junctions control.
Definition: MSNet.h:393
static TraCIPositionVector getShape(const std::string &junctionID)
static TraCIPosition getPosition(const std::string &junctionID)
A list of positions.
static MSJunction * getJunction(const std::string &id)