[C++-sig] Re: Embedding python in ns-2(tcl and c++) simulator?
Jiun-jie Huang
jjhuang at cm.nctu.edu.tw
Thu Feb 26 02:14:34 CET 2004
"Mike Rovner" <mike at nospam.com> writes:
> You didn't explain the python role in this. There are existing tcl/python
> integration solutions, may be that will do (if transfering data through tcl
> is enough).
>
> Why not to do it in Simulator class?
>
> Also please note that I know nothing about ns.
Sorry about not explain in details. ns-2 is a mixed tcl and c++
simulator, where all C++ objects are subclasses of TclObject. C++
objects can be created and binding variables by C++. Simulator is
written in TCL. At the start of a simulator, TCL creates some
necessary objects, and because all C++ objects are inherited from
TclObject, they all have an interface in TCL.
There is already a Bluetooth c++ module for ns-2 that can performe
lower layer communication routines, not written by me. I need to
implement my algorithm in higher layer, and I use python to do it. The
python portion is already done. And it's not an easy task to
re-implement those lower-layer communication routines in Python. So
one Bluetooth node is composed of C++ and python code; C++ handles
lower layer, and Python handles higher layer.
I'm studying socket programming now. I plan to write a simple server
for handling Python code. It seems stupid, but if I can't successfully
embed python in ns-2's C++ object, it's worth to do when comparing to
re-implement those lower layer communication routines in Python, or
re-implement those higher layer algorithm in C++.
--
Jiun-jie Huang, aka Albert E-mail: jjhuang AT cm.nctu.edu.tw
黃俊傑
Department of Computer Science
National Tsing Hua University MIME/ASCII/PDF/PostScript are welcome!
HsinChu, Taiwan NO MS WORD DOC FILE, PLEASE!
More information about the Cplusplus-sig
mailing list