Add CommandLine to all examples
This commit is contained in:
@@ -99,6 +99,9 @@ int main (int argc, char *argv[])
|
||||
std::string adj_mat_file_name ("examples/matrix-topology/adjacency_matrix.txt");
|
||||
std::string node_coordinates_file_name ("examples/matrix-topology/node_coordinates.txt");
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
// ---------- End of Simulation Variables ----------------------------------
|
||||
|
||||
// ---------- Read Adjacency Matrix ----------------------------------------
|
||||
|
||||
@@ -175,6 +175,9 @@ RxDrop (Ptr<const Packet> p)
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
NodeContainer nodes;
|
||||
nodes.Create (2);
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
Time::SetResolution (Time::NS);
|
||||
LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||||
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
|
||||
@@ -192,6 +192,9 @@ RxDrop (Ptr<PcapFileWrapper> file, Ptr<const Packet> p)
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
NodeContainer nodes;
|
||||
nodes.Create (2);
|
||||
|
||||
|
||||
@@ -50,8 +50,11 @@ using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("Test-block-ack");
|
||||
|
||||
int main (int argc, char const* argv[])
|
||||
int main (int argc, char * argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
LogComponentEnable ("EdcaTxopN", LOG_LEVEL_DEBUG);
|
||||
LogComponentEnable ("BlockAckManager", LOG_LEVEL_INFO);
|
||||
|
||||
|
||||
@@ -177,6 +177,9 @@ void experiment (bool enableCtsRts)
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
std::cout << "Hidden station experiment with RTS/CTS disabled:\n" << std::flush;
|
||||
experiment (false);
|
||||
std::cout << "------------------------------------------------\n";
|
||||
|
||||
@@ -24,4 +24,6 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
NS_LOG_UNCOND ("Scratch Simulator");
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@ NS_OBJECT_ENSURE_REGISTERED (ConfigExample);
|
||||
//
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
Config::SetDefault ("ns3::ConfigExample::TestInt16", IntegerValue (-5));
|
||||
|
||||
Ptr<ConfigExample> a_obj = CreateObject<ConfigExample> ();
|
||||
|
||||
@@ -145,6 +145,9 @@ test (void)
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
while (true)
|
||||
{
|
||||
test ();
|
||||
|
||||
@@ -48,7 +48,8 @@ def CancelledEvent():
|
||||
print "I should never be called... "
|
||||
|
||||
def main(dummy_argv):
|
||||
|
||||
ns.core.CommandLine().Parse(dummy_argv)
|
||||
|
||||
model = MyModel()
|
||||
v = ns.core.UniformRandomVariable()
|
||||
v.SetAttribute("Min", ns.core.DoubleValue (10))
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/simulator.h"
|
||||
#include "ns3/command-line.h"
|
||||
#include "ns3/simple-device-energy-model.h"
|
||||
#include "ns3/li-ion-energy-source.h"
|
||||
#include "ns3/energy-source-container.h"
|
||||
@@ -60,7 +61,10 @@ PrintCellInfo (Ptr<LiIonEnergySource> es)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
// uncomment below to see the energy consumption details
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
// uncomment below to see the energy consumption details
|
||||
// LogComponentEnable ("LiIonEnergySource", LOG_LEVEL_DEBUG);
|
||||
|
||||
Ptr<Node> node = CreateObject<Node> ();
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "ns3/simulator.h"
|
||||
#include "ns3/double.h"
|
||||
#include "ns3/config.h"
|
||||
#include "ns3/command-line.h"
|
||||
#include "ns3/string.h"
|
||||
#include "ns3/yans-wifi-helper.h"
|
||||
#include <cmath>
|
||||
@@ -636,6 +637,9 @@ BatteryLifetimeTest::CreateLoadProfiles (void)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
NS_LOG_DEBUG ("Constant load run.");
|
||||
|
||||
BatteryLifetimeTest test;
|
||||
|
||||
@@ -35,6 +35,9 @@ NS_LOG_COMPONENT_DEFINE ("DummyNetworkExample");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
NodeContainer nodes;
|
||||
nodes.Create (2);
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ NS_LOG_COMPONENT_DEFINE ("TAPPing6Example");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
NS_LOG_INFO ("Ping6 Emulation Example with TAP");
|
||||
|
||||
//
|
||||
|
||||
@@ -35,6 +35,8 @@ NS_LOG_COMPONENT_DEFINE ("RealtimeDummyNetworkExample");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
GlobalValue::Bind ("SimulatorImplementationType", StringValue ("ns3::RealtimeSimulatorImpl"));
|
||||
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
|
||||
|
||||
@@ -56,7 +56,9 @@ NS_LOG_COMPONENT_DEFINE ("RealtimeFdNetDeviceSaturationExample");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
uint16_t sinkPort = 8000;
|
||||
uint32_t packetSize = 10000; // bytes
|
||||
std::string dataRate("1000Mb/s");
|
||||
|
||||
@@ -87,6 +87,9 @@ RunSimulation (void)
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
RunSimulation ();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/test.h>
|
||||
#include <ns3/command-line.h>
|
||||
#include <ns3/packet.h>
|
||||
#include <ns3/lr-wpan-phy.h>
|
||||
#include <ns3/lr-wpan-mac.h>
|
||||
@@ -54,6 +55,9 @@ void SendOnePacket (Ptr<LrWpanPhy> sender, Ptr<LrWpanPhy> receiver)
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
LogComponentEnableAll (LOG_PREFIX_FUNC);
|
||||
LogComponentEnable ("LrWpanPhy", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("SingleModelSpectrumChannel", LOG_LEVEL_ALL);
|
||||
|
||||
@@ -45,6 +45,9 @@ int main (int argc, char *argv[])
|
||||
Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (true));
|
||||
Config::SetDefault ("ns3::LteUePowerControl::Alpha", DoubleValue (1.0));
|
||||
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
|
||||
|
||||
uint8_t bandwidth = 25;
|
||||
|
||||
@@ -26,6 +26,9 @@ using namespace ns3;
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
NodeContainer sta;
|
||||
sta.Create (4);
|
||||
MobilityHelper mobility;
|
||||
|
||||
@@ -45,6 +45,9 @@ NS_LOG_COMPONENT_DEFINE ("NixSimpleExample");
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
|
||||
LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "ns3/constant-position-mobility-model.h"
|
||||
|
||||
#include "ns3/config.h"
|
||||
#include "ns3/command-line.h"
|
||||
#include "ns3/string.h"
|
||||
#include "ns3/boolean.h"
|
||||
#include "ns3/double.h"
|
||||
@@ -218,6 +219,9 @@ TestDeterministicByTime (Ptr<PropagationLossModel> model,
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
GnuplotCollection gnuplots ("main-propagation-loss.pdf");
|
||||
|
||||
{
|
||||
|
||||
@@ -38,6 +38,9 @@ using namespace ns3;
|
||||
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
#if 0
|
||||
LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("LrWpanMac",LOG_LEVEL_ALL);
|
||||
|
||||
@@ -41,6 +41,9 @@ using namespace ns3;
|
||||
*/
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
/* nodes and positions */
|
||||
NodeContainer tvTransmitterNodes;
|
||||
NodeContainer spectrumAnalyzerNodes;
|
||||
|
||||
@@ -41,6 +41,9 @@ using namespace ns3;
|
||||
*/
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
/* random seed and run number; adjust these to change random draws */
|
||||
RngSeedManager::SetSeed(1);
|
||||
RngSeedManager::SetRun(3);
|
||||
|
||||
@@ -25,6 +25,9 @@ import ns.network
|
||||
import ns.tap_bridge
|
||||
|
||||
def main(argv):
|
||||
|
||||
ns.core.CommandLine().Parse(argv)
|
||||
|
||||
#
|
||||
# We are interacting with the outside, real, world. This means we have to
|
||||
# interact in real-time and therefore we have to use the real-time simulator
|
||||
|
||||
@@ -25,6 +25,9 @@ import ns.tap_bridge
|
||||
import ns.wifi
|
||||
|
||||
def main(argv):
|
||||
|
||||
ns.core.CommandLine().Parse(argv)
|
||||
|
||||
#
|
||||
# We are interacting with the outside, real, world. This means we have to
|
||||
# interact in real-time and therefore we have to use the real-time simulator
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*
|
||||
* Author: Junling Bu <linlinjavaer@gmail.com>
|
||||
*/
|
||||
#include "ns3/command-line.h"
|
||||
#include "ns3/node.h"
|
||||
#include "ns3/packet.h"
|
||||
#include "ns3/simulator.h"
|
||||
@@ -249,6 +250,9 @@ WaveNetDeviceExample::SendWsaExample ()
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
CommandLine cmd;
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
WaveNetDeviceExample example;
|
||||
std::cout << "run WAVE WSMP routing service case:" << std::endl;
|
||||
example.SendWsmpExample ();
|
||||
|
||||
Reference in New Issue
Block a user