next up previous
Next: Computing an Indicator Up: How To Run the Previous: Install Software and Download

Running a Simulation

In this part of the tutorial, you will execute a two-year simulation run of the Eugene-Springfield metro area.

  1. First, open a command window (yes, that archaic interface to the computer where you actually have to type commands). On Windows, go to the Start menu, choosing Run..., typing ``cmd'', and clicking OK. On the Mac, open a terminal window by picking ''terminal'' from Applications/Utilities in the Finder. On Linux, open a shell.

  2. Next, change directory to the workspace subdirectory containing the Eugene tools, e.g. C:\workspace\eugene\tools (modify this appropriately if your workspace has a different name). For example, on Windows type:

    cd C:\workspace\eugene\tools
    

    On the Mac, type:

    cd /Users/yourname/workspace/eugene/tools
    
    replacing yourname with your login name on your machine.

  3. Now enter the following command at the command line:

    python run_simulation_on_baseyear_cache.py
    

    This will launch a very simple graphical user interface that will allow you to run a test simulation. Note that the first time you launch one of these graphical user interfaces, it may take up to a minute to load. Subsequent launches are much faster.

    If you don't see the graphical user interface, check your task bar, as the application may be hidden behind another window.

    You may see a warning message like this:

    DeprecationWarning: ScipyTest is now called NumpyTest; please update your code
      test = ScipyTest().test
    
    Just ignore this warning -- it is a problem in the scipy package, which hopefully will be fixed in a later release of scipy.

  4. In the ``Get baseyear data from this cache directory'' field , enter the path to the location where you unzipped the baseyear cache, above, e.g. C:\urbansim_cache\eugene_1980_baseyear_cache\ on Windows, or /Users/yourname/urbansim_cache/eugene_1980_baseyear_cache/ on the Mac.

    The ``Use this configuration'' entry is pre-set to use the default baseline configuration in the eugene Opus package (eugene.configs.baseline), so you don't have to modify that now. If you had multiple scenarios configured, this is where you could set which one to run. Note that the name is in parts, separated by periods. These parts correspond with the system path to the actual module that has the configuration. Don't believe me? Look in the eugene\configs directory.

  5. In the ``Create the output cache in this directory'' field, set the output directory to a directory into which you want the simulation results to be written, e.g. C:\urbansim_cache. UrbanSim will create a new subdirectory at this location, named with an embedded date/time, such as run_2006_11_15_15_12, so that you can know when it was started and to reduce the chances of accidentally over-writing simulation results from earlier runs.

  6. Leave the ``Number of years to run'' at 2.

  7. To start the simulation, press the ``OK'' button. The tool will close, and UrbanSim will start running. While the simulation runs, a series of messages are sent to the command window to provide feedback on what is happening, but this will generally only need to be consulted if you are diagnosing a problem. The simulation takes about 3 1/2 minutes per year on a computer using a 3.2 GHz Intel\textregisteredPentium\textregistered4 processor, and about the same on a 2Gh Pentium\textregisteredM. On a 3Ghz Xeon\textregistered64-bit processor running Linux (Fedora Core 6) it runs in 35 seconds per year.

    If you want to stop the simulation while it is running, open the command prompt window and type Ctrl-C several times. When the simulation is finished, it will say something like:

    Done running simulation for years 1981 thru 1982
    

That's it! You have now installed Opus and UrbanSim, a full application for Eugene-Springfield, Oregon, and run a simulation using a default scenario.

The results are all stored on your computer in a subdirectory of the output cache, with a name that indicates when the output was created. If you run this multiple times, it will create a new directory for each run. The contents of these directories are the complete set of ``primary'' variables and values predicted for all objects in the model, from which UrbanSim can recompute any ''computed'' variables defined by an Opus . However, these results are in binary files (arrays) that are not easy to read directly. Now we move on to how to examine the results by creating indicators from them.


next up previous
Next: Computing an Indicator Up: How To Run the Previous: Install Software and Download
info (at) urbansim.org