A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
buildings-mobility-model.h
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Marco Miozzo <marco.miozzo@cttc.es>
19  *
20  */
21 #ifndef BUILDINGS_MOBILITY_MODEL_H
22 #define BUILDINGS_MOBILITY_MODEL_H
23 
24 
25 
26 #include <ns3/mobility-model.h>
27 #include <ns3/ptr.h>
28 #include <ns3/object.h>
29 #include <ns3/box.h>
30 #include <map>
31 #include <ns3/building.h>
32 #include <ns3/constant-velocity-helper.h>
33 
34 
35 
36 namespace ns3 {
37 
38 
48 {
49 public:
50  static TypeId GetTypeId (void);
52 
57  bool IsIndoor (void);
58 
63  bool IsOutdoor (void);
64 
73  void SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
74 
79  void SetOutdoor ();
80 
85  uint8_t GetFloorNumber (void);
86 
91  uint8_t GetRoomNumberX (void);
92 
97  uint8_t GetRoomNumberY (void);
98 
104 
105 
106 
107 private:
108  virtual void DoDispose (void);
109  virtual Vector DoGetPosition (void) const;
110  virtual void DoSetPosition (const Vector &position);
111  virtual Vector DoGetVelocity (void) const;
112  ConstantVelocityHelper m_helper;
113 
114  Ptr<Building> m_myBuilding;
115  bool m_indoor;
116  uint8_t m_nFloor;
117  uint8_t m_roomX;
118  uint8_t m_roomY;
119 
120 };
121 
122 
123 
124 } // namespace ns3
125 
126 
127 #endif // BUILDINGS_MOBILITY_MODEL_H
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
virtual Vector DoGetPosition(void) const
Utility class used to move node with constant velocity.
a 3d vector
Definition: vector.h:31
Keep track of the current position and velocity of an object.
virtual void DoSetPosition(const Vector &position)
Buildings mobility model.
virtual Vector DoGetVelocity(void) const
void SetIndoor(Ptr< Building > building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
a unique identifier for an interface.
Definition: type-id.h:44