30#include "ns3/applications-module.h"
31#include "ns3/core-module.h"
32#include "ns3/mobility-module.h"
33#include "ns3/netanim-module.h"
34#include "ns3/network-module.h"
106 while ((packet = socket->Recv()))
126#ifdef UAN_PROP_BH_INSTALLED
152 double x =
urv->GetValue();
153 double y =
urv->GetValue();
158 pos->Add(Vector(x, y,
m_depth));
162 mobility.SetPositionAllocator(pos);
163 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
164 mobility.Install(
sink);
168 mobility.Install(
nc);
176 app.SetAttribute(
"OnTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=1.0]"));
177 app.SetAttribute(
"OffTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=0.0]"));
225 sink.Get(
i) =
nullptr;
230 devices.Get(
i) =
nullptr;
249 std::string
perModel =
"ns3::UanPhyPerGenDefault";
250 std::string
sinrModel =
"ns3::UanPhyCalcSinrDefault";
253 cmd.AddValue(
"NumNodes",
"Number of transmitting nodes",
exp.m_numNodes);
254 cmd.AddValue(
"Depth",
"Depth of transmitting and sink nodes",
exp.m_depth);
255 cmd.AddValue(
"RegionSize",
"Size of boundary in meters",
exp.m_boundary);
256 cmd.AddValue(
"PacketSize",
"Generated packet size in bytes",
exp.m_packetSize);
257 cmd.AddValue(
"DataRate",
"DataRate in bps",
exp.m_dataRate);
258 cmd.AddValue(
"CwMin",
"Min CW to simulate",
exp.m_cwMin);
259 cmd.AddValue(
"CwMax",
"Max CW to simulate",
exp.m_cwMax);
260 cmd.AddValue(
"SlotTime",
"Slot time duration",
exp.m_slotTime);
261 cmd.AddValue(
"Averages",
"Number of topologies to test for each cw point",
exp.m_avgs);
262 cmd.AddValue(
"PerModel",
"PER model name",
perModel);
263 cmd.AddValue(
"SinrModel",
"SINR model name",
sinrModel);
284 uan.SetPhy(
"ns3::UanPhyGen",
Helper class for UAN CW MAC example.
void IncrementCw(uint32_t cw)
Increment CW function.
double m_boundary
boundary
std::vector< double > m_throughputs
throughputs
uint32_t m_cwMin
CW minimum.
uint32_t m_cwMax
CW maximum.
void Run(UanHelper &uan)
Run function.
Time m_simTime
simulation time
uint32_t m_dataRate
data rate
uint32_t m_numNodes
number of nodes
uint32_t m_packetSize
packet size
void ReceivePacket(Ptr< Socket > socket)
Receive packet function.
void ResetData()
Reset data function.
NetAnimExperiment()
the experiment
void UpdatePositions(NodeContainer &nodes) const
Update positions function.
uint32_t m_bytesTotal
bytes total
uint32_t m_cwStep
CW step.
a polymophic address class
Interface to network animator.
holds a vector of ns3::Application pointers.
Parse command-line arguments.
AttributeValue implementation for DataRate.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
Vector GetPosition() const
void SetPosition(const Vector &position)
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Instantiate subclasses of ns3::Object.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
void SetTypeId(TypeId tid)
Set the TypeId of this Object.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetPhysicalAddress(const Address address)
Set the destination address.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Give ns3::PacketSocket powers to ns3::Node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static void SetRun(uint64_t run)
Set the run number of simulation.
static uint64_t GetRun()
Get the current run number.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
Object to create transport layer instances that provide a socket API to applications.
static Ptr< Socket > CreateSocket(Ptr< Node > node, TypeId tid)
This method wraps the creation of sockets that is performed on a given node by a SocketFactory specif...
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
a unique identifier for an interface.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
UAN configuration helper.
void SetMac(std::string type, Ts &&... args)
Set MAC attributes.
NetDeviceContainer Install(NodeContainer c) const
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPr...
Container for UanTxModes.
void AppendMode(UanTxMode mode)
Add mode to this list.
AttributeValue implementation for UanModesList.
Class used for calculating SINR of packet in UanPhy.
Calculate packet error probability, based on received SINR and modulation (mode).
static UanTxMode CreateMode(UanTxMode::ModulationType type, uint32_t dataRateBps, uint32_t phyRateSps, uint32_t cfHz, uint32_t bwHz, uint32_t constSize, std::string name)
Abstraction of packet modulation information.
@ FSK
Frequency shift keying.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
void Set(std::string path, const AttributeValue &value)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
AnimationInterface * anim
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
@ LOG_LEVEL_ALL
Print everything.
Ptr< PacketSink > sink
Pointer to the packet sink application.