SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_BTreceiver.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A BT sender
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSDevice_BTreceiver_h
21 #define MSDevice_BTreceiver_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "MSDevice.h"
34 #include <utils/common/SUMOTime.h>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class SUMOVehicle;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
52 class MSDevice_BTreceiver : public MSDevice {
53 public:
56  static void insertOptions(OptionsCont& oc);
57 
58 
69  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
70 
71 
72 public:
75 
85  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos,
86  SUMOReal newPos, SUMOReal newSpeed);
88 
89 
96  void generateOutput() const;
97 
98 
101 
102 
103 private:
109  MSDevice_BTreceiver(SUMOVehicle& holder, const std::string& id, SUMOReal range);
110 
111 
112 private:
115 
116 
117  class MeetingPoint {
118  public:
119  MeetingPoint(SUMOTime t_, const Position& observerPos_, SUMOReal observerSpeed_,
120  const Position& seenPos_, SUMOReal seenSpeed_)
121  : t(t_), observerPos(observerPos_), observerSpeed(observerSpeed_),
122  seenPos(seenPos_), seenSpeed(seenSpeed_) {}
123 
125 
126  public:
132  };
133 
137  class SeenDevice {
138  public:
146  SeenDevice(const MeetingPoint& meetingBegin_)
147  : meetingBegin(meetingBegin_), meetingEnd(meetingBegin_) {}
148 
150 
151  public:
154 
155  };
156 
157 
158  std::map<std::string, SeenDevice*> myCurrentlySeen;
159  std::map<std::string, std::vector<SeenDevice*> > mySeen;
160 
161 private:
164 
167 
168 
169 };
170 
171 
172 #endif
173 
174 /****************************************************************************/
175