Skip to content

matsim-melbourne/demand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MATSim population for Melbourne

masterpassing? devpassing?

This script generates a sample population for Melbourne based on the ABS 2016 census and using VISTA-like activities and trips.

Setup R

The population generation code (in the ./R directory) is written in R and a working knowledge of R is assumed here.

We use renv to manage the R package dependencies for this project. To install the required R packages locally inside this repository, do:

install.packages("renv")
renv::restore()

Ensure that your setup is working by running some quick tests:

testthat::test_dir("tests/testthat")

If all tests pass, you are all set to produce a sample Melbourne population using the steps below.

How to get the Melbourne Data

Download the required data files for generating the population and place them into ./data. For download instructions see ./data/README.md.

How to build a sample Melbourne population

Here is an example of how to build a small sample population (0.1%) for Melbourne with census-like persons and VISTA-like activities and trips, for weekdays:

Rscript -e 'setwd("R"); source("makeExamplePopulation.R"); runexample()'

The script is quite verbose and takes a few minutes to run. If all went well you should get the MATSim population in ./output/8.xml/plan.xml.

How to build a sample population for inner Melbourne:

Here is an example of how to build a small sample population (0.1%) for inner Melbourne with census-like persons and VISTA-like activities and trips, for weekdays:

Rscript -e 'setwd("R"); source("makeExamplePopulation.R"); runexample(samplePercent=0.1,outputDir="example_inner_melbourne",sa1Subset="../data/smallRegion.csv,allDestinations=FALSE,do.steps=c(T,T,T,T,T,T,T,T))'

Troubleshooting Windows installations

RTools is required in order to compile some libraries.

Udunits2 may be required to get the sf library to work:

install.packages("udunits2")

If there are still issues with the sf package, try installing the development version:

install.packages("remotes")
library(remotes)
install_github("r-spatial/sf")