HBA Specto Incorporated

Land Use, Transport and Spatial Economic Modelling

Land Use, Transport and Spatial Economic Modelling

PECAS Software

PECAS is open source software. It is licensed under the Apache License version 2.0. It consists of a number of components that work together.

PECAS run scripts

Most users interact directly with the PECAS run scripts. They are stored in the PECAS-Public public project on Bitbucket.org. These are public git repositories, so can be acquired using the normal procedure of cloning the git repository to your own machine.

If you would like to submit any improvements to these repositories, please create a pull request on Bitbucket.

(You need a BitBucket account to see the Project, but the individual repositories can be accessed at the links below without an account.)


RunPECAS is the main PECAS run script. It is written in Python. It is for sequencing and monitoring the steps needed to run PECAS. This includes the main run program, the subsidiary run modules for each module, and run tasks like database backup and restore.

It also contains such basic items as the Makefile used to install PECAS, and the template pecas.yml settings file used to select different run options and control different features.

PECAS Routines

PECAS Routines contains assorted PECAS library routines, in a Python library. Some of these routines interact with the PECAS database through PostgreSQL libraries.

HBA Utilities

HBA Util contains a number of python utilities developed by HBA Specto Incorporated. Since these are used in PECAS, they have also been provided under the Apache License.

PECAS Technology Scaling

PECAS Technology Scaling contains a number of methods to both:

  • ensure that an economy is appropriately balanced over time, and

  • have economic growth or decline in alternative scenarios different from a base scenario.

As an example of balancing the economy, consider a forecast that has the health industry growing more quickly than population. PECAS Technology Scaling will increase the consumption rate of health care by households over time, to balance the increased supply against increased demand. (Note such automatic balancing is not always appropriate -- in the example perhaps the region is pursuing "heath tourism" as a policy for improving its future economic growth, so exports of health services should grow rather than automatically increasing the local consumption of health services.)

As an example of adapting growth rates, consider a major transit project designed to improve the attractiveness of the region. If the base scenario does not have the major transit project, and the project does indeed provide net spatial economic advantages, the alternative scenario should have larger economic and population totals. PECAS Technology Scaling is used in a run with identical control totals to calculate the economic advantages of the project, and a third scenario is then generated that has appropriately increased control totals.

HBA TDM Server

HBA TDM Server is a python-based web request system so that PECAS can start and monitor runs of a travel demand model (TDM). Many typical travel demand modelling software packages are designed to run on Windows Desktop computers, rather than as standalone utilities. This allows PECAS, running on a server computer, to send "land use" datafiles over to the TDM computer, then tell the TDM computer to run a particular scenario in a particular year. PECAS then waits for the TDM to be finished, before retreiving the "skims" representing the resulting congested travel conditions in that scenario and year. PECAS runs through time, and hence needs to run the TDM in different years. This allows the unattended execution of the travel demand model, usually on a different computer than PECAS, in different scenarios and years.

PECAS Visualizations

PECAS Visualizations contains the source code for a QGIS plugin that interacts with the MapIT service. Users can create GIS views of model results, comparing scenarios, on the MapIT website. The plugin in QGIS allows users to easily import these GIS views into QGIS, while maintaining their linkage to the MapIT URL. Scenarios and the impact of policy can then be investigated with the full power of QGIS.

Code versioning and typical install procedure

An extremely important part of PECAS is code versioning. When doing economic analysis of scenarios involving the investment of billions of dollars of public money, it is critically important to be disciplined in the running of each scenario, and in the comparisons between scenarios to analyze the impact of policy and/or investment.

To ensure that a PECAS run scenario is exactly reproducible, a normal procedure is to acquire a full PECAS scenario for a model from the version control system for that model (e.g. many PECAS users store their scenarios on HBA Specto's Subversion repository.) ![Alt Text][Alt Text](https:/![Alt Text][Alt Text](https:/![Alt Text][Alt Text](https:/Linked Text/)/)/) There will be a Makefile in the scenario and a file called repositories.yml. The file repositories.yml contains the detailed git version ID of the software used for the scenario. For example, it may look like this:

runpecas_version: 5ce9c2e6c150aee916fdfa5e2e10aa10c00af71b
pecas_routines_version: fed42d9a5c150192afd7ac6c58a52c184a31d62e
pecas_technology_scaling_version: e602aa1268396a54011c2d34944b890f7b5dcd1e
hbautil_version: 9b2a17fe1ad8704d121dcd180a72399b805cf0ea

To install the correct version of the PECAS software for the scenario, type

make _install

in the directory, and the versions identified in repositories.yml will be installed. Scenarios that will be compared with each other (e.g. a policy scenario and its base scenario) should have the same repositories.yml file.

If you would like to install the very latest versions of PECAS and update your repositories.yml file, you can type

make _install_latest_from_repository

If you don't have access to an existing scenario with its Makefile, you can find an example Makefile in the Run PECAS repository. This will allow you to install the latest PECAS software from the repositories using make _install_latest_from_repository.

PECAS requires a PostgreSQL database server.

(NOTE under Microsoft Windows, you should install git bash and Chocolatey. Then from git bash you can easily use Chocolatey to install some basic functionality to your computer, such as Python3 and the make program which is used in the above commands when installing PECAS.)

Core PECAS modules software

The core PECAS modules are battle-hardened high-performance software written in Java. These have been continually tested and improved over several decades. They take advantage of the latest performance improvements in Java. They are distributed to users from time-to-time as Java .jar files. The latest versions are not provided at a public download link by HBA Specto, rather they are provided to to clients as part of ongoing model development.

The Java .jar files are included in your classpath variable when running PECAS. Put your version of the jar files in the AllYears/Code folder of your Scenario, so that Run PECAS can find them. (Note ensure that your pecas.yml file from Run PECAS in the root directory of your scenario points to the correct version of your PECAS .jar files.)

Recent versions of all the required .jar files (include the PECAS .jar files) are available from the HBA Specto Incorporated website, however you should acquire the latest version from the model you are supporting, rather than downloading the ones off of our website. The Apache License version 2.0 allows PECAS users to to redistribute the PECAS core code with or without modifications. The source code for the PECAS core modules is included within the PECAS .jar files, should you need to make any changes to the code.

There is no need to run an install script for the core modules. Java is a "Write Once Run Anywhere" platform, so the appropriate .jar files that are stored with the scenario in the AllYears/Code directory will run on any computer with a recent Java runtime installed.

Other Related Software

Some software is provided by HBA Specto Incorporated to its clients and used to run or calibrate their PECAS models, or prepare inputs or analyze or visualize outputs. These are not licensed as open source software and so are not redistributable. If you have this software please check the terms of the contract under which you acquired it. You may have the source code and you may have the right to modify the source code for internal use, with or without the help of other consultants.

  1. MrsGUI The web interface to run PECAS on different servers.

  2. MapIT A web based system for building GIS maps comparing years and scenarios.

  3. Mapit 2 A flexible database view generation system, embedded in a website, that generates QGIS project files from views designed for a project, using QGIS template files developed for a project.

  4. Flow Cluster Tool A system to visualize the spatial economic flows in clusters, using Javascript on the browser to generate the clusters based interactively.

  5. Editable GIS Views Creates streamlined views in the PECAS database that can be edited using GIS programs, and also generates appropriate QGIS projects that have these views loaded with legends and themes.

  6. Mapit Partitioning The MapIt database can bog down in performance if many scenarios are run and compared. This set of scripts and functions partitions the larger tables in the database based on scenario, so that old scenarios don't need to be removed from the database for performance reasons.

  7. PECAS Run Remote This allows remote machines (e.g. Amazon Web Services) to run PECAS.

  8. LizMap Server This embeds QGIS in a web browser interface, so that some users can interact with the advanced QGIS maps without installing QGIS.

  9. Parcel Cut is a GIS algorithm to divide large parcels into smaller portions suitable for single developments. It follows a grid-like pattern, but accounts for uneven edges while keeping each cut piece an identical size. Parcel Cut uses PostGIS functions together with Python code. Intensifying an existing parcel by adding new space (e.g. new buildings, expanding buildings) has different construction cost functions and probabilities in the Space Development module than developing a vacant parcel, so large parcels should be subdivided if they are zoned for development. Then the calibration that was performed on existing subdivisions is relevant to new (future) subdivisions. Previous versions of SD would apply "pseudo-parcelling" on-the-fly, without a GIS and visual interpretation. The popular Deterministic Microsimulation Algorithm in SD does not work with on-the-fly pseudo-parcelling, so Parcel Cut in advance is recommended to treat areas of potential future subdivisions. (If you are not using Deterministic Microsimuation in SD you can apply Parcel Cut in arrears to visualize the pseudo-parcelling.)

  10. PECAS Calibration is a set of procedures used to calibrate a PECAS model. This includes:

    • Bayesian SD Calibration

    • Technology Option Calibration
      • By consumption and production amounts
      • By choice proportions for options, e.g. for lifestyle clusters
    • Economic Flow Length Calibration (a.k.a. Trip Length Calibration)

    • Floorspace Calibration (quantity and price of space by zone)

  11. Technology Option Generator is a set of scripts to generate a discrete set of technology options for activities consistent with observed choices and the Aggregate Economic Flows table. These options are stored in the input file TechnologyOptionsI.csv. The generator also sets up appropriate input files for Technology Options Calibration.