
Simulator ver0.0, Copyright Sushil J. Louis, 
This software comes with ABSOLUTELY NO WARRANTIES.

Read the entire file before starting.

	Contents:
		Simulator
		Display
		Integrating your controller code

-------------------------------------------------------------------------------
sim -[hpDdsfor]

	The simulator can simulate a maximum of 10 robots, 20 pieces of food,
	and 20 obstacles. The more of each entity, the slower the simulation.
	To control a robot, you need to modify the function control(...) in
	file control.c. I have provided a controller function that implements 
	food approaching behavior. You can design different controllers for
	different robots by using a "switch" in the control(...) as I have
	shown (two robots approach food, the third simply goes straight).
	Functions to get Sensor values are in sensor.c and are self
	explanatory. 
	Functions to move the robot are in actuator.c and are also self
	explanatory. 
	Make sure you include control.h which contains #define's and function
	prototypes neccessary for sensor functions and actuator functions to
	work. 


	OPTIONS:

	-h display host name (default is flash.cs.unr.edu)

		example:
		sim -h flash.cs.unr.edu 

	-p display port number (default is 5588)

		example:
		sim -h flash -p 5588

	-D connect and send info to display? 
		(default: = 1, Sends to display)

		example:
		sim -h flash -p 5588 -D 0 
			doesn't connect to display

	-d sound intensity emmitted by prey/food 
		(default is 80)
		
		example:
		sim -h flash -d 100
			sets range to 100, so predator can hear the food
			from further away. Sound intensity diminishes with
			the square of the distance.

	-s number of simulation steps
		(default is 50, maximum is 1000 (MAXSTEP in const.h))

		example:
		sim -h flash -s 500
			simulation runs for 500 time steps.

	-f filename with prey information
		(default is food.dat)
		format: number of prey
			x-coord y-coord
			x-coord y-coord
			...

		Look at food.dat

	-o filename with obstacle information
		(default is obs.dat)

		format: number of obstacles
			x-coord y-coord
			x-coord y-coord
			...
	-r filename with robot information
		(default is rob.dat)

		format: number of robots 
			x-coord y-coord initial-heading 
			x-coord y-coord initial-heading
			...
		These coords and heading 
		are all doubles (must have decimal point).

	-t DEADTIME
	
	       This is some multiple/fraction of the amount of time
	food stays eaten before being available for eating again. In other
	words the amount of time needed for food to grow back.


-------------------------------------------------------------------------------
DISPLAY	
	The simulator may or may not be connected to a visual display 
	(written in Java). The -D option controls this aspect. The display may
	run on any machine with java (All Linux machines in 314) and the
	simulator can run on any (perhaps different) machine with a C compiler.
	To run both, type:
	% cd ~sushil/sim/disp
	% /usr/local/java/bin/java Display
	or copy everything in ~sushil/sim/disp to your directory and skip the
	first step (cd ...).
	In another window, type:
		% ~sushil/sim/sim.dec -h display-machine-name
	or
		% ~sushil/sim/sim.linux -h display-machine-name
	depending on whether you are on a LINUX or DEC box
	
	wait for a window to show up (make sure you have the display and
	xhost permissions setup), click on the "Start"  button and you should
	see robots moving around in the default environment. 
	The "Reset" button allows you to start a new simulation. Click reset,
	run your simulation, and click "Start" to watch a new run.

-------------------------------------------------------------------------------
Designing and evaluating your controller:

	Edit the file  mycontrol.c  changing the function 
	Sushil(....) that is currently there to your-login-name and making the
	appropriate changes to control(...) in control.c -- that is, replace
	all occurences of sushil in control.c with your-login-name.

	Compile the simulator with your control by typeing
	% make

	Follow the instructions above for visualizing your robot's behavior.

-------------------------------------------------------------------------------

	
	
