Hi everybody,
I am a student currently doing a project on Sensor Replacement Using Mobile Robots article (from Science Direct) using Glomosim and I encountered many problems.
The codes in Glomosim are all written using C language but it is compiled using PARSEC compiler.
One of the main and biggest problem is that i am unable to implement the pseudocode that was written in the article.
Lets say the pseudocode given is:
Sensor Node
1. Receive the manager's initial location broadcast
2. Broadcast my location to all neighbor nodes
3. Receive broadcasting message from all neighbors
4. Setup guardian-guardee relationships
5. Set a timeout T
6. while (TRUE)
7. do if (timeout)
8. then Reset the timeout T
9. Send a beacon to its guardian
10. Check the last time receiving a beacon
11. if the time duration is too long (> 3T)
12. then Report failure to the manager
So therefore in the Glomosim, how do i make changes to suit to this pseudocode?
Currently my knowledge is that in Glomosim, only nodes are being defined there and as for the managers and guardians, they are not written in it. Thus am I correct to say that I must manually add the managers, guardians, guardees, their relationships into Glomosim myself?
If Yes. How do I go about doing it?
Judging by the fact that there are numerous files such as:
driver.h
driver.pc
glomo.h
glomo.pc
etc etc...
I have to manually add each and individual terms into it ?
And if this is so, it is almost close to editting the entire Glomosim program !?
I hope someone will be able to assist or help me out. I would greatly appreciate the help given. I have been stuck on this portion for about 3 months already and no progress.
Thank You.
Glomosim: Sensor Replacement Using Mobile Robots
Started by TellMeWhy, Dec 30 2008 07:10 PM
6 replies to this topic
#1
Posted 30 December 2008 - 07:10 PM
|
|
|
#2
Posted 30 December 2008 - 08:33 PM
I have an impression that Node and Manager are different units; while they communicate with each other via a well defined protocol, they each care about their own functionality. This is analogous to the web server and clients. They communicate with each other, but are actually independent programs, often running on different machine. So you may not need to implement the manager for have the Node run, but it will not function if it cannot find a manager.
You need to know:
1. How the Manager communicates with nodes?
2. What service does the Manager provide to nodes, and what service does it request from nodes?
If you can collect these information, you should be able to create a Manager (program) to have the simulation actually run.
You need to know:
1. How the Manager communicates with nodes?
2. What service does the Manager provide to nodes, and what service does it request from nodes?
If you can collect these information, you should be able to create a Manager (program) to have the simulation actually run.
#3
Posted 31 December 2008 - 11:59 PM
Dear Lance,
Thank you so much for your response. Greatly appreciate it.
Can i further ask you questions on it?
Yes, you are correct, the Manager interact with the nodes and the manager act as a master control station where by it receives information from all the nodes and if there are any failures in the nodes, it will respond accordingly by sending messages to a mobile node(the term they used is Robot) to replace the failed nodes.
However what i am curious is that, since knowing the functions, how do i write the actual code out?
1. The Manager function code is it written together with the nodes (the nodes mentioned here are already a written code in the Glomosim program) or
2. The Manager function code is written as a seperate code from the nodes ? If its is written seperately, how do i combine them together ?
I apologize for asking such simple qns, i think right now i can be considered a newbie in programming. Yeah hope you will be able to help me out, thanks alot !
Thank you so much for your response. Greatly appreciate it.
Can i further ask you questions on it?
Yes, you are correct, the Manager interact with the nodes and the manager act as a master control station where by it receives information from all the nodes and if there are any failures in the nodes, it will respond accordingly by sending messages to a mobile node(the term they used is Robot) to replace the failed nodes.
However what i am curious is that, since knowing the functions, how do i write the actual code out?
1. The Manager function code is it written together with the nodes (the nodes mentioned here are already a written code in the Glomosim program) or
2. The Manager function code is written as a seperate code from the nodes ? If its is written seperately, how do i combine them together ?
I apologize for asking such simple qns, i think right now i can be considered a newbie in programming. Yeah hope you will be able to help me out, thanks alot !
#4
Posted 01 January 2009 - 03:13 PM
[quote]
However what i am curious is that, since knowing the functions, how do i write the actual code out?
1. The Manager function code is it written together with the nodes (the nodes mentioned here are already a written code in the Glomosim program) or
2. The Manager function code is written as a seperate code from the nodes ? If its is written seperately, how do i combine them together ?
I apologize for asking such simple qns, i think right now i can be considered a newbie in programming. Yeah hope you will be able to help me out, thanks alot !
[/code]
If what you want to do is to simulate on your computer, you have a few options
1. Put all of them in a single program, this may be the easiest way. When the program starts, you central control give each objects a equal chance to perform their functions.
2. A Manager program, A Node program, and possibly a Messenger program. Messenger will be started first. A single Manager and mutiple Nodes instance can be started subsequently. Each object send its message and get information from the Messenger.
3. Same as 2, but can run on a network.
Which way do you prefer to implement the simulator with?
However what i am curious is that, since knowing the functions, how do i write the actual code out?
1. The Manager function code is it written together with the nodes (the nodes mentioned here are already a written code in the Glomosim program) or
2. The Manager function code is written as a seperate code from the nodes ? If its is written seperately, how do i combine them together ?
I apologize for asking such simple qns, i think right now i can be considered a newbie in programming. Yeah hope you will be able to help me out, thanks alot !
[/code]
If what you want to do is to simulate on your computer, you have a few options
1. Put all of them in a single program, this may be the easiest way. When the program starts, you central control give each objects a equal chance to perform their functions.
2. A Manager program, A Node program, and possibly a Messenger program. Messenger will be started first. A single Manager and mutiple Nodes instance can be started subsequently. Each object send its message and get information from the Messenger.
3. Same as 2, but can run on a network.
Which way do you prefer to implement the simulator with?
#5
Posted 03 January 2009 - 05:06 AM
Currently i tried to writing the manager program with the node program, but so far, still trying to solve all the syntax errors. Most of them are conflicting syntax errors with the original program.
I am not sure which one i will prefer, but currently i am trying this out 1st to see if there are any results. Which method do u suggest that i should go for ?
I am not sure which one i will prefer, but currently i am trying this out 1st to see if there are any results. Which method do u suggest that i should go for ?
#6
Posted 03 January 2009 - 06:44 AM
You may go with the 1st as you are doing, but clearly decouple each object types so that in the future if you feel like to separate them into individual programs, it won't be a hell lot of work.
C is fine, but if you are familiar with C++, I'd suggest you go with C++. Understanding your current code, see how it functions and what's missing, try to wrap it into a Node class. You'll have to write the Manager class by yourself. And if you choose to go with the 1st method, you probably can do without the Messenger. Just use an endless loop, give each objects equal chance to perform their routine work.
C is fine, but if you are familiar with C++, I'd suggest you go with C++. Understanding your current code, see how it functions and what's missing, try to wrap it into a Node class. You'll have to write the Manager class by yourself. And if you choose to go with the 1st method, you probably can do without the Messenger. Just use an endless loop, give each objects equal chance to perform their routine work.
#7
Posted 03 January 2009 - 07:02 AM
hahaha whoa, this really sounds difficult already, but i will try my best. Cause now most of the files are seperated into many headers and source files, changing or adding one function affects every other files. Anyway once again, thanks alot for your help! I hope i am doing correctly.


Sign In
Create Account

Back to top









