45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
79 std::vector<std::string> ids;
84 std::vector<std::string> ids;
113 unsigned int cnt = 0;
116 tempContent.
writeInt((
int) links.size());
119 for (MSLinkCont::const_iterator i = links.begin(); i != links.end(); ++i) {
127 #ifdef HAVE_INTERNAL_LANES
128 tempContent.
writeString(link->getViaLane() != 0 ? link->getViaLane()->getID() :
"");
167 if (permissions ==
SVCAll) {
180 for (
unsigned int iPoint = 0; iPoint < MIN2(static_cast<size_t>(255), lane->
getShape().size()); ++iPoint) {
222 std::vector<std::string> vehIDs;
224 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
225 vehIDs.push_back((*j)->getID());
239 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
252 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
253 lengthSum += (*j)->getVehicleType().getLength();
256 if (vehs.size() == 0) {
272 if (meanSpeed != 0) {
284 std::string paramName =
"";
305 std::string warning =
"";
337 std::vector<std::string> classes;
346 std::vector<std::string> classes;
395 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
397 myIDs.insert((*j)->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...
SUMOReal distance(const Position &p, bool perpendicular=false) const
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.
std::vector< MSVehicle * > VehCont
Container for vehicles.
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)
std::set< std::string > & myIDs
The container.
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.
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()
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)
SUMOReal getLength() const
Returns the length of this link.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
#define LAST_STEP_VEHICLE_NUMBER
unsigned int getVehicleNumber() const
Returns the number of vehicles on this lane.
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
void push_back(const PositionVector &p)
Appends all positions from the given vector.
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)
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
#define CMD_SET_LANE_VARIABLE
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 & myShape
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.
bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, std::vector< const SUMOVehicle * > *collectFoes=0) const
Returns the information whether the link may be passed.
#define LAST_STEP_VEHICLE_HALTING_NUMBER
static bool getShape(const std::string &id, PositionVector &shape)
Returns the named lane's shape.