Virtual Fence Simulation Project
What is this?
This is my Math Modeling project on cow herding and virtual fences (a la Zack Butler’s current line of research). As a quick little abstract, one of the emerging research areas in animal herding is trying to find an economical way to place fences over large landscapes in order to both contain and move cattle. The actual “fence” is just some type of stimulus that is locally introduced to the cow (in Zack’s research, it is a loud, “scary” noise), and this saves money from any physical building and upkeep of fences.
Documents/Files
(edit: 5/14/07) Fixed link to final paper.
(edit 2/26/07 6:10pm)
The paper is is now finished, and you can get the pdf: Math Modeling - Final Paper. The paper describes virtual fences in more detail, shows how the models were created and the assumptions that define them, and finally shows some results of simulations.
You can also get the simulator code and mess around with it, if you’d like (license is GNU GPL v2). The simulator is written in Java - I was hoping to have the time to do it in a different language like ruby, but I figured the ramp-up time would put me a bit close to the deadline (not necessarily language ramp-up, but framework ramp-up). You use the simulator to run a discrete, stepwise simulation with any number of cows and fences, and the forces that come into play are a cow-cow force and a fence-cow force. Here is the javadoc, and here you can download the actual source and program (as a jar file). (The /VirtualFenceSimulation directory is just the cvs checkout, so the whole project is in there somehow).
Updates
Update: 2/26/06
Just putting the finishing touches on everything. I have a suite of examples for the paper itself, and you can see the generated output in the “/output” directory (located here). I’ll post the final paper by the end of the day, although here is an almost finished copy. Here is the final version: Math Modeling - Final Paper. (edit: link changed to final version).
Update: 2/25/06
After a bit of work on a Swing visualizer, I realized that my lack of familiarity with Swing would make this a bit difficult, as well as the issues of mapping/scaling floating point coordinates to the integral plotting coordinates. I’ve decided to just write a few output filters to help with the conversion from simulator data to visualization. So far, I have a plaintext output and Matlab output.
The Matlab output produces a legal Matlab file which must be saved in an m-file with a certain name, since there are functions defined (and Matlab doesn’t let you define functions outside of a m-file that isn’t a script [don't ask], and the functions are required to plot horizontal [x=c] lines). Also, the header/footer for the code is modifiable by changing two text files in the /Matlab directory, header.txt and footer.txt. Given these, you get a pretty little plot of the simulation.
The issue now is that I would like to display the simulation information slowly, or allow the user to step through by a certain time quantum. Right now, the display you get is rather difficult to understand, especially since, with fences, I just plot the starting and stopping position (rather than draw a block of fence). The screenshot here is four cows herded between two vertical fences, with a horizontally placed fence at the bottom slowly moving its way upwards (and moving the cows with it).
(click for the full size)
As you can tell, its somewhat hard to read :)
Update: 2/24/06
Fixed some issues with calculating the fence on cow force, and now the simulation looks realistic (the numbers, at least). I need a visualizer, which I was thinking should just be Matlab, but I’m going to try to write a tiny little Swing plotting thing-a-ma-bob. I’m somewhat wary of using Swing, as you get kinda sick of wondering which setSize() method to use (setSize()? setPreferredSize()? setMinimumSize()?) and various other analogues to that.
