This file includes a few notes on our "open field" Matlab simulation:

1. The relevant files are:
AddMatrix.m
CurFactorCalc.m
ExtraMatrix.m
FinalMatrixCalc.m
makeline.m
MakeSecMat.m
MemCalc.m
RunSim.m
SecFactorCalc.m
SelectNewPos.m

Each file contains a function with the same name.

2. Put these files under some directory, and add it to the Matlab path (if you have windows Matlab, use the toolbar
button "path browser").

3. To run the simulation you should call the function "RunSim", by typing it's name in the command window.
This is the documentation of "RunSim":

function [tr,sec,cur,trc_x,trc_y]=RunSim(step_num,start_x,start_y)
% run the simulation.
% in: number of steps, initial position (x and y)
% out:
% tr - a matrix, each position's value is the number of steps the rat spent in that position
% sec, cur - the security and curiosity factors values.
% trc_x, trc_y - the x and y coordinates of the rat's motion throughout the simulation

note: by typing "help <function name>" you'll get the first remarks of the function. This is true
for all functions.

4. To view the results you can call "mesh(tr)", to see the "tr" matrix, you can call "plot(sec)"
or "plot(cur)" to view the internal factors, or call "comet(trc_x,trc_y)" to view a comet plot of the agent's
motion.

5. You can read through the files by opening them with Matlab editor. The code is documented and very easy to understand.
If you want to make modification, it can be done very easily, and we can help with it.

Enjoy,

Hanan and Naphtali.
 
