-
Notifications
You must be signed in to change notification settings - Fork 0
SWIM VIZ
The SWIM reporting and visualization database provides a consistent and central approach to SWIM outputs. The SWIM visualization database is a subset of common model outputs for each scenario. It consists of the significant and most often used outputs in various summary forms.
The SWIM microsimulation reporting and visualization database is an extension to the SWIM VIZ DB. It consists of microsimulated records for households, persons, tours, trip, and truck trips. MicroViz never worked and has been moth balled. The content has been kept on this wiki page for historic purposes incase it is ever brought to life, but note that none of the references to MicroViz work.
The SWIM VIZ database is implemented in SQLite. SQLite was chosen as the database platform since it is easy to use, open source, fast, familiar to ODOT, and has both an R and Adobe Flex interface.
R was chosen as the programming language for the database creation process since R is a high level language for data manipulation with many built-in features useful for this task, is familiar to ODOT, is interpreted so the script can be more easily modified/updated in the future, and because the performance is acceptable for the task. There are three R scripts:
-
build_Viz_DB.R - run to create a SQLite database for each year for each scenario. This database will include transport outputs only for transport years by looking for
PK_PATHS.ver
in the year directory. - all_Viz_DBs.R - calls the first script to generate a SQLite database for each year of a scenario. The script runs the build_Viz.DB.R script for each year and then merges all the databases into one database with a table for each year. For example, the table Trips_SDT_t16 represents the Trips_SDT time step 16 table (2006).
- build_MicroViz_DB.R - run to create a SQLite micro viz db for each year for each scenario
In addition, the AllZones.csv file is required and defines the ALLZONES table, which is a comprehensive list of all zones in the model, including some additional attributes. Refer to the ALLZONES table for more information.
The SWIMVIZ databases are built by running the VIZ and MICROVIZ modules in the tSteps config file. The VIZ column in the config file should have a vlue of 1 for the year that needs to be compiled into a SWIMVIZ database and left blank for the years that should be excluded. The VIZ module for all years except for final year is run in parallel by calling the module in a independent command prompt.
To manually run the scripts do the following:
- Copy the R scripts and the additional input file (AllZones.csv) to a folder such as Z:/viz.
- To run the build_Viz_DB.R script, run the script in the scenario year folder of interest – for example on the SDC cluster for year 2006: Z:/viz/SCEN_2006_to_2024_Reference_08Nov/t16. The script assumes all files to process are in the current working directory, except for the additional input files, which are identified in the script parameters. The output database is named _t.db - for example: SCEN_2006_to_2024_Reference_08Nov_t16.db. The script can be run with:
R --no-save < “Z:/viz/build_viz_db.R” > log.txt ALLZONESFILENAME="Z:/viz/allzones.csv" SPATIALONLY=F
- To run the build_MicroViz_DB.R script, run the script in the scenario year folder of interest – for example on the SDC cluster for year 2006: Z:/viz/SCEN_2006_to_2024_Reference_08Nov/t16. The script assumes all files to process are in the current working directory, except for the additional input files, which are identified in the script parameters. The output database is named _t_micro.db - for example: SCEN_2006_to_2024_Reference_08Nov_t16_micro.db. The script can be run with:
R --no-save < “Z:/viz/build_MicroViz_db.R” > log.txt INDCODEFILE=”z:/models/oregon2tm/parameters/IndustryOccupationSplitIndustryCorrespondence.csv”
- To run the all_Viz_DBs.R script, run the script in the scenario root folder – for example: Z:/models/oregon2tm/SCEN_2006_to_2024_Reference_08Nov. The script will output a database named .db – for example: SCEN_2006_to_2024_Reference_08Nov.db in the scenario root folder. This database contains a table for each table in the year databases. The script can be run with:
R --no-save < “Z:/viz/all_viz_db.R” > log.txt BUILDDBS=T BUILDSCRIPTFILENAME="Z:/viz/build_Viz_DB.R"
ALLZONESFILENAME="Z:/viz/allzones.csv" SPATIALONLY=F
- The following script parameters are defined:
- BUILDDBS – T/F to run build_viz_db.R for each year
- BUILDSCRIPTFILENAME – filename to the build_Viz_DB.R script
- ALLZONESFILENAME – filename to the all zones file
- SPATIALONLY – T/F to generate only spatial tables (not transport tables)
- INDCODEFILE – filename to the industry coding file
- MICRO – “T” to tell the script to generate the microsimulation VIZ DB
- ALLZONES - all the zones in the model, including a WKT version of the zone polygons export from VISUM
- BZONE - land use beta zones
- ACTIVITYLOCATIONS - quantity of activity generated in the BZONE. The quantities are in 1990$ except for Household activities which are in Households. It also contains the quantity of labor used by activity and the employment.
- BUYSELLMATRIX - relevant Buy or Sell matrix from PI for each BZONE OD pair for each COMMODITY. The Sell matrix is stored for labor and the Buy matrix is stored for goods and services.
- EXCHANGERESULTS - stores demand, supply, price, etc, results from PI by BZONE and COMMODITY. It also stores the transport component of the utility.
- FLR_INVENTORY table stores the sum of the floorspace inventory results from ALD by BZONE and COMMODITY. It also includes the capacity by BZONE and COMMODITY and the increment change by BZONE and COMMODITY from the last time step.
- AZONE - contains the population and employment at the alpha zone level for each travel model year.
- DC_LOGSUM - stores average logsums by BZONE, trip PURPOSE, and market SEGMENT.
- TRIPS_SDT - stores aggregated trips and trip distances by trip origin BZONE from SDT by BZONE, HHINC, TRIPPURPOSE, and TRIPMODE. There is a column of trips for each time period.
- TRIPS_LDT - stores aggregated trips and trip distances by trip origin BZONE from LDT by BZONE, HHINC, TRIPPURPOSE, TRIP MODE. There is a column of trips for each time period. LDT includes non-commute trips over 50 miles as well.
- TRIPS_CT - stores aggregated trips, trip distances, and commodity weights by trip origin BZONE, TRUCKCLASS and COMMODITY. There is a column of trips for each time period. There is a column of weights for each time period.
- TRIPS_ET - stores the aggregate trips and trip distances by trip origin BZONE and TRUCKCLASS. There is a column of trips for each time period. ET includes EE truck trips and import/export trips within 75 miles of the study area border.
- TLFD_SDT - trip length frequency for SDT trips by MODE, PURPOSE, and DISTANCE.
- TRIPS_SDT_Home - stores aggregated trips and trip distances by HH home BZONE from SDT by BZONE, HHINC, TRIPPURPOSE, and TRIPMODE. There is a column of trips for each time period.
- TRIPS_LDT_Home - stores aggregated trips and trip distances by HH home BZONE from LDT by BZONE, HHINC, TRIPPURPOSE, TRIP MODE. There is a column of trips for each time period. LDT includes non-commute trips over 50 miles as well.
- TRIPS_CT_Home - stores aggregated trips, trip distances, and commodity weights by tour production BZONE, TRUCKCLASS and COMMODITY. There is a column of trips for each time period. There is a column of weights for each time period.
- TRIPMATRIX - stores total vehicle trip OD matrices for each BZONE OD pair for each time period and mode from SDT, LDT, CT, and ET. Note that the SR2 and SR3P modes are vehicle trips not person trips.
- SKIM - stores for each BZONE OD pair the following network indicator skim matrices: distance, travel time, and toll for peak and offpeak for auto and truck. The skims are collapsed from AZONES to BZONES by a weighted average of drive alone or truck trips for each OD pair for the time period.
- LINK_DATA - contains all of the link-level variables export from VISUM.
AllLinks.csv contents
- COUNTLOCATIONS - contains the VISUM count locations table.
- MODELWIDE - contains various data points such as composite utilities and size by activity and total construction dollars.
- TSTEP - contains information on the time steps modeled in the scenario.
- HH - synthetic households
- PER - synthetic persons
- TOUR_LDT_MICRO - microsimulated LDT tour records
- TOUR_SDT_MICRO - microsimulated SDT tour records
- TRIP_LDT_MICRO - microsimulated LDT trip records
- TRIP_SDT_MICRO - microsimulated SDT trip records
- TRIP_CT_MICRO - microsimulated CT trip records
- LINK_DATA - contains all of the link-level variables export from VISUM
SWIM-TLUMIP Model User Guide, version 2.5
- SI - SWIM Inputs
- NED - New Economic Demographics
- ALD - Aggregate Land Development
- AA - Activity Allocation
- POPSIMSPG - PopulationSim Synthetic Population Generator
- PT - Person Transport
- CT - Commercial Transport
- TA - Traffic Assignment
- TR - Transit Assignment
- SL - Select Link
- SWIM VIZ - Reporting DB