Skip to content

Commit

Permalink
add mode split validation visualization
Browse files Browse the repository at this point in the history
add mode split validation visualization for geotype A
  • Loading branch information
arielgatech committed Oct 13, 2021
1 parent d1d67af commit 80d247f
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 55 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Dashboard/.DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions Dashboard/.Rhistory
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("/Volumes/GoogleDrive/My Drive/GEMS/validation/speed/NPMRDS/MFD.VolDens.al_ca_oct2018_1hr.RData")
View(all)
install.packages("plotly")
shiny::runApp()
runApp()
runApp()
runApp()
55 changes: 0 additions & 55 deletions Dashboard/App.R

This file was deleted.

31 changes: 31 additions & 0 deletions Dashboard/Data/Geotype-A_GEMS_mode-split.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
,origin microtype,mode,trip count,total trip count,fraction,source
0,1,auto,105256863.05242537,170226552.6741795,0.6183339872592689,GEMS
1,1,bike,5631435.060389233,170226552.6741795,0.03308200143821292,GEMS
2,1,bus,4908356.753867383,170226552.6741795,0.028834260441508067,GEMS
3,1,rail,3995099.7575668865,170226552.6741795,0.023469310132912514,GEMS
4,1,walk,50434798.0499306,170226552.6741795,0.2962804407280975,GEMS
5,2,auto,139634783.32989755,193869830.79409844,0.7202501944626867,GEMS
6,2,bike,5964654.096493649,193869830.79409844,0.03076628308830823,GEMS
7,2,bus,3847737.191075813,193869830.79409844,0.019847013716963235,GEMS
8,2,rail,2337489.6541905217,193869830.79409844,0.012057005696121321,GEMS
9,2,walk,42085166.5224409,193869830.79409844,0.21707950303592058,GEMS
10,3,auto,112854843.04336894,147996639.0935156,0.7625500398833963,GEMS
11,3,bike,4123899.5035812715,147996639.0935156,0.027864818612370487,GEMS
12,3,bus,1326308.8022851332,147996639.0935156,0.00896174947220977,GEMS
13,3,rail,1240550.1380463622,147996639.0935156,0.008382285879225187,GEMS
14,3,walk,28451037.606233887,147996639.0935156,0.19224110615279813,GEMS
15,4,auto,49626427.42410725,63103353.7975216,0.7864309016497368,GEMS
16,4,bike,1663156.579572135,63103353.7975216,0.026356072688444903,GEMS
17,4,bus,336364.22960260854,63103353.7975216,0.005330370089074716,GEMS
18,4,rail,2350.424805034071,63103353.7975216,3.724722480798453e-05,GEMS
19,4,walk,11475055.139434567,63103353.7975216,0.18184540834793558,GEMS
20,5,auto,67707868.21529198,83381727.96877554,0.8120228479871148,GEMS
21,5,bike,2147718.931013588,83381727.96877554,0.025757668776279823,GEMS
22,5,bus,355401.54856232816,83381727.96877554,0.004262343288153221,GEMS
23,5,rail,1.417308769222646,83381727.96877554,1.6997833982924823e-08,GEMS
24,5,walk,13170737.856598891,83381727.96877554,0.15795712295061837,GEMS
25,6,auto,4420309.731373125,5589110.621797477,0.7908789126724313,GEMS
26,6,bike,246525.1574303584,5589110.621797477,0.04410811918248902,GEMS
27,6,bus,4669.04776252708,5589110.621797477,0.0008353829577675273,GEMS
28,6,rail,1.8556085401154753e-19,5589110.621797477,3.32004260727748e-26,GEMS
29,6,walk,917606.6852314665,5589110.621797477,0.16417758518731218,GEMS
31 changes: 31 additions & 0 deletions Dashboard/Data/Geotype-A_NHTS_mode-split.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
,origin microtype,mode,trip count,total trip count,fraction,source
0,1,auto,42404154.44023713,83216991.63991156,0.5095612519102378,NHTS
1,1,bike,1618540.2556582787,83216991.63991156,0.019449636711957433,NHTS
2,1,bus,5672258.30567043,83216991.63991156,0.068162261022543,NHTS
3,1,rail,7298142.843508278,83216991.63991156,0.08770015233292845,NHTS
4,1,walk,26223895.79483745,83216991.63991156,0.31512669802233334,NHTS
5,2,auto,79775552.59621558,96263322.75107084,0.8287221998611942,NHTS
6,2,bike,1026125.0629826707,96263322.75107084,0.010659564137798849,NHTS
7,2,bus,3213606.5793309375,96263322.75107084,0.03338349942107301,NHTS
8,2,rail,1065441.8181112115,96263322.75107084,0.011067993371331653,NHTS
9,2,walk,11182596.69443045,96263322.75107084,0.1161667432086023,NHTS
10,3,auto,61648452.89462738,74728137.60607152,0.8249697486053574,NHTS
11,3,bike,523806.60196035804,74728137.60607152,0.0070094962719611485,NHTS
12,3,bus,2648929.3496604506,74728137.60607152,0.03544754940400428,NHTS
13,3,rail,1454306.3694573117,74728137.60607152,0.019461295517943594,NHTS
14,3,walk,8452642.390366022,74728137.60607152,0.11311191020073355,NHTS
15,4,auto,27333215.491748232,32035252.880729046,0.853223028814942,NHTS
16,4,bike,239398.83900807326,32035252.880729046,0.007472981090531199,NHTS
17,4,bus,1294763.1370164412,32035252.880729046,0.040416822737032676,NHTS
18,4,rail,217562.29078887994,32035252.880729046,0.006791339890429132,NHTS
19,4,walk,2950313.122167417,32035252.880729046,0.09209582746706492,NHTS
20,5,auto,37969388.20576688,43155470.35956204,0.8798279311849495,NHTS
21,5,bike,275511.2216271808,43155470.35956204,0.006384155226016098,NHTS
22,5,bus,1509967.6618552266,43155470.35956204,0.03498902107367856,NHTS
23,5,rail,190289.9575914032,43155470.35956204,0.00440940525050355,NHTS
24,5,walk,3210313.3127213526,43155470.35956204,0.07438948726485232,NHTS
25,6,auto,2801041.5525878076,3598746.0068294723,0.7783382176102921,NHTS
26,6,bike,45628.763821944645,3598746.0068294723,0.012679073136963061,NHTS
27,6,bus,70321.50369909857,3598746.0068294723,0.019540557618027744,NHTS
28,6,rail,127817.38758121117,3598746.0068294723,0.03551720164152942,NHTS
29,6,walk,553936.7991394104,3598746.0068294723,0.15392494999318768,NHTS
19 changes: 19 additions & 0 deletions Dashboard/global.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#library(shiny)
library(shinydashboard)
library(plotly)
library(ggplot2)

scenario_list <- c('Geotype A')
metric_list <- c('Mode split', 'Speed', 'trip Count', 'Trip travel time', 'Zonal VMT')
validation_source <- c('NHTS', 'NPMRDS')
analysis_type <- c('Visualization', 'Summary statistics')
microtype_set <- list("Microtype 1" = 1, "Microtype 2" = 2,
"Microtype 3" = 3, "Microtype 4" = 4,
"Microtype 5" = 5, "Microtype 6" = 6)
microtype_list <- c(1, 2, 3, 4, 5, 6)
geotype_set <- list("Geotype A" = 1, "Geotype B" = 2, "Geotype C" = 3)
mode_set <- list('Auto' = 'auto', 'Bus' = 'bus', 'Biking' = 'bike', 'Walking' = 'walk')
mode_list <- c('auto', 'bus', 'bike', 'walk')
sample_model_output <- read.csv('Data/Geotype-A_GEMS_mode-split.csv')
sample_validation_output <- read.csv('Data/Geotype-A_NHTS_mode-split.csv')
sample_mode_split_validation <- rbind(sample_model_output, sample_validation_output)
12 changes: 12 additions & 0 deletions Dashboard/server.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
library(shiny)

shinyServer(function(input, output, session){


output$plot1 <- renderPlot({
validation_data <- sample_mode_split_validation[sample_mode_split_validation$origin.microtype == strtoi(input$microtype_selection),]
#print(validation_data)
ggplot(validation_data, aes(x = mode, y = fraction, fill = source)) +
geom_col(position = position_dodge())
})
})
38 changes: 38 additions & 0 deletions Dashboard/ui.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ui <- dashboardPage(
dashboardHeader(title = "GEMS validation"),
dashboardSidebar(
selectInput("scenario", "Scenario",
choices = scenario_list, selected = scenario_list[1]),
selectInput("metric", "Metric",
choices = metric_list, selected = metric_list[1]),
selectInput("validation_dataset", "Validation Dataset",
choices = validation_source, selected = validation_source[1]),
selectInput("analysis_type", "Type of Analysis",
choices = analysis_type, selected = analysis_type[1])
),


dashboardBody(
# Boxes need to be put in a row (or column)


fluidRow(

box(title = "Comparison chart", width = 8, plotOutput("plot1", height = 300)),
column(3,
#h3("Select analysis controls"),
selectInput("microtype_selection", "Select Origin Microtype",
choices = microtype_list, selected = microtype_list[1])
# checkboxGroupInput("Microtype_selection", label = h3("Microtypes"),
# choices = microtype_set,
# selected = microtype_set),
# checkboxGroupInput("mode_selection", label = h3("Select Modes"),
# choices = mode_set,
# selected = mode_set)

),
br()

)
)
)

0 comments on commit 80d247f

Please sign in to comment.