--- a/examples/wireless/wifi-ap.cc Tue Dec 29 18:50:33 2009 +0000
+++ b/examples/wireless/wifi-ap.cc Wed Dec 30 11:31:59 2009 +0000
@@ -27,6 +27,7 @@
#include "ns3/contrib-module.h"
#include "ns3/wifi-module.h"
#include "ns3/athstats-helper.h"
+#include "ns3/visualizer.h"
#include <iostream>
@@ -118,7 +119,9 @@
int main (int argc, char *argv[])
{
CommandLine cmd;
+ bool viz = false;
cmd.AddValue ("verbose", "Print trace information if true", g_verbose);
+ cmd.AddValue ("viz", "Enable visualization", viz);
cmd.Parse (argc, argv);
@@ -192,8 +195,15 @@
athstats.EnableAthstats("athstats-sta", stas);
athstats.EnableAthstats("athstats-ap", ap);
- Simulator::Run ();
-
+ if (viz)
+ {
+ Visualizer::Run ();
+ }
+ else
+ {
+ Simulator::Run ();
+ }
+
Simulator::Destroy ();
return 0;