Composite traffic model: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(trip data downloaded as one, instead of smaller bits, many times faster, but requires more memory)
(visualization added)
Line 145: Line 145:
trips.out <- rbind(trips.out, data.frame(trips.sample.1[, c("From", "To", "Time")], d8, d4, d3, d2, d1, c8, c4, c3, c2, c1))
trips.out <- rbind(trips.out, data.frame(trips.sample.1[, c("From", "To", "Time")], d8, d4, d3, d2, d1, c8, c4, c3, c2, c1))
}
}
# Summary
d8 <- tapply(trips.out$d8, trips.out$Time, sum)
d4 <- tapply(trips.out$d4, trips.out$Time, sum)
d3 <- tapply(trips.out$d3, trips.out$Time, sum)
d2 <- tapply(trips.out$d2, trips.out$Time, sum)
d1 <- tapply(trips.out$d1, trips.out$Time, sum)
c8 <- tapply(trips.out$c8, trips.out$Time, sum)
c4 <- tapply(trips.out$c4, trips.out$Time, sum)
c3 <- tapply(trips.out$c3, trips.out$Time, sum)
c2 <- tapply(trips.out$c2, trips.out$Time, sum)
c1 <- tapply(trips.out$c1, trips.out$Time, sum)
test <- data.frame(Time = names(d8), Type = rep(colnames(trips.out)[4:13], each = length(d8)),
Result = c(d8, d4, d3, d2, d1, c8, c4, c3, c2, c1))
test$Time <- as.numeric(as.character(test$Time))
library(ggplot2)
ggplot(test, aes(x = Time, y = Result, fill = Type)) + geom_area()
</rcode>
</rcode>


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

Revision as of 07:45, 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|}}