16 * along with this program; if not, write to the Free Software |
16 * along with this program; if not, write to the Free Software |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 * |
18 * |
19 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
19 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
20 */ |
20 */ |
21 #ifndef NS2_MOBILE_FILE_TOPOLOGY_H |
21 #ifndef NS2_MOBILITY_FILE_TOPOLOGY_H |
22 #define NS2_MOBILE_FILE_TOPOLOGY_H |
22 #define NS2_MOBILITY_FILE_TOPOLOGY_H |
23 |
23 |
24 #include <string> |
24 #include <string> |
25 #include <stdint.h> |
25 #include <stdint.h> |
26 #include "ns3/ptr.h" |
26 #include "ns3/ptr.h" |
27 #include "ns3/object.h" |
27 #include "ns3/object.h" |
28 #include "static-speed-mobility-model.h" |
28 #include "static-speed-mobility-model.h" |
29 |
29 |
30 namespace ns3 { |
30 namespace ns3 { |
31 |
31 |
32 class Ns2MobileFileTopology |
32 /** |
|
33 * \brief a topology object which can read ns2's movement files |
|
34 * generated by the CMU setdest tool. |
|
35 */ |
|
36 class Ns2MobilityFileTopology |
33 { |
37 { |
34 public: |
38 public: |
35 Ns2MobileFileTopology (std::string filename); |
39 /** |
|
40 * \param filename filename of file which contains the |
|
41 * ns2 movement trace. |
|
42 */ |
|
43 Ns2MobilityFileTopology (std::string filename); |
36 |
44 |
|
45 /** |
|
46 * Read the ns2 trace file and configure the movement |
|
47 * patterns of all nodes contained in the global ns3::NodeList |
|
48 * whose nodeId is matches the nodeId of the nodes in the trace |
|
49 * file. |
|
50 */ |
37 void Layout (void) const; |
51 void Layout (void) const; |
|
52 |
|
53 /** |
|
54 * \param begin an iterator which points to the start of the input |
|
55 * object array. |
|
56 * \param end an iterator which points to the end of the input |
|
57 * object array. |
|
58 * |
|
59 * Read the ns2 trace file and configure the movement |
|
60 * patterns of all input objects. Each input object |
|
61 * is identified by a unique node id which reflects |
|
62 * the index of the object in the input array. |
|
63 */ |
38 template <typename T> |
64 template <typename T> |
39 void Layout (T begin, T end) const; |
65 void Layout (T begin, T end) const; |
40 private: |
66 private: |
41 class ObjectStore |
67 class ObjectStore |
42 { |
68 { |