SUMOVehicleParameter.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Structure representing possible vehicle parameter
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef SUMOVehicleParameter_h
00020 #define SUMOVehicleParameter_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include "SUMOVehicleClass.h"
00034 #include "RGBColor.h"
00035 #include "SUMOTime.h"
00036 
00037 
00038 // ===========================================================================
00039 // class declarations
00040 // ===========================================================================
00041 class OutputDevice;
00042 class OptionsCont;
00043 
00044 // ===========================================================================
00045 // value definitions
00046 // ===========================================================================
00047 const int VEHPARS_COLOR_SET = 1;
00048 const int VEHPARS_VTYPE_SET = 2;
00049 const int VEHPARS_DEPARTLANE_SET = 4;
00050 const int VEHPARS_DEPARTPOS_SET = 8;
00051 const int VEHPARS_DEPARTSPEED_SET = 16;
00052 const int VEHPARS_PERIODNUM_SET = 32;
00053 const int VEHPARS_PERIODFREQ_SET = 64;
00054 const int VEHPARS_ROUTE_SET = 128;
00055 const int VEHPARS_ARRIVALLANE_SET = 256;
00056 const int VEHPARS_ARRIVALPOS_SET = 512;
00057 const int VEHPARS_ARRIVALSPEED_SET = 1024;
00058 const int VEHPARS_LINE_SET = 2048;
00059 const int VEHPARS_TAZ_SET = 4096;
00060 
00061 
00062 // ===========================================================================
00063 // enum definitions
00064 // ===========================================================================
00070 enum DepartDefinition {
00072     DEPART_GIVEN,
00074     DEPART_TRIGGERED
00075 };
00076 
00077 
00083 enum DepartLaneDefinition {
00085     DEPART_LANE_DEFAULT,
00087     DEPART_LANE_GIVEN,
00089     DEPART_LANE_RANDOM,
00091     DEPART_LANE_FREE,
00093     DEPART_LANE_DEPARTLANE
00094 };
00095 
00096 
00101 enum DepartPosDefinition {
00103     DEPART_POS_DEFAULT,
00105     DEPART_POS_GIVEN,
00107     DEPART_POS_RANDOM,
00109     DEPART_POS_FREE,
00111     DEPART_POS_RANDOM_FREE
00112 };
00113 
00114 
00120 enum DepartSpeedDefinition {
00122     DEPART_SPEED_DEFAULT,
00124     DEPART_SPEED_GIVEN,
00126     DEPART_SPEED_RANDOM,
00128     DEPART_SPEED_MAX
00129 };
00130 
00131 
00137 enum ArrivalLaneDefinition {
00139     ARRIVAL_LANE_DEFAULT,
00141     ARRIVAL_LANE_GIVEN,
00143     ARRIVAL_LANE_CURRENT
00144 };
00145 
00146 
00152 enum ArrivalPosDefinition {
00154     ARRIVAL_POS_DEFAULT,
00156     ARRIVAL_POS_GIVEN,
00158     ARRIVAL_POS_RANDOM,
00160     ARRIVAL_POS_MAX
00161 };
00162 
00163 
00169 enum ArrivalSpeedDefinition {
00171     ARRIVAL_SPEED_DEFAULT,
00173     ARRIVAL_SPEED_GIVEN,
00175     ARRIVAL_SPEED_CURRENT
00176 };
00177 
00178 
00179 // ===========================================================================
00180 // struct definitions
00181 // ===========================================================================
00192 class SUMOVehicleParameter {
00193 public:
00198     SUMOVehicleParameter() throw();
00199 
00200 
00205     bool wasSet(int what) const throw() {
00206         return (setParameter&what)!=0;
00207     }
00208 
00209 
00217     void writeAs(const std::string &xmlElem, OutputDevice &dev,
00218                  const OptionsCont &oc) const throw(IOError);
00219 
00220 
00226     bool defaultOptionOverrides(const OptionsCont &oc, const std::string &optionName) const throw();
00227 
00228 
00229 
00232 
00237     static bool departlaneValidate(const std::string &val) throw();
00238 
00239 
00244     static bool departposValidate(const std::string &val) throw();
00245 
00246 
00251     static bool departspeedValidate(const std::string &val) throw();
00252 
00253 
00258     static bool arrivallaneValidate(const std::string &val) throw();
00259 
00260 
00265     static bool arrivalposValidate(const std::string &val) throw();
00266 
00267 
00272     static bool arrivalspeedValidate(const std::string &val) throw();
00274 
00275 
00276 
00278     std::string id;
00279 
00281     std::string routeid;
00283     std::string vtypeid;
00285     RGBColor color;
00286 
00287 
00290 
00292     SUMOTime depart;
00294     DepartDefinition departProcedure;
00296     int departLane;
00298     DepartLaneDefinition departLaneProcedure;
00300     SUMOReal departPos;
00302     DepartPosDefinition departPosProcedure;
00304     SUMOReal departSpeed;
00306     DepartSpeedDefinition departSpeedProcedure;
00308 
00309 
00312 
00314     int arrivalLane;
00316     ArrivalLaneDefinition arrivalLaneProcedure;
00318     SUMOReal arrivalPos;
00320     ArrivalPosDefinition arrivalPosProcedure;
00322     SUMOReal arrivalSpeed;
00324     ArrivalSpeedDefinition arrivalSpeedProcedure;
00326 
00327 
00330 
00332     int repetitionNumber;
00334     int repetitionsDone;
00336     SUMOReal repetitionOffset;
00338 
00339 
00341     std::string line;
00342 
00344     std::string fromTaz;
00345 
00347     std::string toTaz;
00348 
00352     struct Stop {
00354         std::string lane;
00356         std::string busstop;
00358         SUMOReal pos;
00360         SUMOTime duration;
00362         SUMOTime until;
00363     };
00364 
00366     std::vector<Stop> stops;
00367 
00369     int setParameter;
00370 
00371 };
00372 
00373 #endif
00374 
00375 /****************************************************************************/
00376 

Generated on Wed May 5 00:06:36 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6