The steps below can be use to enable the PyViz visualizer for ns-3 python binding. For C++ code, you could follow the steps in the referenced post.
Install prerequisites
sudo apt-get install python-dev python-pygraphviz python-kiwi python-pygoocanvas python-gnome2 python-gnomedesktop python-rsvg
Change your python code
import ns.visualizer [...] cmd = ns.core.CommandLine() cmd.Parse(sys.argv) [...] ns.core.Simulator.Run()
Run your script with command line argument
your_script.py --SimulatorImplementationType=ns3::VisualSimulatorImpl
or
./waf --pyrun your_script.py --vis
Reference: PyViz
No comments:
Post a Comment