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;
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
int repetitionNumber
The number of times the vehicle shall be repeatedly inserted.
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.
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.
virtual void openRouteDistribution(const SUMOSAXAttributes &attrs)=0
void registerLastDepart()
save last depart (only to be used if vehicle is not discarded)
std::string myActiveRouteID
The id of the current route.
SAX-handler base for SUMO-files.
#define WRITE_WARNING(msg)
IDSupplier myIdSupplier
generates numerical ids
static OptionsCont & getOptions()
Retrieves the options.
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
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)
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.
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.
A storage for options typed value containers)
virtual void closeRouteDistribution()=0
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 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