Composite traffic model: Difference between revisions

From Opasnet
Jump to navigation Jump to search
m (bugfix)
(trip data downloaded as one, instead of smaller bits, many times faster, but requires more memory)
Line 28: Line 28:


times <- seq(1, 25, 1 / n.intervals.per.h)
times <- seq(1, 25, 1 / n.intervals.per.h)
times[length(times)] <- 1


library(OpasnetBaseUtils)
library(OpasnetBaseUtils)
Line 36: Line 37:
trips.locs <- op_baseGetLocs("opasnet_base", "Op_en2625", apply.utf8 = FALSE)
trips.locs <- op_baseGetLocs("opasnet_base", "Op_en2625", apply.utf8 = FALSE)


for (i in 1:(length(times) - 2)) {
trips <- op_baseGetData("opasnet_base", "Op_en2625")
 
for (i in 1:(length(times) - 1)) {
if(i == 1) {
if(i == 1) {
trips.sample.1 <- op_baseGetData("opasnet_base", "Op_en2625", include = trips.locs$loc_id[trips.locs$ind == "Time" &  
trips.sample.1 <- trips[trips$Time == times[1],]
trips.locs$loc == as.character(times[1])])
#trips.sample.1 <- op_baseGetData("opasnet_base", "Op_en2625", include = trips.locs$loc_id[trips.locs$ind == "Time" &  
# trips.locs$loc == as.character(times[1])])
trips.sample.1$Secondary <- 0
trips.sample.1$Secondary <- 0
} else {
} else {
Line 47: Line 51:
}
}
trips.sample.2 <- op_baseGetData("opasnet_base", "Op_en2625", include = trips.locs$loc_id[trips.locs$ind == "Time" &  
trips.sample.2 <- trips[trips$Time == times[i + 1],]
trips.locs$loc == as.character(times[i + 1])])
#trips.sample.2 <- op_baseGetData("opasnet_base", "Op_en2625", include = trips.locs$loc_id[trips.locs$ind == "Time" &  
# trips.locs$loc == as.character(times[i + 1])])
# Optimizer main code
# Optimizer main code

Revision as of 06:57, 1 August 2011



This page is about a composite traffic model that is an updated version of File:Composite traffic.ANA. The new version is coded with R.

Definition

R model

  • Trip aggregator
    • Optimization rules:
  1. No second transfer -> prioritize "secondary" passengers
  2. Fill as many 8-person-vehicles as possible
  3. Fill as many 4-person-vehicles as possible
  4. Special rule: for trips with no possible transfer-point -> direct trip
  5. Transfer the rest (will always be 4-person-vehicles)
  6. Re-check vehicle configurations, when exact numbers of primary and secondary passengers as well as transferees are known

+ Show code

TODO: {{#todo:Ruvetaan keräämään tälle sivulle matskua mallin uudesta versiosta.|Smxb|}}