 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
48 std::vector<std::string>
50 std::vector<std::string> ids;
86 std::vector<TraCIConnection>
88 std::vector<TraCIConnection> v;
92 const std::string approachedLane = link->getLane() !=
nullptr ? link->getLane()->getID() :
"";
93 const bool hasPrio = link->havePriority();
94 const double speed =
MIN2(lane->
getSpeedLimit(), link->getLane()->getSpeedLimit());
98 const std::string approachedInternal = link->getViaLane() !=
nullptr ? link->getViaLane()->getID() :
"";
101 const double length = link->getLength();
102 v.push_back(
TraCIConnection(approachedLane, hasPrio, isOpen, hasFoe, approachedInternal, state, direction, length));
108 std::vector<std::string>
111 if (permissions ==
SVCAll) {
118 std::vector<std::string>
128 for (PositionVector::const_iterator pi = shp.begin(); pi != shp.end(); ++pi) {
209 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
210 length += (*j)->getVehicleType().getLength();
212 if (vehs.size() > 0) {
213 length = length / (double)vehs.size();
230 if (meanSpeed != 0) {
248 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
258 std::vector<std::string>
261 std::vector<std::string> vehIDs;
263 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
264 vehIDs.push_back((*j)->getID());
271 std::vector<std::string>
273 std::vector<std::string> foeIDs;
277 if (link ==
nullptr) {
278 throw TraCIException(
"No connection from lane '" + laneID +
"' to lane '" + toLaneID +
"'");
281 foeIDs.push_back(foe->getLaneBefore()->getID());
287 std::vector<std::string>
290 const std::vector<const MSLane*>* foeLanes;
291 std::vector<const MSLane*>::const_iterator it;
292 std::vector<std::string> foeIDs;
298 for (it = foeLanes->begin(); foeLanes->end() != it; ++it) {
299 foeIDs.push_back((*it)->getID());
312 pred->rebuildAllowedTargets();
323 pred->rebuildAllowedTargets();
374 std::shared_ptr<VariableWrapper>
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
double getWaitingSeconds() const
Returns the overall waiting time on this lane.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
static std::vector< std::string > getInternalFoes(const std::string &laneID)
TRACI_CONST int LAST_STEP_VEHICLE_HALTING_NUMBER
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
double getCOEmissions() const
Returns the sum of last step CO emissions.
static void setMaxSpeed(std::string laneID, double speed)
const std::vector< std::string > & getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
static int getLastStepHaltingNumber(std::string laneID)
static StringBijection< LinkState > LinkStates
link states
static double getCOEmission(std::string laneID)
Representation of a lane in the micro simulation.
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
TRACI_CONST int VAR_FUELCONSUMPTION
static double getTraveltime(std::string laneID)
const std::string & getString(const T key) const
TRACI_CONST int VAR_MAXSPEED
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
TRACI_CONST int VAR_WAITING_TIME
TRACI_CONST int VAR_WIDTH
static double getCO2Emission(std::string laneID)
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
static double getLastStepMeanSpeed(std::string laneID)
const std::vector< MSLink * > & getFoeLinks() const
static double getLastStepLength(std::string laneID)
static LIBSUMO_SUBSCRIPTION_API void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
std::vector< MSVehicle * > VehCont
Container for vehicles.
TRACI_CONST int LANE_DISALLOWED
TRACI_CONST int VAR_COEMISSION
static std::vector< std::string > getFoes(const std::string &laneID, const std::string &toLaneID)
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
static void setParameter(const std::string &routeID, const std::string &key, const std::string &value)
static void setLength(std::string laneID, double length)
double getHCEmissions() const
Returns the sum of last step HC emissions.
TRACI_CONST int LAST_STEP_VEHICLE_ID_LIST
TRACI_CONST int VAR_NOISEEMISSION
void setMaxSpeed(double val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
static StringBijection< LinkDirection > LinkDirections
link directions
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
static void setAllowed(std::string laneID, std::vector< std::string > allowedClasses)
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static TraCIPositionVector getShape(std::string laneID)
int getVehicleNumber() const
Returns the number of vehicles on this lane (for which this lane is responsible)
static std::vector< std::string > getLastStepVehicleIDs(std::string laneID)
TRACI_CONST int VAR_NOXEMISSION
static std::string getParameter(const std::string &laneID, const std::string ¶m)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
TRACI_CONST int VAR_CURRENT_TRAVELTIME
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
void setPermissions(SVCPermissions permissions, long long transientID)
Sets the permissions to the given value. If a transientID is given, the permissions are recored as te...
const std::vector< const MSLane * > & getFoeLanes() const
static const long CHANGE_PERMISSIONS_PERMANENT
static double getElectricityConsumption(std::string laneID)
static double getNOxEmission(std::string laneID)
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
static double getFuelConsumption(std::string laneID)
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static int getLastStepVehicleNumber(std::string laneID)
TRACI_CONST int VAR_PMXEMISSION
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
static double getMaxSpeed(std::string laneID)
double getLength() const
Returns the lane's length.
static double getDefaultDecel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default deceleration for the given vehicle class This needs to be a function because the ...
static std::shared_ptr< VariableWrapper > makeWrapper()
double getMeanSpeed() const
Returns the mean speed on this lane.
static ContextSubscriptionResults myContextSubscriptionResults
TRACI_CONST int TRACI_ID_LIST
A road/street connecting two junctions.
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
static std::string getEdgeID(std::string laneID)
static SubscriptionResults mySubscriptionResults
static double getWaitingTime(std::string laneID)
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
TRACI_CONST int VAR_LENGTH
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
TRACI_CONST int LANE_EDGE_ID
static std::vector< TraCIConnection > getLinks(std::string laneID)
MSEdge & getEdge() const
Returns the lane's edge.
const PositionVector & getShape() const
Returns this lane's shape.
TRACI_CONST int VAR_CO2EMISSION
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
TRACI_CONST int LANE_LINK_NUMBER
static int getLinkNumber(std::string laneID)
static std::vector< std::string > getAllowed(std::string laneID)
TRACI_CONST int LANE_ALLOWED
static double getLength(std::string laneID)
TRACI_CONST int LAST_STEP_MEAN_SPEED
const SVCPermissions SVCAll
all VClasses are allowed
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
static double getNoiseEmission(std::string laneID)
static double getHCEmission(std::string laneID)
void setLength(double val)
Sets a new length for the lane (used by TraCI only)
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
static std::vector< std::string > getDisallowed(std::string laneID)
static double getWidth(std::string laneID)
static std::vector< std::string > getIDList()
double getWidth() const
Returns the lane's width.
TRACI_CONST int VAR_ELECTRICITYCONSUMPTION
static const MSLane * getLane(const std::string &id)
TRACI_CONST int VAR_HCEMISSION
TRACI_CONST int LAST_STEP_VEHICLE_NUMBER
static double getLastStepOccupancy(std::string laneID)
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
TRACI_CONST int LAST_STEP_OCCUPANCY
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
static double getPMxEmission(std::string laneID)
const std::string & getID() const
Returns the id.
TRACI_CONST int LAST_STEP_LENGTH
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
void rebuildAllowedLanes()
static void setDisallowed(std::string laneID, std::vector< std::string > disallowedClasses)
static const SUMOVTypeParameter & getDefault()
return the default parameters, this is a function due to the http://www.parashift....
const MSEdgeVector & getPredecessors() const