00001 /****************************************************************************/ 00007 // A storage for optional things to compute 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 00020 00021 // =========================================================================== 00022 // included modules 00023 // =========================================================================== 00024 #ifdef _MSC_VER 00025 #include <windows_config.h> 00026 #else 00027 #include <config.h> 00028 #endif 00029 00030 #include <iostream> 00031 #include "MSVehicle.h" 00032 #include "MSCORN.h" 00033 #include <utils/iodevices/OutputDevice.h> 00034 #include <utils/common/StringUtils.h> 00035 00036 #ifdef CHECK_MEMORY_LEAKS 00037 #include <foreign/nvwa/debug_new.h> 00038 #endif // CHECK_MEMORY_LEAKS 00039 00040 00041 // =========================================================================== 00042 // static member definitions 00043 // =========================================================================== 00044 bool MSCORN::myWished[CORN_MAX]; 00045 bool MSCORN::myFirstCall[CORN_MAX]; 00046 00047 00048 // =========================================================================== 00049 // method definitions 00050 // =========================================================================== 00051 void 00052 MSCORN::init() { 00053 // TrafficOnline output files & settings 00054 for (int i=0; i<CORN_MAX; ++i) { 00055 myWished[i] = false; 00056 myFirstCall[i] = true; 00057 } 00058 } 00059 00060 00061 bool 00062 MSCORN::wished(Function f) { 00063 return myWished[(int) f]; 00064 } 00065 00066 00067 void 00068 MSCORN::setWished(Function f) { 00069 myWished[(int) f] = true; 00070 switch (f) { 00071 case CORN_OUT_TRIPDURATIONS: 00072 setWished(CORN_VEH_DEPART_INFO); 00073 setWished(CORN_VEH_ARRIVAL_INFO); 00074 setWished(CORN_VEH_WAITINGTIME); 00075 setWished(CORN_VEH_VAPORIZED); 00076 break; 00077 case CORN_OUT_VEHROUTES: 00078 setWished(CORN_VEH_DEPART_TIME); 00079 setWished(CORN_VEH_SAVEREROUTING); 00080 setWished(CORN_VEH_DEPART_INFO); 00081 setWished(CORN_VEH_ARRIVAL_INFO); 00082 break; 00083 case CORN_OUT_EMISSIONS: 00084 setWished(CORN_MEAN_VEH_TRAVELTIME); 00085 setWished(CORN_MEAN_VEH_WAITINGTIME); 00086 break; 00087 case CORN_MEAN_VEH_TRAVELTIME: 00088 setWished(CORN_VEH_DEPART_TIME); 00089 break; 00090 case CORN_MEAN_VEH_WAITINGTIME: 00091 setWished(CORN_VEH_DEPART_TIME); 00092 break; 00093 default: 00094 break; 00095 } 00096 } 00097 00098 00099 00100 /****************************************************************************/ 00101
1.5.6