44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
77 std::vector<std::string> ids;
82 std::vector<std::string> ids;
111 unsigned int cnt = 0;
114 tempContent.
writeInt((
int) links.size());
117 for (MSLinkCont::const_iterator i = links.begin(); i != links.end(); ++i) {
125 #ifdef HAVE_INTERNAL_LANES
126 tempContent.
writeString(link->getViaLane() != 0 ? link->getViaLane()->getID() :
"");
177 for (
unsigned int iPoint = 0; iPoint < MIN2(static_cast<size_t>(255), lane->
getShape().size()); ++iPoint) {
219 std::vector<std::string> vehIDs;
221 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
222 vehIDs.push_back((*j)->getID());
236 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
249 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
250 lengthSum += (*j)->getVehicleType().getLength();
253 if (vehs.size() == 0) {
269 if (meanSpeed != 0) {
293 std::string warning =
"";
324 std::vector<std::string> classes;
333 std::vector<std::string> classes;
365 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
367 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.
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)
bool hasApproachingFoe(SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed, SUMOReal decel=DEFAULT_VEH_DECEL) const
Returns the information whether a vehicle is approaching on one of the link's foe streams...
std::vector< MSVehicle * > VehCont
Container for vehicles.
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 readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
const SUMOReal DEFAULT_VEH_LENGTH
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
virtual void writeUnsignedByte(int)
SUMOTime getCurrentTimeStep() const
Returns the current simulation step (in s)
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)
virtual int readUnsignedByte()
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
void setMaxSpeed(SUMOReal val)
static StringBijection< LinkDirection > LinkDirections
const std::string & getID() const
Returns the id.
SUMOReal getHBEFA_HCEmissions() const
Returns the sum of last step HC emissions.
#define RESPONSE_GET_LANE_VARIABLE
void rebuildAllowedLanes()
void add(const MSLane *const l) const
Adds the given object to the container.
return static_cast< size_t >(bytesReceived)
MSLane * getLane() const
Returns the connected lane.
SUMOReal getHBEFA_COEmissions() const
Returns the sum of last step CO emissions.
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.
SUMOReal distance(const Position &p) const
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. ...
SUMOReal getHBEFA_PMxEmissions() const
Returns the sum of last step PMx emissions.
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)
const SVCPermissions SVCFreeForAll
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 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 {.
virtual void writeString(const std::string &s)
#define LAST_STEP_VEHICLE_ID_LIST
bool havePriority() const
Returns whether this link is a major link.
#define CMD_SET_LANE_VARIABLE
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
virtual void writeDouble(double)
SUMOReal getHBEFA_FuelConsumption() const
Returns the sum of last step fuel consumption.
SUMOReal getHBEFA_NOxEmissions() const
Returns the sum of last step NOx emissions.
const PositionVector & myShape
const PositionVector & getShape() const
Returns this lane's shape.
std::vector< std::string > getAllowedVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
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.
SUMOReal getHBEFA_CO2Emissions() const
Returns the sum of last step CO2 emissions.
#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.
Representation of a lane in the micro simulation.
const SUMOReal DEFAULT_VEH_DECEL
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.