Composite traffic model: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎R model: vehicle kilometers and a part of costs added to model)
(→‎R model: more cost related R code added)
Line 239: Line 239:
test3$Driver.cost <- test3$vehicle.kilometers / speed * driver.salary
test3$Driver.cost <- test3$vehicle.kilometers / speed * driver.salary


emis.cost.PM <- 201.879 # €kg^-1
PM.lethality <- c(-7.223e-004, 5.640e-006, 4.228e-005, 5.987e-005, 8.013e-005, 1.150e-004, 2.037e-004, 2.939e-004, 3.598e-004, 4.132e-004,
4.640e-004, 5.139e-004, 5.662e-004, 6.233e-004, 6.854e-004, 7.577e-004, 8.441e-004, 9.519e-004, 1.093e-003, 1.314e-003, 2.805e-003)
 
PM.lethality <- median(PM.lethality) # deaths / kg
 
value.of.life <- (2e6 + 0.98e6) / 2 # runif(n, 0.98e6, 2e6) # € / death
 
emis.price.PM <- PM.lethality * value.of.life # 201.879 # €kg^-1
 
emis.price.CO2 <- 10e-3 # runif(n, 5e-3, 40e-3) # €kg^-1, the price of CO2 allowances fluctuates quite a bit, in 8.8.2011 they
# were going for 10.74 € per ton of CO2 equivalent
 
test3$CO2.cost <- test3$Emis.CO2 * emis.price.CO2
 
test3$PM.cost <- test3$Emis.PM * emis.price.PM


test3
test3

Revision as of 11:26, 11 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

Variables

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|}}


----#: . Takes below 10 minutes to run. Neat! --Teemu R 14:08, 2 August 2011 (EEST) (type: truth; paradigms: science: comment)

----#: . Though much slower on the serverside R... --Teemu R 14:26, 2 August 2011 (EEST) (type: truth; paradigms: science: comment)