45 std::vector<std::string>
47 std::vector<std::string> ids;
83 std::vector<TraCIConnection>
85 std::vector<TraCIConnection> v;
89 for (MSLinkCont::const_iterator i = links.begin(); i != links.end(); ++i) {
101 v.push_back(
TraCIConnection(approachedLane, hasPrio, isOpen, hasFoe, approachedInternal, state, direction, length));
107 std::vector<std::string>
110 if (permissions ==
SVCAll) {
117 std::vector<std::string>
127 for (PositionVector::const_iterator pi = shp.begin(); pi != shp.end(); ++pi) {
208 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
209 length += (*j)->getVehicleType().getLength();
211 if (vehs.size() > 0) {
212 length = length / (double) vehs.size();
229 if (meanSpeed != 0) {
247 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
257 std::vector<std::string>
260 std::vector<std::string> vehIDs;
262 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
263 vehIDs.push_back((*j)->getID());
269 std::vector<std::string>
271 std::vector<std::string> foeIDs;
276 throw TraCIException(
"No connection from lane '" + laneID +
"' to lane '" + toLaneID +
"'");
279 foeIDs.push_back(foe->getLaneBefore()->getID());
285 std::vector<std::string>
288 const std::vector<const MSLane*> *foeLanes;
289 std::vector<const MSLane*>::const_iterator it;
290 std::vector<std::string> foeIDs;
296 for (it = foeLanes->begin(); foeLanes->end() != it; ++it) {
297 foeIDs.push_back((*it)->getID());
static double getCO2Emission(std::string laneID)
static int getLastStepHaltingNumber(std::string laneID)
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
MSEdge & getEdge() const
Returns the lane's edge.
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
double getWidth() const
Returns the lane's width.
int getVehicleNumber() const
Returns the number of vehicles on this lane (for which this lane is responsible)
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
static double getHCEmission(std::string laneID)
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
static double getLength(std::string laneID)
static std::vector< std::string > getLastStepVehicleIDs(std::string laneID)
double getCOEmissions() const
Returns the sum of last step CO emissions.
static double getWaitingTime(std::string laneID)
const std::vector< MSLink * > & getFoeLinks() const
void setMaxSpeed(double val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
double getLength() const
Returns the length of this link.
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
static void setAllowed(std::string laneID, std::vector< std::string > allowedClasses)
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
MSLane * getViaLane() const
Returns the following inner lane.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
std::vector< std::string > getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
static double getElectricityConsumption(std::string laneID)
static std::string getEdgeID(std::string laneID)
double getLength() const
Returns the lane's length.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static std::vector< std::string > getIDList()
static std::vector< TraCIConnection > getLinks(std::string laneID)
const std::vector< const MSLane * > & getFoeLanes() const
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
static double getNoiseEmission(std::string laneID)
static std::vector< std::string > getInternalFoes(const std::string &laneID)
static StringBijection< LinkState > LinkStates
link states
const SVCPermissions SVCAll
all VClasses are allowed
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static void setDisallowed(std::string laneID, std::vector< std::string > disallowedClasses)
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
static double getWidth(std::string laneID)
static double getLastStepMeanSpeed(std::string laneID)
bool hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime, double speed, double decel) const
Returns the information whether a vehicle is approaching on one of the link's foe streams...
static StringBijection< LinkDirection > LinkDirections
link directions
const std::string & getID() const
Returns the id.
static double getNOxEmission(std::string laneID)
void rebuildAllowedLanes()
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
bool opened(SUMOTime arrivalTime, double arrivalSpeed, double leaveSpeed, double vehicleLength, double impatience, double decel, SUMOTime waitingTime, double posLat=0, std::vector< const SUMOVehicle * > *collectFoes=0, bool ignoreRed=false, const SUMOVehicle *ego=0) const
Returns the information whether the link may be passed.
void setLength(double val)
Sets a new length for the lane (used by TraCI only)
static double getLastStepLength(std::string laneID)
MSLane * getLane() const
Returns the connected lane.
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
const std::string & getString(const T key) const
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
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 double getTraveltime(std::string laneID)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static std::vector< std::string > getFoes(const std::string &laneID, const std::string &toLaneID)
std::vector< MSVehicle * > VehCont
Container for vehicles.
double getMeanSpeed() const
Returns the mean speed on this lane.
static std::string getParameter(const std::string &laneID, const std::string ¶m)
void setPermissions(SVCPermissions permissions, long transientID)
Sets the permissions to the given value. If a transientID is given, the permissions are recored as te...
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
static std::vector< std::string > getAllowed(std::string laneID)
bool havePriority() const
Returns whether this link is a major link.
static TraCIPositionVector getShape(std::string laneID)
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...
static double getLastStepOccupancy(std::string laneID)
static double getFuelConsumption(std::string laneID)
static int getLinkNumber(std::string laneID)
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
const PositionVector & getShape() const
Returns this lane's shape.
static void setParameter(const std::string &routeID, const std::string &key, const std::string &value)
LinkState getState() const
Returns the current state of the link.
static void setLength(std::string laneID, double length)
static const MSLane * getLane(const std::string &id)
static double getCOEmission(std::string laneID)
double getHCEmissions() const
Returns the sum of last step HC emissions.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
static const long CHANGE_PERMISSIONS_PERMANENT
static int getLastStepVehicleNumber(std::string laneID)
static const SUMOVTypeParameter & getDefault()
return the default parameters, this is a function due to the http://www.parashift.com/c++-faq/static-init-order.html
double getWaitingSeconds() const
Returns the overall waiting time on this lane.
Representation of a lane in the micro simulation.
static double getPMxEmission(std::string laneID)
static std::vector< std::string > getDisallowed(std::string laneID)
static void setMaxSpeed(std::string laneID, double speed)
static double getMaxSpeed(std::string laneID)