62 #ifdef CHECK_MEMORY_LEAKS 64 #endif // CHECK_MEMORY_LEAKS 92 WRITE_ERROR(
"Unknown edge ('" +
id +
"') referenced in a vaporizer.");
101 WRITE_ERROR(
"A vaporization begin time is negative (edge id='" +
id +
"').");
105 WRITE_ERROR(
"A vaporization ends before it starts (edge id='" +
id +
"').");
120 const std::string& base) {
132 throw InvalidArgument(
"The lanes to use within MSLaneSpeedTrigger '" +
id +
"' are not known.");
134 std::vector<MSLane*> lanes;
135 std::vector<std::string> laneIDs;
137 for (std::vector<std::string>::iterator i = laneIDs.begin(); i != laneIDs.end(); ++i) {
140 throw InvalidArgument(
"The lane to use within MSLaneSpeedTrigger '" +
id +
"' is not known.");
142 lanes.push_back(lane);
144 if (lanes.size() == 0) {
145 throw InvalidArgument(
"No lane defined for MSLaneSpeedTrigger '" +
id +
"'.");
182 throw InvalidArgument(
"Invalid position for Charging Station '" +
id +
"'.");
186 buildChargingStation(net,
id, lane, frompos, topos, chargingPower, efficiency, chargeInTransit, ChargeDelay);
208 std::vector<std::string> lines;
233 const std::string& base) {
248 if (routeProbe !=
"") {
267 const std::string& base) {
278 throw InvalidArgument(
"The edge to use within MSTriggeredRerouter '" +
id +
"' is not known.");
281 std::vector<std::string> edgeIDs;
283 for (std::vector<std::string>::iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
286 throw InvalidArgument(
"The edge to use within MSTriggeredRerouter '" +
id +
"' is not known.");
288 edges.push_back(edge);
290 if (edges.size() == 0) {
291 throw InvalidArgument(
"No edges found for MSTriggeredRerouter '" +
id +
"'.");
296 throw InvalidArgument(
"Could not parse MSTriggeredRerouter '" +
id +
"'.");
313 const std::vector<MSLane*>& destLanes,
314 const std::string& file) {
322 const std::string& file,
323 const std::string& outfile,
332 const std::string& file,
333 const std::string& outfile,
342 SUMOReal prob,
const std::string& file,
bool off) {
349 const std::vector<std::string>& lines,
362 SUMOReal chargingPower,
SUMOReal efficiency,
bool chargeInTransit,
int ChargeDelay) {
366 delete chargingStation;
367 throw InvalidArgument(
"Could not build Charging Station '" +
id +
"'; probably declared twice.");
373 const std::string& base,
374 const bool allowEmpty) {
394 const std::string& tt,
395 const std::string& tid) {
400 throw InvalidArgument(
"The lane " + objectid +
" to use within the " + tt +
" '" + tid +
"' is not known.");
409 const std::string& tt,
const std::string& tid) {
423 throw InvalidArgument(
"The position of " + tt +
" '" + tid +
"' lies beyond the lane's '" + lane->
getID() +
"' length.");
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
void parseAndBuildCalibrator(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a mesoscopic or microscopic calibrator.
SUMOReal getLength() const
Returns the lane's length.
SumoXMLTag
Numbers representing SUMO-XML - element names.
virtual MSCalibrator * buildCalibrator(MSNet &net, const std::string &id, MSEdge *edge, SUMOReal pos, const std::string &file, const std::string &outfile, const SUMOTime freq, const MSRouteProbe *probe)
builds a microscopic calibrator
virtual void buildChargingStation(MSNet &net, const std::string &id, MSLane *lane, SUMOReal frompos, SUMOReal topos, SUMOReal chargingPower, SUMOReal efficiency, bool chargeInTransit, int ChargeDelay)
Builds a charging Station.
MSEdge & getEdge() const
Returns the lane's edge.
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
void addAccess(MSNet &net, const SUMOSAXAttributes &attrs)
Parses the values and adds an access point to the currently parsed stopping place.
A lane area vehicles can halt at.
Writes routes of vehicles passing a certain edge.
T get(const std::string &id) const
Retrieves an item.
void parseAndBuildChargingStation(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a charging station.
void parseAndBuildRerouter(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a rerouter.
static bool checkStopPos(SUMOReal &startPos, SUMOReal &endPos, const SUMOReal laneLength, const SUMOReal minLength, const bool friendlyPos)
check start and end position of a stop
bool addBusStop(MSStoppingPlace *busStop)
Adds a bus stop.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary...
SUMOTime incVaporization(SUMOTime t)
Enables vaporization.
const std::string & getID() const
Returns the id.
NLTriggerBuilder()
Constructor.
Base (microsim) event class.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
virtual ~NLTriggerBuilder()
Destructor.
SUMOTime decVaporization(SUMOTime t)
Disables vaporization.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
The simulated network and simulation perfomer.
static OptionsCont & getOptions()
Retrieves the options.
Changes the speed allowed on a set of lanes.
virtual void buildStoppingPlace(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos, const SumoXMLTag element)
Builds a stopping place.
A road/street connecting two junctions.
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
SUMOReal getPosition(const SUMOSAXAttributes &attrs, MSLane *lane, const std::string &tt, const std::string &tid)
returns the position on the lane checking it
Encapsulated SAX-Attributes.
Calibrates the flow on a segment to a specified one.
NLHandler * myHandler
The parent handler to set for subhandlers.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
A wrapper for a Command function.
void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a lane speed trigger.
void registerParent(const int tag, GenericSAXHandler *handler)
Assigning a parent handler which is enabled when the specified tag is closed.
MSStoppingPlace * myCurrentStop
The currently parsed stop to add access points to.
SUMOTime string2time(const std::string &r)
void parseAndBuildStoppingPlace(MSNet &net, const SUMOSAXAttributes &attrs, const SumoXMLTag element)
Parses the values and builds a stopping places for busses, trains or container vehicles.
virtual void addAccess(MSLane *lane, const SUMOReal pos)
adds an access point to this stop
virtual MSLaneSpeedTrigger * buildLaneSpeedTrigger(MSNet &net, const std::string &id, const std::vector< MSLane *> &destLanes, const std::string &file)
Builds a lane speed trigger.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
MSDetectorControl & getDetectorControl()
Returns the detector control.
std::string getFileName(const SUMOSAXAttributes &attrs, const std::string &base, const bool allowEmpty=false)
Helper method to obtain the filename.
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
The XML-Handler for network loading.
Reroutes vehicles passing an edge.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
bool addContainerStop(MSStoppingPlace *containerStop)
Adds a container stop.
bool addChargingStation(MSChargingStation *chargingStation)
Adds a chargingg station.
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
virtual METriggeredCalibrator * buildMECalibrator(MSNet &net, const std::string &id, const MSEdge *edge, SUMOReal pos, const std::string &file, const std::string &outfile, const SUMOTime freq, MSRouteProbe *probe)
builds a mesoscopic calibrator
SUMOReal getLength() const
return the length of the edge
static MELoop * gMesoNet
mesoscopic simulation infrastructure
Calibrates the flow on a segment to a specified one.
Patch the time in a way that it is at least as high as the simulation begin time. ...
virtual MSTriggeredRerouter * buildRerouter(MSNet &net, const std::string &id, MSEdgeVector &edges, SUMOReal prob, const std::string &file, bool off)
builds an rerouter
std::vector< MSEdge * > MSEdgeVector
const NamedObjectCont< MSDetectorFileOutput * > & getTypedDetectors(SumoXMLTag type) const
Returns the list of detectors of the given type.
Representation of a lane in the micro simulation.
void buildVaporizer(const SUMOSAXAttributes &attrs)
Builds a vaporization.
MSLane * getLane(const SUMOSAXAttributes &attrs, const std::string &tt, const std::string &tid)
Returns the lane defined by attribute "lane".