Simulator
The simulator used in the design of the Social Gravity trials simulates the movement of pedestrian towards a fixed target, or towards a dynamic centroid. Factors such as the level of GPS noise, the coarsness of feedback, the quality of inertial sensor data, environmental constraints and walking paramaters can all be adjusted. The script can show the results interactively, or can run batch trials, compute summary statistics and generate a PDF report, complete with graphs.
An example report is shown
here (2Mb). Note that the simulator always writes all of the simulation parameters into the report, so that the results are reproducible.
Requirements and installing
The package can be downloaded
here (42Kb).
Unzip to a directory and start
gui.py to bring up the interface.
Python is required
Python, along with the following packages:
PyGame,
NumPy and
Matplotlib. It also requires a LaTeX installation to generate reports. On Windows,
MikTex is suitable.
Using
On running
gui.py the following interface will appear:
The simulator can be run in either
interactive mode by selecting the "interactive mode" option and then pressing "Run", or in batch mode, by selecting "batch mode". The "batch mode" will generate a PDF report file (eventually).
Interactive mode
Running in interactive mode will produce a display like this:

where the movement of the agents can be seen in real time. The small yellow circles represent the true positions of the agents. The red circles represent the position with GPS noise added; the pie shapes indicate the angular range in which feedback will be generated. A distance scale is shown at the bottom.
Parameters
The parameters have the following meanings.
All units are meters, seconds and degrees.
- Number of agents: self explanatory
- Field size: width of the area in which agents move
- Target radius: radius inside which convergence is considered to have happened
- Obstacle model: allows modelling solid obstacles. You can either
select one, or create or edit a new model.
- Stopping mode: if simple radius will stop when all agents are inside
target radius. In line of sight mode, all agents must also be able to
see each other (i.e. obstacles are taken into account).
- Centroid mode: Sprung -- use spring model for centroid computation
- Simple mean -- use simple geometric mean of points for centroid
-
- GPS Uncertainty: std. dev. of position noise (Gaussian noise)
- Angle uncertainty. std. dev. of angular noise (from sensing). (Gaussian noise)
- Fbk angle width: width of target as displayed to user (e.g. if
width=60, user will hear on-target sound when target is within 60
degrees of current heading)
- Walking rate: in m/s
- Scanning time: Time taken to find a new heading after stopping to find one.
- Step wandering variation: Randomness in walk behaviour in meters (0 =
walk in straight lines)
- Heading adjustment period: Time at which users check device to see if
they are still on target. This is probabilistic, with average time
given here.
- GPS noise update period: Time when GPS positional offset jumps. Again,
random with this average time.
- Heading mode: random -- always choose any random angle which is
compatible with fbk (i.e. within fbk angle width)
worst -- always choose the worst possible case (i.e. walk along the
edges of the feedback "code")
-
- These following paramters only have effect if centroid mode is "sprung"
- Spring K: strength of spring attraction
- Spring damping: damping of spring
- Spring breaking length: length at which agents break free of the centroid
-
- Iterations: Number of runs to execute in batch mode. Not used if interactive mode is chosen.