20 #include "ns3/core-module.h"
21 #include "ns3/mobility-module.h"
29 std::cout <<
Simulator::Now () <<
", pos=" << position <<
", x=" << pos.x <<
", y=" << pos.y
30 <<
", z=" << pos.z << std::endl;
33 int main (
int argc,
char *argv[])
36 cmd.
Parse (argc, argv);
46 "Rho",
StringValue (
"ns3::UniformRandomVariable[Min=0|Max=30]"));
Smart pointer class similar to boost::intrusive_ptr.
Hold variables of type string.
static void Run(void)
Run the simulation.
Vector GetPosition(void) const
void Connect(std::string path, const CallbackBase &cb)
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
static Time Now(void)
Return the current simulation virtual time.
Helper class used to assign positions and mobility models to nodes.
static void CourseChange(std::string context, Ptr< const MobilityModel > position)
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Time Seconds(double value)
Construct a Time in the indicated unit.
void Parse(int argc, char *argv[])
Parse the program arguments.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...