00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NLTriggerBuilder_h
00020 #define NLTriggerBuilder_h
00021
00022
00023
00024
00025
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031
00032 #include <string>
00033 #include <vector>
00034
00035
00036
00037
00038
00039 class MSTrigger;
00040 class MSNet;
00041 class MSLaneSpeedTrigger;
00042 class MSEmitter;
00043 class NLHandler;
00044 class MSTriggeredRerouter;
00045 class MSLane;
00046 class MSEdge;
00047 class MSBusStop;
00048 class MSCalibrator;
00049
00050 #ifdef HAVE_MESOSIM
00051 class METriggeredCalibrator;
00052 #endif
00053
00054
00055
00056
00057
00073 class NLTriggerBuilder {
00074 public:
00076 NLTriggerBuilder() throw();
00077
00078
00080 virtual ~NLTriggerBuilder() throw();
00081
00082
00087 void setHandler(NLHandler *handler) throw();
00088
00089
00105 void buildTrigger(MSNet &net, const SUMOSAXAttributes &attrs,
00106 const std::string &base) throw(InvalidArgument);
00107
00108
00118 void buildVaporizer(const SUMOSAXAttributes &attrs) throw();
00119
00120
00125
00126
00141 void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs,
00142 const std::string &base) throw(InvalidArgument);
00143
00144
00152 void parseAndBuildLaneEmitTrigger(MSNet &net, const SUMOSAXAttributes &attrs,
00153 const std::string &base) throw(InvalidArgument);
00154
00155
00163 void parseAndBuildRerouter(MSNet &net, const SUMOSAXAttributes &attrs,
00164 const std::string &base) throw(InvalidArgument);
00165
00166
00173 void parseAndBuildBusStop(MSNet &net, const SUMOSAXAttributes &attrs) throw(InvalidArgument);
00174
00175
00183 void parseAndBuildCalibrator(MSNet &net, const SUMOSAXAttributes &attrs,
00184 const std::string &base) throw(InvalidArgument);
00186
00187
00188 protected:
00197
00198
00210 virtual MSLaneSpeedTrigger* buildLaneSpeedTrigger(MSNet &net,
00211 const std::string &id, const std::vector<MSLane*> &destLanes,
00212 const std::string &file) throw(ProcessError);
00213
00214
00225 virtual void buildLaneEmitTrigger(MSNet &net,
00226 const std::string &id, MSLane *destLane, SUMOReal pos,
00227 const std::string &file) throw();
00228
00229
00241 virtual void buildBusStop(MSNet &net,
00242 const std::string &id, const std::vector<std::string> &lines,
00243 MSLane *lane, SUMOReal frompos, SUMOReal topos) throw();
00244
00245
00257 virtual void buildLaneCalibrator(MSNet &net,
00258 const std::string &id, MSLane *destLane, SUMOReal pos,
00259 const std::string &file) throw();
00260
00261
00262 #ifdef HAVE_MESOSIM
00263
00274 METriggeredCalibrator* buildCalibrator(MSNet &net,
00275 const std::string &id, const MSEdge *edge, SUMOReal pos,
00276 const std::string &file, const std::string &outfile,
00277 const SUMOTime freq) throw();
00278 #endif
00279
00280
00291 virtual void buildRerouter(MSNet &net,
00292 const std::string &id, std::vector<MSEdge*> &edges,
00293 SUMOReal prob, const std::string &file, bool off) throw();
00295
00296
00297 protected:
00300
00312 std::string getFileName(const SUMOSAXAttributes &attrs,
00313 const std::string &base,
00314 const bool allowEmpty=false) throw(InvalidArgument);
00315
00316
00328 MSLane *getLane(const SUMOSAXAttributes &attrs,
00329 const std::string &tt, const std::string &tid) throw(InvalidArgument);
00330
00331
00345 SUMOReal getPosition(const SUMOSAXAttributes &attrs,
00346 MSLane *lane, const std::string &tt, const std::string &tid) throw(InvalidArgument);
00348
00349
00350 protected:
00352 bool myHaveInformedAboutDeprecatedTriggerDefinition;
00353
00355 bool myHaveInformedAboutDeprecatedEmitter;
00356
00358 NLHandler* myHandler;
00359
00360 };
00361
00362
00363 #endif
00364
00365
00366