46 std::vector<std::string>
48 std::vector<std::string> ids;
84 std::vector<TraCIConnection>
86 std::vector<TraCIConnection> v;
90 for (MSLinkCont::const_iterator i = links.begin(); i != links.end(); ++i) {
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());
270 std::vector<std::string>
272 std::vector<std::string> foeIDs;
277 throw TraCIException(
"No connection from lane '" + laneID +
"' to lane '" + toLaneID +
"'");
280 foeIDs.push_back(foe->getLaneBefore()->getID());
286 std::vector<std::string>
289 const std::vector<const MSLane*>* foeLanes;
290 std::vector<const MSLane*>::const_iterator it;
291 std::vector<std::string> foeIDs;
297 for (it = foeLanes->begin(); foeLanes->end() != it; ++it) {
298 foeIDs.push_back((*it)->getID());
static double getCO2Emission(std::string laneID)
static double getLength(std::string laneID)
static double getNOxEmission(std::string laneID)
static void setAllowed(std::string laneID, std::vector< std::string > allowedClasses)
static std::vector< std::string > getFoes(const std::string &laneID, const std::string &toLaneID)
static std::vector< TraCIConnection > getLinks(std::string laneID)
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
MSEdge & getEdge() const
Returns the lane's edge.
static std::string getEdgeID(std::string laneID)
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
MSLane * getLane() const
Returns the connected lane.
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
static void setParameter(const std::string &routeID, const std::string &key, const std::string &value)
void setMaxSpeed(double val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
const std::string & getString(const T key) const
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 std::vector< std::string > getAllowed(std::string laneID)
static std::vector< std::string > getInternalFoes(const std::string &laneID)
static double getElectricityConsumption(std::string laneID)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static double getFuelConsumption(std::string laneID)
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
double getLength() const
Returns the lane's length.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
const PositionVector & getShape() const
Returns this lane's shape.
static int getLastStepHaltingNumber(std::string laneID)
static double getWidth(std::string laneID)
static int getLastStepVehicleNumber(std::string laneID)
const std::string & getID() const
Returns the id.
static StringBijection< LinkState > LinkStates
link states
const SVCPermissions SVCAll
all VClasses are allowed
static double getMaxSpeed(std::string laneID)
double getWidth() const
Returns the lane's width.
static double getPMxEmission(std::string laneID)
LinkState getState() const
Returns the current state of the link.
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
static StringBijection< LinkDirection > LinkDirections
link directions
static double getLastStepLength(std::string laneID)
void rebuildAllowedLanes()
MSLane * getViaLane() const
Returns the following inner lane.
static double getHCEmission(std::string laneID)
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
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)
const std::vector< const MSLane * > & getFoeLanes() const
static double getLastStepMeanSpeed(std::string laneID)
int getVehicleNumber() const
Returns the number of vehicles on this lane (for which this lane is responsible)
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
static TraCIPositionVector getShape(std::string laneID)
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
bool havePriority() const
Returns whether this link is a major link.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static void setMaxSpeed(std::string laneID, double speed)
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
static void setDisallowed(std::string laneID, std::vector< std::string > disallowedClasses)
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 ...
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
double getHCEmissions() const
Returns the sum of last step HC emissions.
std::vector< MSVehicle * > VehCont
Container for vehicles.
double getLength() const
Returns the length of this link.
static const MSLane * getLane(const std::string &id)
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...
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
const std::vector< MSLink * > & getFoeLinks() const
double getCOEmissions() const
Returns the sum of last step CO emissions.
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 std::vector< std::string > getLastStepVehicleIDs(std::string laneID)
static double getWaitingTime(std::string laneID)
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
static double getTraveltime(std::string laneID)
static void setLength(std::string laneID, double length)
double getMeanSpeed() const
Returns the mean speed on this lane.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
static const long CHANGE_PERMISSIONS_PERMANENT
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
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Representation of a lane in the micro simulation.
double getWaitingSeconds() const
Returns the overall waiting time on this lane.
static double getNoiseEmission(std::string laneID)
static double getLastStepOccupancy(std::string laneID)
static std::vector< std::string > getDisallowed(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 int getLinkNumber(std::string laneID)
static double getCOEmission(std::string laneID)
static std::vector< std::string > getIDList()