42std::vector<std::string>
43OverheadWire::getIDList() {
44 std::vector<std::string> ids;
46 ids.push_back(item.first);
48 std::sort(ids.begin(), ids.end());
53OverheadWire::getIDCount() {
54 return (
int)getIDList().size();
59OverheadWire::getLaneID(
const std::string& stopID) {
60 return getOverheadWire(stopID)->getLane().getID();
65OverheadWire::getStartPos(
const std::string& stopID) {
66 return getOverheadWire(stopID)->getBeginLanePosition();
70OverheadWire::getEndPos(
const std::string& stopID) {
71 return getOverheadWire(stopID)->getEndLanePosition();
75OverheadWire::getName(
const std::string& stopID) {
76 return getOverheadWire(stopID)->getMyName();
80OverheadWire::getVehicleCount(
const std::string& stopID) {
85std::vector<std::string>
86OverheadWire::getVehicleIDs(
const std::string& stopID) {
88 std::vector<std::string> result;
90 result.push_back(veh->getID());
98OverheadWire::getParameter(
const std::string& stopID,
const std::string& param) {
106OverheadWire::setParameter(
const std::string& stopID,
const std::string& key,
const std::string& value) {
116OverheadWire::getOverheadWire(
const std::string&
id) {
119 throw TraCIException(
"OverheadWire '" +
id +
"' is not known");
125std::shared_ptr<VariableWrapper>
126OverheadWire::makeWrapper() {
127 return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
132OverheadWire::handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper,
tcpip::Storage* paramData) {
135 return wrapper->wrapStringList(objID, variable, getIDList());
137 return wrapper->wrapInt(objID, variable, getIDCount());
139 return wrapper->wrapString(objID, variable, getLaneID(objID));
141 return wrapper->wrapDouble(objID, variable, getStartPos(objID));
143 return wrapper->wrapDouble(objID, variable, getEndPos(objID));
145 return wrapper->wrapString(objID, variable, getName(objID));
147 return wrapper->wrapInt(objID, variable, getVehicleCount(objID));
149 return wrapper->wrapStringList(objID, variable, getVehicleIDs(objID));
152 return wrapper->wrapString(objID, variable, getParameter(objID, paramData->
readString()));
155 return wrapper->wrapStringPair(objID, variable, getParameterWithKey(objID, paramData->
readString()));
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
The simulated network and simulation perfomer.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
Definition of overhead wire segment.
const std::vector< SUMOVehicle * > & getChargingVehicles() const
A lane area vehicles can halt at.
C++ TraCI client API implementation.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
Representation of a vehicle.
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_NUMBER
TRACI_CONST int TRACI_ID_LIST
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int VAR_POSITION
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_LANEPOSITION
TRACI_CONST int VAR_LANE_ID
TRACI_CONST int VAR_PARAMETER_WITH_KEY
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_IDS