Tuesday, February 21, 2006

Car Cruising model: A GIS Example


A good example of where GIS can be introduced into a model, is for dynamic car cruising within the Santa Fe downtown area. The model was created by Stephen Guerin, Simran McKenna and Dayoung Jung using NetLogo.

The background map of the model is the result of converting GIS data into an image, initally a jpeg file. It was then converted into a text format image file: PPM (portable pix map) consisting of three RGB values for each pixel. These were converted into NetLogo color values using the import-ppm procedure. The data was cleaned up a bit within Netlogo itself with the cleanup-map procedure, then written to an external data file via the export-dat procedure. Finally, for this version of the model, the data written out in the preceeding step was cut & paste into the model as an array of integer values. See http://backspaces.net/hacks/23/netlogo-cruising-model for a blog entry on the topic.

The model itself simply manages automobiles driving on the map staying on the "streets" by using the patch colors as guide. The cars randomly choose side streets as they see them, choosing to turn roughly 1/3 of the time in the move-forward procedure. It chooses its next location by seeing if it should turn as just described, or by choosing a forward direction in a set of increasing angles of forward cones.

The model works by the agents being initialized on a street at a random location. They then use a simple move-forward proceedure to choose a reasonable next location.

No comments: