46 #ifdef CHECK_MEMORY_LEAKS
48 #endif // CHECK_MEMORY_LEAKS
56 myVehicleParameter(0),
58 myActiveRouteColor(0),
200 const SUMOReal minLength,
const bool friendlyPos) {
201 if (minLength > laneLength) {
205 startPos += laneLength;
208 endPos += laneLength;
210 if (endPos < minLength || endPos > laneLength) {
214 if (endPos < minLength) {
217 if (endPos > laneLength) {
221 if (startPos < 0 || startPos > endPos - minLength) {
228 if (startPos > endPos - minLength) {
229 startPos = endPos - minLength;
270 errorSuffix =
" at '" + stop.
busstop +
"'" + errorSuffix;
272 errorSuffix =
" on lane '" + stop.
busstop +
"'" + errorSuffix;
283 errorOutput->
inform(
"Invalid duration or end time is given for a stop" + errorSuffix);
290 errorOutput->
inform(
"Invalid bool for 'triggered' or 'parking' for stop" + errorSuffix);
296 std::set<std::string> personIDs;
303 }
else if (idx ==
"fit") {
307 if (!ok || stop.
index < 0) {
308 errorOutput->
inform(
"Invalid 'index' for stop" + errorSuffix);
virtual void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)=0
static SUMOVehicleParameter * parseVehicleAttributes(const SUMOSAXAttributes &attrs, bool optionalID=false, bool skipDepart=false)
Parses a vehicle's attributes.
virtual void myEndElement(int element)
Called when a closing tag occurs.
const int VEHPARS_FORCE_REROUTE
static void parseStringSet(const std::string &def, std::set< std::string > &into)
Splits the given string, stores it in a set.
int repetitionNumber
The number of times the vehicle shall be repeatedly inserted.
bool parking
whether the vehicle is removed from the net while stopping
SUMOTime duration
The stopping duration.
SUMOVehicleParameter * myVehicleParameter
Parameter of the current vehicle, trip, person, or flow.
SUMOTime myEndDefault
The default value for flow ends.
virtual void addStop(const SUMOSAXAttributes &attrs)=0
Processing of a stop.
static bool checkStopPos(SUMOReal &startPos, SUMOReal &endPos, const SUMOReal laneLength, const SUMOReal minLength, const bool friendlyPos)
check start and end position of a stop
SUMOVTypeParameter * myCurrentVType
The currently parsed vehicle type.
SUMOTime until
The time at which the vehicle may continue its journey.
virtual void openRouteDistribution(const SUMOSAXAttributes &attrs)=0
void registerLastDepart()
save last depart (only to be used if vehicle is not discarded)
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
std::string myActiveRouteID
The id of the current route.
SAX-handler base for SUMO-files.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
#define WRITE_WARNING(msg)
IDSupplier myIdSupplier
generates numerical ids
static OptionsCont & getOptions()
Retrieves the options.
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.
std::string busstop
(Optional) bus stop if one is assigned to the stop
SUMOTime myBeginDefault
The default value for flow begins.
const std::string & getFileName() const
returns the current file name
std::string getNext()
Returns the next id.
virtual void closeVehicle()=0
Ends the processing of a vehicle.
Encapsulated SAX-Attributes.
static SUMOVehicleParameter * parseFlowAttributes(const SUMOSAXAttributes &attrs, const SUMOTime beginDefault, const SUMOTime endDefault)
Parses a flow's attributes.
void addParam(const SUMOSAXAttributes &attrs)
assign arbitrary vehicle parameters
bool triggered
whether an arriving person lets the vehicle continue
virtual ~SUMORouteHandler()
standard destructor
SUMOTime depart
The vehicle's departure time.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOTime string2time(const std::string &r)
const int STOP_EXPECTED_SET
SUMORouteHandler(const std::string &file)
standard constructor
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
virtual void closeRoute(const bool mayBeDisconnected=false)=0
void addParameter(const std::string &key, const std::string &value)
Adds a parameter.
const int STOP_PARKING_SET
const int STOP_TRIGGER_SET
static void closeVTypeParsing(SUMOVTypeParameter &vtype)
Closes parsing of the vehicle type.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
virtual void closeVehicleTypeDistribution()=0
SUMOTime myLastDepart
The insertion time of the vehicle read last.
int setParameter
Information for the router which parameter were set.
Definition of vehicle stop (position and duration)
bool parseStop(SUMOVehicleParameter::Stop &stop, const SUMOSAXAttributes &attrs, std::string errorSuffix, MsgHandler *const errorOutput)
parses attributes common to all stops
void inform(std::string msg, bool addType=true)
adds a new error to the list
A storage for options typed value containers)
int index
at which position in the stops list
virtual void closeRouteDistribution()=0
int setParameter
Information for the output which parameter were set.
virtual void closeFlow()=0
Ends the processing of a flow.
virtual void closePerson()=0
Ends the processing of a person.
SUMOTime getLastDepart() const
Returns the last loaded depart time.
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.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
static SUMOVTypeParameter * beginVTypeParsing(const SUMOSAXAttributes &attrs, const std::string &file)
Starts to parse a vehicle type.
bool checkLastDepart()
Checks whether the route file is sorted by departure time if needed.
std::string id
The vehicle's id.
virtual void openRoute(const SUMOSAXAttributes &attrs)=0