Seapahn Megerian
Electrical and Computer Engineering Department
University of Wisconsin Madison
megerian@ece.wisc.edu
Latest revision - May 2006


DISCLAIMER: THE FOLLOWING SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


6/2006 - Repackaged with updated comments - Released as free software into the public domain.
The project should be directly compilable by Visual Studio 6.0.  

------------
Author notes
------------
I have used this code extensively in various shapes and forms for a long time and in a number of different projects. Just like any software, it could still have bugs. I have tried my best to stip away any unnecessary parts or sections left from other projects and clean up the code. Use at your own risk. It is only intended to be used for experimentation and research. But if you find ways to make tons of money from this code, by all means, feel free to do it!  I am releasing the code as "free software" so do with it as you wish. It would be nice if you could give credit if you use a large part of the source intact, but you don't have to :)

There is currently not much documentation in terms of a "usage manual" as the source and driver example are fairly self explanatory. If you know what exposure is, how it is defined in our paper, and how the algorithm works, using this software should be straighforward. So, I would refer you to the following paper:

Seapahn Megerian, Farinaz Koushanfar, Gang Qu, Giacomino Veltri, Miodrag Potkonjak. "Exposure in Wireless Sensor Networks: Theory and Practical Solutions." Journal of Wireless Networks 8 (5), ACM Kluwer Academic Publishers, pp. 443-454, September 2002. 

http://www.ece.wisc.edu/~megerian/papers/exposure_journal.pdf


I would like to acknowledge my co authors on the original exposure paper without whom this algorithm and the associated software source would not have been  possible.

--Seapahn




New Additions (2/2001):
1) Modified Sensor class and added new parameters a and n
2) Modified intensity function in Exposure and added a new case that uses the new paremeters instead of built in defaults
3) To use the a and n parameters, initialize the sensor model using the SENSOR_MODEL_PAR define.


Other Changes:

1) Added run_side_to_side() that finds the min exposure path from one side (x=0) of the field to the opposite side (x=MAX)
2) Modified run_current_grid(...) to take parameters for start and end positions

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

February 2001
Exposure in Sensor Networks -- Readme

Seapahn Megerian (Meguerdichian)
University of California at Los Angeles
seapahn@cs.ucla.edu

--------------------------------
The list of the files in this package are:

Linkedlist.h	Generic linked list used by DJ_Graph
Linkedlist.cpp
DJ_Graph.h	Implements adj. list graph and Djikstra shortest path algo
DJ_Graph.cpp
Sensor.h	Nothing much here.  Just a simple def.
Sensor.cpp
Exposure.h	The bulk of the exposure algorithm
Exposure.cpp

exp.cpp		demonstrates the usage of the Exposure class


--------------------------------
The grid used in approximating the minimal exposure path has 2 parameters:
g_res and g_div.  

Notes:  The following is an example of a grid where g_res=2 and g_div=5.  
In each square, all points around the edges of the square are connected 
together using straight lines.  The minimal exposure path is constructed
using only these lines. This is required to overcome the problem of being
restricted to only horizontal, vertical, or diagonal movements in a simple
grid (where g_div=1).


* . . . . * . . . . *
.         .         .
.         .         .
.         .         .
.         .         .
* . . . . * . . . . *
.         .         .
.         .         .
.         .         .
.         .         .
* . . . . * . . . . *
--------------------------------
To use the exposure class:

1) call the member function init() with proper parameters
2) Then set grid parameters using set_grid()
3) Call run_current_grid() to run the algorithm
4) output() demonstrates how to access and use the results.

In order to run with different sensor and intensity parameters init() must
be called each time.  LAYOUT_KEEP_OLD can be used to preserve old sensor
positions. 

