SUMO - Simulation of Urban MObility

SUMOVTypeParameter.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 (C) 2001-2011 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 SUMOVTypeParameter_h
00020 #define SUMOVTypeParameter_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 <map>
00034 #include "SUMOVehicleClass.h"
00035 #include "RGBColor.h"
00036 #include "SUMOTime.h"
00037 
00038 
00039 // ===========================================================================
00040 // class declarations
00041 // ===========================================================================
00042 class OutputDevice;
00043 class OptionsCont;
00044 
00045 
00046 // ===========================================================================
00047 // value definitions
00048 // ===========================================================================
00049 const int VTYPEPARS_LENGTH_SET = 1;
00050 const int VTYPEPARS_MINGAP_SET = 2;
00051 const int VTYPEPARS_MAXSPEED_SET = 2 << 2;
00052 const int VTYPEPARS_PROBABILITY_SET = 2 << 3;
00053 const int VTYPEPARS_SPEEDFACTOR_SET = 2 << 4;
00054 const int VTYPEPARS_SPEEDDEVIATION_SET = 2 << 5;
00055 const int VTYPEPARS_EMISSIONCLASS_SET = 2 << 6;
00056 const int VTYPEPARS_COLOR_SET = 2 << 7;
00057 const int VTYPEPARS_VEHICLECLASS_SET = 2 << 8;
00058 const int VTYPEPARS_WIDTH_SET = 2 << 9;
00059 const int VTYPEPARS_SHAPE_SET = 2 << 10;
00060 
00061 
00062 // ===========================================================================
00063 // struct definitions
00064 // ===========================================================================
00069 class SUMOVTypeParameter {
00070 public:
00075     SUMOVTypeParameter() throw();
00076 
00077 
00082     bool wasSet(int what) const throw() {
00083         return (setParameter&what)!=0;
00084     }
00085 
00086 
00092     void write(OutputDevice& dev) const throw(IOError);
00093 
00096     void validateCFParameter() const throw();
00097 
00098 
00100     std::string id;
00101 
00103     SUMOReal length;
00105     SUMOReal minGap;
00107     SUMOReal maxSpeed;
00109     SUMOReal defaultProbability;
00111     SUMOReal speedFactor;
00113     SUMOReal speedDev;
00115     SUMOEmissionClass emissionClass;
00117     RGBColor color;
00119     SUMOVehicleClass vehicleClass;
00120 
00121 
00124 
00126     SUMOReal width;
00127 
00129     SUMOVehicleShape shape;
00131 
00132 
00134     SumoXMLTag cfModel;
00135 
00137     typedef std::map<SumoXMLAttr, SUMOReal> CFParams;
00138     CFParams cfParameter;
00139 
00141     std::string lcModel;
00142 
00144     int setParameter;
00145 
00146 
00148     mutable bool saved;
00149 
00151     mutable bool onlyReferenced;
00152 
00153 };
00154 
00155 #endif
00156 
00157 /****************************************************************************/
00158 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines