SUMO - Simulation of Urban MObility
SUMOVTypeParameter.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Structure representing possible vehicle parameter
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 #ifndef SUMOVTypeParameter_h
00023 #define SUMOVTypeParameter_h
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 #include <string>
00036 #include <map>
00037 #include "SUMOVehicleClass.h"
00038 #include "RGBColor.h"
00039 #include "SUMOTime.h"
00040 
00041 
00042 // ===========================================================================
00043 // class declarations
00044 // ===========================================================================
00045 class OutputDevice;
00046 class OptionsCont;
00047 
00048 
00049 // ===========================================================================
00050 // value definitions
00051 // ===========================================================================
00052 const int VTYPEPARS_LENGTH_SET = 1;
00053 const int VTYPEPARS_MINGAP_SET = 2;
00054 const int VTYPEPARS_MAXSPEED_SET = 2 << 2;
00055 const int VTYPEPARS_PROBABILITY_SET = 2 << 3;
00056 const int VTYPEPARS_SPEEDFACTOR_SET = 2 << 4;
00057 const int VTYPEPARS_SPEEDDEVIATION_SET = 2 << 5;
00058 const int VTYPEPARS_EMISSIONCLASS_SET = 2 << 6;
00059 const int VTYPEPARS_COLOR_SET = 2 << 7;
00060 const int VTYPEPARS_VEHICLECLASS_SET = 2 << 8;
00061 const int VTYPEPARS_WIDTH_SET = 2 << 9;
00062 const int VTYPEPARS_HEIGHT_SET = 2 << 10;
00063 const int VTYPEPARS_SHAPE_SET = 2 << 11;
00064 const int VTYPEPARS_OSGFILE_SET = 2 << 12;
00065 
00066 
00067 // ===========================================================================
00068 // struct definitions
00069 // ===========================================================================
00074 class SUMOVTypeParameter {
00075 public:
00080     SUMOVTypeParameter() ;
00081 
00082 
00087     bool wasSet(int what) const {
00088         return (setParameter & what) != 0;
00089     }
00090 
00091 
00097     void write(OutputDevice& dev) const;
00098 
00101     void validateCFParameter() const;
00102 
00103 
00109     SUMOReal get(const SumoXMLAttr attr, const SUMOReal defaultValue) const;
00110 
00111 
00113     std::string id;
00114 
00116     SUMOReal length;
00118     SUMOReal minGap;
00120     SUMOReal maxSpeed;
00122     SUMOReal defaultProbability;
00124     SUMOReal speedFactor;
00126     SUMOReal speedDev;
00128     SUMOEmissionClass emissionClass;
00130     RGBColor color;
00132     SUMOVehicleClass vehicleClass;
00133 
00134 
00137 
00139     SUMOReal width;
00140 
00142     SUMOReal height;
00143 
00145     SUMOVehicleShape shape;
00146 
00148     std::string osgFile;
00150 
00151 
00153     SumoXMLTag cfModel;
00154 
00156     typedef std::map<SumoXMLAttr, SUMOReal> CFParams;
00157     CFParams cfParameter;
00158 
00160     std::string lcModel;
00161 
00163     int setParameter;
00164 
00165 
00167     mutable bool saved;
00168 
00170     mutable bool onlyReferenced;
00171 
00172 };
00173 
00174 #endif
00175 
00176 /****************************************************************************/
00177 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines