NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-consumer-zipf-mandelbrot.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_CONSUMER_ZIPF_MANDELBROT_H_
23 #define NDN_CONSUMER_ZIPF_MANDELBROT_H_
24 
25 #include "ns3/ndnSIM/model/ndn-common.hpp"
26 
27 #include "ndn-consumer.hpp"
28 #include "ndn-consumer-cbr.hpp"
29 
30 #include "ns3/ptr.h"
31 #include "ns3/log.h"
32 #include "ns3/simulator.h"
33 #include "ns3/packet.h"
34 #include "ns3/callback.h"
35 #include "ns3/string.h"
36 #include "ns3/uinteger.h"
37 #include "ns3/double.h"
38 #include "ns3/random-variable-stream.h"
39 
40 namespace ns3 {
41 namespace ndn {
42 
52 public:
53  static TypeId
54  GetTypeId();
55 
62  virtual ~ConsumerZipfMandelbrot();
63 
64  virtual void
65  SendPacket();
66 
67  uint32_t
68  GetNextSeq();
69 
70 protected:
71  virtual void
73 
74 private:
75  void
76  SetNumberOfContents(uint32_t numOfContents);
77 
78  uint32_t
79  GetNumberOfContents() const;
80 
81  void
82  SetQ(double q);
83 
84  double
85  GetQ() const;
86 
87  void
88  SetS(double s);
89 
90  double
91  GetS() const;
92 
93 private:
94  uint32_t m_N; // number of the contents
95  double m_q; // q in (k+q)^s
96  double m_s; // s in (k+q)^s
97  std::vector<double> m_Pcum; // cumulative probability
98 
99  Ptr<UniformRandomVariable> m_seqRng; // RNG
100 };
101 
102 } /* namespace ndn */
103 } /* namespace ns3 */
104 #endif /* NDN_CONSUMER_ZIPF_MANDELBROT_H_ */
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-app-link-service.cpp:32
ndn-consumer.hpp
ns3::ndn::ConsumerZipfMandelbrot::ConsumerZipfMandelbrot
ConsumerZipfMandelbrot()
Default constructor Sets up randomized Number Generator (RNG) Note: m_seq of its parent class Consume...
Definition: ndn-consumer-zipf-mandelbrot.cpp:60
ns3::ndn::ConsumerZipfMandelbrot::SendPacket
virtual void SendPacket()
Definition: ndn-consumer-zipf-mandelbrot.cpp:126
ns3::ndn::ConsumerCbr
Ndn application for sending out Interest packets at a "constant" rate (Poisson process)
Definition: ndn-consumer-cbr.hpp:34
ns3::ndn::ConsumerZipfMandelbrot
NDN app requesting contents following Zipf-Mandelbrot Distbituion.
Definition: ndn-consumer-zipf-mandelbrot.hpp:51
ns3::ndn::ConsumerZipfMandelbrot::~ConsumerZipfMandelbrot
virtual ~ConsumerZipfMandelbrot()
Definition: ndn-consumer-zipf-mandelbrot.cpp:69
ns3::ndn::ConsumerZipfMandelbrot::ScheduleNextPacket
virtual void ScheduleNextPacket()
Constructs the Interest packet and sends it using a callback to the underlying NDN protocol.
Definition: ndn-consumer-zipf-mandelbrot.cpp:224
ndn-consumer-cbr.hpp
ns3::ndn::ConsumerZipfMandelbrot::GetNextSeq
uint32_t GetNextSeq()
Definition: ndn-consumer-zipf-mandelbrot.cpp:199
ns3::ndn::ConsumerZipfMandelbrot::GetTypeId
static TypeId GetTypeId()
Definition: ndn-consumer-zipf-mandelbrot.cpp:34
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-strategy-choice-helper.hpp:34