46 #ifdef CHECK_MEMORY_LEAKS 48 #endif // CHECK_MEMORY_LEAKS 81 std::vector<std::string> ids;
86 std::vector<std::string> ids;
118 tempContent.
writeInt((
int) links.size());
121 for (MSLinkCont::const_iterator i = links.begin(); i != links.end(); ++i) {
129 #ifdef HAVE_INTERNAL_LANES 130 tempContent.
writeString(link->getViaLane() != 0 ? link->getViaLane()->getID() :
"");
169 if (permissions ==
SVCAll) {
182 for (
int iPoint = 0; iPoint <
MIN2(255, (
int)lane->
getShape().size()); ++iPoint) {
228 std::vector<std::string> vehIDs;
230 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
231 vehIDs.push_back((*j)->getID());
245 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
258 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
259 lengthSum += (*j)->getVehicleType().getLength();
262 if (vehs.size() == 0) {
278 if (meanSpeed != 0) {
290 std::string paramName =
"";
311 std::string warning =
"";
343 std::vector<std::string> classes;
352 std::vector<std::string> classes;
401 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
402 if (myShape.distance2D((*j)->getPosition()) <= myRange) {
403 myIDs.insert((*j)->getID());
417 myIDs.insert(l->
getID());
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa3: Get Lane Variable)
#define LAST_STEP_MEAN_SPEED
MSEdge & getEdge() const
Returns the lane's edge.
bool hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed, SUMOReal decel) const
Returns the information whether a vehicle is approaching on one of the link's foe streams...
int getVehicleNumber() const
Returns the number of vehicles on this lane (for which this lane is responsible)
SUMOReal getWaitingSeconds() const
Returns the overall waiting time on this lane.
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc3: Change Lane State)
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
#define CMD_GET_VEHICLE_VARIABLE
#define VAR_CURRENT_TRAVELTIME
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
SUMOReal getLength() const
Returns the lane's length.
void setLength(SUMOReal val)
Sets a new length for the lane (used by TraCI only)
std::vector< std::string > getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
SUMOReal length
The physical vehicle length.
SUMOReal getFuelConsumption() const
Returns the sum of last step fuel consumption.
SUMOReal getWidth() const
Returns the lane's width.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
bool readTypeCheckingString(tcpip::Storage &inputStorage, std::string &into)
Reads the value type and a string, verifying the type.
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
void setPermissions(SVCPermissions permissions)
SUMOReal getElectricityConsumption() const
Returns the sum of last step electricity consumption.
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
static StringBijection< LinkState > LinkStates
const SVCPermissions SVCAll
virtual void writeUnsignedByte(int)
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
#define VAR_NOISEEMISSION
#define VAR_FUELCONSUMPTION
virtual void writeInt(int)
SUMOReal getHCEmissions() const
Returns the sum of last step HC emissions.
SUMOReal distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector) ...
virtual int readUnsignedByte()
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
void setMaxSpeed(SUMOReal val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
static StringBijection< LinkDirection > LinkDirections
const std::string & getID() const
Returns the id.
#define RESPONSE_GET_LANE_VARIABLE
void rebuildAllowedLanes()
bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, SUMOReal posLat=0, std::vector< const SUMOVehicle * > *collectFoes=0) const
Returns the information whether the link may be passed.
void add(const MSLane *const l) const
Adds the given object to the container.
MSLane * getLane() const
Returns the connected lane.
SUMOReal getMeanSpeed() const
Returns the mean speed on this lane.
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
virtual void writeStringList(const std::vector< std::string > &s)
#define CMD_GET_LANE_VARIABLE
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
virtual std::string readString()
#define CMD_GET_EDGE_VARIABLE
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.
TraCI server used to control sumo by a remote TraCI client.
virtual void writeStorage(tcpip::Storage &store)
std::vector< MSVehicle * > VehCont
Container for vehicles.
SUMOReal getLength() const
Returns the length of this link.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
#define LAST_STEP_VEHICLE_NUMBER
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
SUMOReal getNOxEmissions() const
Returns the sum of last step NOx emissions.
SUMOReal getPMxEmissions() const
Returns the sum of last step PMx emissions.
virtual void writeString(const std::string &s)
#define LAST_STEP_VEHICLE_ID_LIST
bool havePriority() const
Returns whether this link is a major link.
static SUMOReal getDefaultDecel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default deceleration for the given vehicle class This needs to be a function because the ...
SUMOReal impatience
The vehicle's impatience (willingness to obstruct others)
std::string toHex(const T i, std::streamsize numDigits=0)
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
#define CMD_SET_LANE_VARIABLE
#define VAR_ELECTRICITYCONSUMPTION
SUMOReal getCOEmissions() const
Returns the sum of last step CO emissions.
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
virtual void writeDouble(double)
const PositionVector & getShape() const
Returns this lane's shape.
LinkState getState() const
Returns the current state of the link.
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
#define LAST_STEP_OCCUPANCY
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
SUMOReal getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
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
Representation of a lane in the micro simulation.
#define LAST_STEP_VEHICLE_HALTING_NUMBER
static bool getShape(const std::string &id, PositionVector &shape)
Returns the named lane's shape.