SlideShare une entreprise Scribd logo
1  sur  3
Télécharger pour lire hors ligne
Assignment 3
                                    2009 Session 2
                             Theme: Wireless Programming
                                                     Released Mon 14 Sept 2009
                                                             Due Fri 02 Oct 2009
                                                                       Marks 20


Scenario: In this assignment we consider situation management applications in a bush
fire scenario. In a bush fire situation, a human and a robot are trapped in a bush
fire, see Fig 1, where H is the human and R is the robot. The squares labelled
E(green) denote exit points, and F(red) denote fire. Exit points are used by H and R
for escape. As fire spreads,           the red squares shift to any one of their
neighbouring squares randomly. If fire enters any exit point, that exit point cannot
be used for escape until the fire moves out of the exit point to some other adjoining
squares. The human and the robot try to escape from the fire world by navigating to
the exit points which are not on fire. During the course of their movement, if they
touch fire (that is, found themselves in the square which is red), they die. (This can
happen if the human/robot moves to a square to which the fire also has moved at the
same time.)



                      F                         E


                                        H


             E                                  F                 E


                      R


                                                F


     Figure 1 Fire world – a two dimensional array of size 10 x 10: Fire (F), Human(H),
     Robot( R ), and Exit(E)
Programming

We simulate the world containing fire, human, and robot using the system shown in
Fig 2.



                              Tomcat

                                                                     IE or FireFox Browser
     RMI server

     RMI object:
      Rob                                                            J2ME wireless tool kit(used
                              servlets                               by human H)

                            RMI client
                                                                     WAP Browser(used by robot
                                                                     R)

                              MySQL
     Fire
     Simulator


                      Figure 2 Fire situation management framework


The system consists of a fire simulator to simulate fire propagation, an intelligent
J2ME client (for H), a WAP browser (for R), an RMI object Rob to simulate the
behaviour of R, tomcat to support the overall service, the IE/FireFox browser, and a
MySQL database. The function of each component is described below.

Fire simulator It simulates fire, and periodically updates the MySQL database.(You
can choose your own period of updation.) That is, it takes each red (F) square, makes
it white ( it is not on fire anymore), randomly selects one of its eight adjoining
squares, and makes it red. This has the effect of fire spreading randomly. Note that
the number of adjoining squares will be less when you consider fire at the
boundaries of the world.

J2ME client It obtains the locations of F,R,E, and H from the MySQL database
using the servlets, and moves H in an appropriate direction by one square
(up/down/left/right) in an attempt to go towards a convenient exit point. It also sends
a command to the RMI object Rob (using the services of the servlets) to move Rob
up/down/left/right so that Rob can also get closer to its own safe exit point. You can
choose these safe exit points appropriately (using your own criteria) as fire spreads.
Additionally, J2ME client should display on its screen the exit point selected for H,
the exit point selected for Rob, and the command sent to Rob.

RMI object Rob It responds to J2ME’s commands. That is, it moves
up/down/left/right by one square, and stores its current position in its memory. Note
that the world is a two dimensional array, so you can specify Rob’s position by a row
and column <i,j>.

The WAP Browser It requests the servlets to send Rob’s current position, and
displays it on its screen (whenever a RELOAD button in the WAP is pressed). Note:
You need to provide this reload button in the WAP client.

IE/Fire Fox Browser It displays the entire world which is a two dimensional array
with fire, exit, H, and R, whenever its RELOAD button is pressed.


Implement this system using the components mentioned in the figures above. To
implement this, you can use the latest Tomcat, MySQL, J2ME wireless tool kit, any
WAP browser, and Java 1.6. You can either invoke them directly on the command
lines individually(which is what I have done), or (less painfully) install them on an
IDE (such as Eclipse or Netbeans), and run them.

Use sample servlet and midlet codes discussed in the class (see CODE link on the
homepage). Feel free to write your own code, if you do not want to use them.

Submission: Submit all Java code your wrote: Fire simulator, RMI server,             all
servlets, and all midlets.

% give cs9031 ass3 Ass3.jar

Marking is done by taking demos from you after the submission deadline. Demo
schedule will be released in due course.

I am sure, you will have lots of questions to ask – please post them in the Ass3 thread.


GOOD LUCK!



============ end of Assignment 3 description ============

Contenu connexe

Similaire à ass3

Jabber 101
Jabber 101Jabber 101
Jabber 101stpeter
 
Programming for Lego Mindstorms using Eclipse to take you back to your childh...
Programming for Lego Mindstorms using Eclipse to take you back to your childh...Programming for Lego Mindstorms using Eclipse to take you back to your childh...
Programming for Lego Mindstorms using Eclipse to take you back to your childh...Benjamin Cabé
 
Topics in robotics
Topics in roboticsTopics in robotics
Topics in roboticsBushra Jbawi
 
Obstacle detection using laser
Obstacle detection using laserObstacle detection using laser
Obstacle detection using laserRohith R
 
Lecture 07 virtual machine i
Lecture 07 virtual machine iLecture 07 virtual machine i
Lecture 07 virtual machine i鍾誠 陳鍾誠
 
Anti missile diffusion system through MATLAB with Image Processing
Anti missile diffusion system through MATLAB with Image ProcessingAnti missile diffusion system through MATLAB with Image Processing
Anti missile diffusion system through MATLAB with Image ProcessingVeer Singh shakya
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlabAman Gupta
 
Vision Based Autonomous Mobile Robot Navigation
Vision Based Autonomous Mobile Robot NavigationVision Based Autonomous Mobile Robot Navigation
Vision Based Autonomous Mobile Robot NavigationNiaz Mohammad
 

Similaire à ass3 (18)

Paper (2007) - English
Paper (2007) - EnglishPaper (2007) - English
Paper (2007) - English
 
myppt
mypptmyppt
myppt
 
Final Ppt
Final PptFinal Ppt
Final Ppt
 
Jabber 101
Jabber 101Jabber 101
Jabber 101
 
Robocup2006
Robocup2006Robocup2006
Robocup2006
 
Programming for Lego Mindstorms using Eclipse to take you back to your childh...
Programming for Lego Mindstorms using Eclipse to take you back to your childh...Programming for Lego Mindstorms using Eclipse to take you back to your childh...
Programming for Lego Mindstorms using Eclipse to take you back to your childh...
 
Introduction To Rmi
Introduction To RmiIntroduction To Rmi
Introduction To Rmi
 
Simulating TUM Drone 2.0 by ROS
Simulating TUM Drone 2.0  by ROSSimulating TUM Drone 2.0  by ROS
Simulating TUM Drone 2.0 by ROS
 
Lecture 11 compiler ii
Lecture 11 compiler iiLecture 11 compiler ii
Lecture 11 compiler ii
 
Topics in robotics
Topics in roboticsTopics in robotics
Topics in robotics
 
Obstacle detection using laser
Obstacle detection using laserObstacle detection using laser
Obstacle detection using laser
 
Lecture 07 virtual machine i
Lecture 07 virtual machine iLecture 07 virtual machine i
Lecture 07 virtual machine i
 
Anti missile diffusion system through MATLAB with Image Processing
Anti missile diffusion system through MATLAB with Image ProcessingAnti missile diffusion system through MATLAB with Image Processing
Anti missile diffusion system through MATLAB with Image Processing
 
ADB Lab Manual.docx
ADB Lab Manual.docxADB Lab Manual.docx
ADB Lab Manual.docx
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlab
 
Machine language
Machine languageMachine language
Machine language
 
Vision Based Autonomous Mobile Robot Navigation
Vision Based Autonomous Mobile Robot NavigationVision Based Autonomous Mobile Robot Navigation
Vision Based Autonomous Mobile Robot Navigation
 
E0312834
E0312834E0312834
E0312834
 

Plus de Auro Infomation Technology (8)

today
todaytoday
today
 
test4
test4test4
test4
 
test4
test4test4
test4
 
test3
test3test3
test3
 
test2
test2test2
test2
 
Sdd 4
Sdd 4Sdd 4
Sdd 4
 
Sdd 4
Sdd 4Sdd 4
Sdd 4
 
Sdd 2
Sdd 2Sdd 2
Sdd 2
 

ass3

  • 1. Assignment 3 2009 Session 2 Theme: Wireless Programming Released Mon 14 Sept 2009 Due Fri 02 Oct 2009 Marks 20 Scenario: In this assignment we consider situation management applications in a bush fire scenario. In a bush fire situation, a human and a robot are trapped in a bush fire, see Fig 1, where H is the human and R is the robot. The squares labelled E(green) denote exit points, and F(red) denote fire. Exit points are used by H and R for escape. As fire spreads, the red squares shift to any one of their neighbouring squares randomly. If fire enters any exit point, that exit point cannot be used for escape until the fire moves out of the exit point to some other adjoining squares. The human and the robot try to escape from the fire world by navigating to the exit points which are not on fire. During the course of their movement, if they touch fire (that is, found themselves in the square which is red), they die. (This can happen if the human/robot moves to a square to which the fire also has moved at the same time.) F E H E F E R F Figure 1 Fire world – a two dimensional array of size 10 x 10: Fire (F), Human(H), Robot( R ), and Exit(E)
  • 2. Programming We simulate the world containing fire, human, and robot using the system shown in Fig 2. Tomcat IE or FireFox Browser RMI server RMI object: Rob J2ME wireless tool kit(used servlets by human H) RMI client WAP Browser(used by robot R) MySQL Fire Simulator Figure 2 Fire situation management framework The system consists of a fire simulator to simulate fire propagation, an intelligent J2ME client (for H), a WAP browser (for R), an RMI object Rob to simulate the behaviour of R, tomcat to support the overall service, the IE/FireFox browser, and a MySQL database. The function of each component is described below. Fire simulator It simulates fire, and periodically updates the MySQL database.(You can choose your own period of updation.) That is, it takes each red (F) square, makes it white ( it is not on fire anymore), randomly selects one of its eight adjoining squares, and makes it red. This has the effect of fire spreading randomly. Note that the number of adjoining squares will be less when you consider fire at the boundaries of the world. J2ME client It obtains the locations of F,R,E, and H from the MySQL database using the servlets, and moves H in an appropriate direction by one square (up/down/left/right) in an attempt to go towards a convenient exit point. It also sends a command to the RMI object Rob (using the services of the servlets) to move Rob up/down/left/right so that Rob can also get closer to its own safe exit point. You can choose these safe exit points appropriately (using your own criteria) as fire spreads. Additionally, J2ME client should display on its screen the exit point selected for H, the exit point selected for Rob, and the command sent to Rob. RMI object Rob It responds to J2ME’s commands. That is, it moves up/down/left/right by one square, and stores its current position in its memory. Note
  • 3. that the world is a two dimensional array, so you can specify Rob’s position by a row and column <i,j>. The WAP Browser It requests the servlets to send Rob’s current position, and displays it on its screen (whenever a RELOAD button in the WAP is pressed). Note: You need to provide this reload button in the WAP client. IE/Fire Fox Browser It displays the entire world which is a two dimensional array with fire, exit, H, and R, whenever its RELOAD button is pressed. Implement this system using the components mentioned in the figures above. To implement this, you can use the latest Tomcat, MySQL, J2ME wireless tool kit, any WAP browser, and Java 1.6. You can either invoke them directly on the command lines individually(which is what I have done), or (less painfully) install them on an IDE (such as Eclipse or Netbeans), and run them. Use sample servlet and midlet codes discussed in the class (see CODE link on the homepage). Feel free to write your own code, if you do not want to use them. Submission: Submit all Java code your wrote: Fire simulator, RMI server, all servlets, and all midlets. % give cs9031 ass3 Ass3.jar Marking is done by taking demos from you after the submission deadline. Demo schedule will be released in due course. I am sure, you will have lots of questions to ask – please post them in the Ass3 thread. GOOD LUCK! ============ end of Assignment 3 description ============