From Autonomous Multirobot Systems
Thanks to Shang Hai and Mert Cogsun for help setting up this software. This is a simple instruction about how to install the mason to linux PC and how to run predator/prey system based on mason.
1. Install MASON (a) Download MASON Download the binary or zip code from the mason page: http://cs.gmu.edu/~eclab/projects/mason/
(b) Install MASON Unzip(for zip) or execute binary files to the desired path. Because in the assignment about predator/prey system, you needn't to use the java 3d support. So you needn't install java 3d. If you like mason features, you can install them according to the instruction files from the mason folder.
(c) Test MASON In the bash or alike environment, go to mason directory. Then type: java sim.app.keepaway.KeepawayWithUI Execute and see what happened. Normally, there will be some tip that you didn't install java 3d, forget that. Then you should see two new windows. If there is something wrong, check the README file in mason directory. Check the "Not So Quick Start:" part in line 54.
2. Run Predator/Prey System (a) Download Predator/Prey System The web address is: maybe the T-square
(b) Install Predator/Prey System In fact it is not installation, just put the whole directory "hunt_cur" to the path: $mason/sim/app ($mason is the path where you put the mason)
(c) Test Predator/Prey System Just like test mason, go to mason directory, type: java sim.app.hunt_cur.HuntWithUI Normally, you should see the tip about java 3d and two new windows, which shows that you can use the predator/prey system.
3. Design your own control strategy There is a simple explaination about the predator/prey system. Read it and go around the hunt_cur directory to learn how it work. Then design your new control strategy in the PredatorControl.java. You should write your codes only in this file.
Download the predator/prey example code from here: http://www.intelligentappliances.org/hunt_cur.tar
Here below is some simple explaination of how the predator/prey system works:
1. Compile and Run: In bash or alike environment, go to the mason directory, to compile, type: javac ./sim/app/hunt_cur/*.java
To run, type: java sim.app.hunt_cur.HuntWithUI
2. File directory:
Hunt.java mainly defines the initiation of the predators, preys and obstacles and other details.
HuntWithUI.java is the entry point to run the console.
Agents.java is the super class of PredatorRobot and PreyRobot. It define some basic variables and functions.
Obstacles.java extends Agents. It is for the obstacles, which never move.
For every predator, there are two parts: robot(body) and controller(brain). The robot(body) have a controller(brain) and the controller(brain) controls a robot(body). They could be written in one file but separating them is more convenient for you to design your strategy. The robot can access sensors(surronding objects). The robot part implements a "step" function. In every time unit(second), all of the predators' and preys' robot run the "step" function once. In the "step" fucntion, the predator controller updates the desired variables for where to go and what to do(the strategy part). Then the robot(body), based on the desired variables from the controller(brain), updates the direction and speed. But the predator have max limits for turnRate, speed, turnRateAccel and speedAccel. In the step function, there is maximum check to ensure the predator do things under max limitations. While in the controller(brain) part, the doStep() function is the control strategy. In this part, controller(brain) can access what the robot(body) can see(sensors for surroundings). Based these information, update the desired variables to tell the robot(body) where should go and what should do. According the PredatorRobot.java and PredatorControl.java file, you may have a better understanding.
PreyRobt.java & PreyControl.java: They are alike the predators.
The differences between preys and predators: Preys' max limitations for speed(2), turnRate(PI/3 per sec), speedAccel(2m/(sec*sec)) and turnRateAccel(PI/3 per (sec*sec)) is twice to the counterparts of predators. Predators have a sensor range of 90 while preys have 80. Both of them have PI/2 sight width in front.
Your task is to design a new strategy in the PredatorControl.java, doStep() function. Your codes should be written only in this PredatorControl.java file.