43 #ifdef CHECK_MEMORY_LEAKS
45 #endif // CHECK_MEMORY_LEAKS
51 using namespace traci;
81 std::vector<std::string> ids;
86 std::vector<std::string> ids;
115 unsigned int cnt = 0;
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() :
"");
181 for (
unsigned int iPoint = 0; iPoint < MIN2(static_cast<size_t>(255), lane->
getShape().size()); ++iPoint) {
223 std::vector<std::string> vehIDs;
225 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
226 vehIDs.push_back((*j)->getID());
240 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
253 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
254 lengthSum += (*j)->getVehicleType().getLength();
257 if (vehs.size() == 0) {
268 if (meanSpeed != 0) {
292 std::string warning =
"";
323 std::vector<std::string> classes;
332 std::vector<std::string> classes;
363 for (std::vector<MSEdge*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
364 const std::vector<MSLane*>& lanes = (*i)->getLanes();
365 for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
366 Boundary b = (*j)->getShape().getBoxBoundary();
#define LAST_STEP_MEAN_SPEED
MSEdge & getEdge() const
Returns the lane's edge.
static void insertIDs(std::vector< std::string > &into)
#define VAR_CURRENT_TRAVELTIME
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
static bool dictionary(std::string id, MSLane *lane)
Inserts a MSLane into the static dictionary Returns true if the key id isn't already in the dictionar...
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...
bool readTypeCheckingDouble(tcpip::Storage &inputStorage, double &into)
Reads the value type and a double, verifying the type.
std::vector< MSVehicle * > VehCont
Container for vehicles.
void writeStatusCmd(int commandId, int status, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage.
SUMOReal getWidth() const
Returns the lane's width.
bool readTypeCheckingStringList(tcpip::Storage &inputStorage, std::vector< std::string > &into)
Reads the value type and a string list, verifying the type.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static bool processSet(traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xc3: Change Lane State)
const SUMOReal DEFAULT_VEH_LENGTH
void setPermissions(SVCPermissions permissions)
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)
#define VAR_NOISEEMISSION
#define VAR_FUELCONSUMPTION
A class that stores a 2D geometrical boundary.
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
TraCI server used to control sumo by a remote TraCI client.
bool writeErrorStatusCmd(int commandId, const std::string &description, tcpip::Storage &outputStorage)
Writes a status command to the given storage with status = RTYPE_ERR.
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()
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.
virtual void writeStringList(const std::vector< std::string > &s)
void addObject(Named *o, Boundary &b)
Adds an additional object (detector/shape/trigger) for visualisation.
#define CMD_GET_LANE_VARIABLE
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
virtual std::string readString()
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.
virtual void writeStorage(tcpip::Storage &store)
const SVCPermissions SVCFreeForAll
static bool processGet(traci::TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xa3: Get Lane Variable)
SUMOReal getLength() const
Returns the length of this link.
#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.
A RT-tree for efficient storing of SUMO's GL-objects.
void writeResponseWithLength(tcpip::Storage &outputStorage, tcpip::Storage &tempMsg)
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
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 & getShape() const
Returns this lane's shape.
const std::vector< MSEdge * > & getEdges() const
Returns loaded edges.
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.
SUMOReal getHBEFA_CO2Emissions() const
Returns the sum of last step CO2 emissions.
#define LAST_STEP_OCCUPANCY
MSEdgeControl & getEdgeControl()
Returns the edge control.
static TraCIRTree * getTree()
Returns a tree filled with inductive loop instances.
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.
SUMOReal getOccupancy() const
Returns the occupancy of this lane during the last step.