Hi Bjoern, Schuenemann, Bjoern schrieb: > I'd like to make a simulation with ns-2 where the movement of the nodes is > modifiable by another program during the runtime of the ns-2 simulation. How > could I realize this? It seems that modifications of trace and movement files > are ignored by ns-2 after the files are read in by the TCL script I think the problem is that after reading the movement files all events that actually control the movement are already in the event queue.
One of my students implemented an external movement control some years ago for the emulation mode. Basically he adds a listening socket that takes simulator control commands from an external program, converts them to TCL code and evaluates them. Then he ran the simulation for an infinite time (and send a stop command from the external controller to exit) and could move the nodes around as he liked. But, this only works in emulation mode. The reason is, if you are in the normal simulation mode, time will jump from event to event. And if there is the last movement event in the queue, the simulator possibly will jump to the final stop event and quit. So, only emulation ensures that your simulation time does not runs too fast. I took a quick look but could not find the diploma thesis / code of the student. I will spend more time searching if you like. Title of the thesis was " Eine dynamische WLAN-Emulationsumgebung auf Basis des NS-2", Thomas Kiebel, Diplomarbeit, 2005. Daniel. -- Dr.-Ing. Daniel Mahrenholz rt-solutions.de GmbH Oberländer Ufer 190a D-50968 Köln Web: www.rt-solutions.de rt-solutions.de networks you can trust.