ote: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 3 of the book for better understanding.
Introduction
This post is the second post in the series on C++ and OTcl Linkage:
1. Why Two Languages?
2. Binding C++ and OTcl classes [Main steps, The mechanism].
3. Variable binding
4. OTcl command: Invoking C++ statements from the OTcl domain [ Getting Started, Invocation process, Binding OTcl and C++ ]
5. Eval: Invoking OTcl statements from the C++ domain
6. Result: Passing Values between C++ and OTcl domains
7. Object binding and object construction process.
In the previous post, I blogged about an approach to invoke OTcl statements from the C++ domain using function evalc(...) and evalf(...). This post discusses the way to pass results between C++ and OTcl domains using function result(...).
Passing Values Between C++ and OTcl
View more presentations from Teerawat Issariyakul.
======================================================
T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009.
You may also find lecture notes and other resource at the following website: http://www.ece.ubc.ca/~teerawat/NS2.htm
Monday, September 6, 2010
Wednesday, September 1, 2010
Sample Space and Gambling
The Dawn of Sample Sapce
Gerolamo Cardano was an physician, a gambler, and a mathematician. Early in his career, he discovered the concept of sample space, and tried to publish the concept in a book named “The book on Games of Chance”. The manuscript was rejected.
He did not try to published it again. Instead, he used the concept to make a fortune out of gambling. The book was published after his death in 1663. Here is the quote from the book.
“The possible outcomes of a random process can be thought of as a point in the space.”
This space of all possible outcomes is later known to as “sample space”.
Monday, August 30, 2010
C++ and OTcl Linkage: Eval — Invoking OTcl statements from the C++ domain
Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 3 of the book for better understanding.
Introduction
This post is the second post in the series on C++ and OTcl Linkage:
1. Why Two Languages?
2. Binding C++ and OTcl classes [Main steps, The mechanism].
3. Variable binding
4. OTcl command: Invoking C++ statements from the OTcl domain [ Getting Started, Invocation process, Binding OTcl and C++ ]
5. Eval and result: Invoking OTcl statements from the C++ domain
6. Object binding and object construction process.
In the previous post, I blogged about an approach to invoke C++ statements from the OTcl domain. This post discuss the reverse: Invoking OTcl statements from the C++ domain.
View more presentations from Teerawat Issariyakul.
======================================================
T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009. Buy it now from

You may also find lecture notes and other resource at the following website: http://www.ece.ubc.ca/~teerawat/NS2.htm
Introduction
This post is the second post in the series on C++ and OTcl Linkage:
1. Why Two Languages?
2. Binding C++ and OTcl classes [Main steps, The mechanism].
3. Variable binding
4. OTcl command: Invoking C++ statements from the OTcl domain [ Getting Started, Invocation process, Binding OTcl and C++ ]
5. Eval and result: Invoking OTcl statements from the C++ domain
6. Object binding and object construction process.
In the previous post, I blogged about an approach to invoke C++ statements from the OTcl domain. This post discuss the reverse: Invoking OTcl statements from the C++ domain.
View more presentations from Teerawat Issariyakul.
======================================================
T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009. Buy it now from
You may also find lecture notes and other resource at the following website: http://www.ece.ubc.ca/~teerawat/NS2.htm
Friday, August 27, 2010
The Interpretation of Randomness
How much do you know about randomness? What does it mean by a random process? Well, a lot of people would say that a random process is a process whose outcomes cannot be predicted. Clean and simple, and nice for a lot of people.
But this definition is quite vague to mathematician. Mathematicians have something for preciseness. When you say a circle is round, they would ask how round, and you would not know how to reply to them. But if you ask a mathematician how round is a circle, the answer would be 3.14 x R x R where R is the radius.
Likewise, the above definition for a random process is not precise enough. For mathematician, there are at least two interpretation for a random process:
(i) Frequency interpretation: A process is said to be able to generate random numbers when the observed outcome conform to the underlying probability.
(ii) Subjective interpretation: Observed outcomes are said to be random if they cannot be predicted.
Sunday, August 22, 2010
[NS2] Error message: Invalid command
Last week, I've got few messages asking me similar questions. The question was why do I see the following error message when running NS2 and how do I fix it?
invalid command name
invalid command name
Wednesday, August 18, 2010
The Greek, the Roman, and the Mathematics
The Greek and Their Mathematics
Most greek Mathematics are mainly about geometry. They do not believe in probability since
- They believe that chance is governed purely by Gods.
- Their number system is very difficult to work with. Algebra and arithematics had not existed in their time. They don’t even have the number zero nor fraction.
Monday, August 16, 2010
C++ and OTcl Linkage: OTcl Commands — Binding OTcl and C++
Note: The content in this series is extracted from the book, Introduction to Network Simulator NS2. You may have to read chapter 3 of the book for better understanding.
Introduction
This post is the second post in the series on C++ and OTcl Linkage:
1. Why Two Languages?
2. Binding C++ and OTcl classes [Main steps, The mechanism].
3. Variable binding
4. OTcl command: Invoking C++ statements from the OTcl domain [ Getting Started, Invocation process, Binding OTcl and C++ ]
5. Eval and result: Invoking OTcl statements from the C++ domain
6. Object binding and object construction process.
In the previous post, I blogged about the key steps in the OTcl domain when instproc or OTcl command is invoked. In this post, I will explain how NS2 moves from OTcl to C++.
Introduction
This post is the second post in the series on C++ and OTcl Linkage:
1. Why Two Languages?
2. Binding C++ and OTcl classes [Main steps, The mechanism].
3. Variable binding
4. OTcl command: Invoking C++ statements from the OTcl domain [ Getting Started, Invocation process, Binding OTcl and C++ ]
5. Eval and result: Invoking OTcl statements from the C++ domain
6. Object binding and object construction process.
In the previous post, I blogged about the key steps in the OTcl domain when instproc or OTcl command is invoked. In this post, I will explain how NS2 moves from OTcl to C++.
Subscribe to:
Posts (Atom)