danStich / shadia

shadia: dam passage performance standard models for R
https://shadia-ui.github.io/index.html
GNU General Public License v3.0
6 stars 1 forks source link

Multiple values per dam for timing #24

Closed danStich closed 3 years ago

danStich commented 5 years ago

Cannot currently pass multiple values per dam to the timing argument in ...RiverModel due to an error in data write.

Temporary workaround: can pass a vector, to be sampled randomly, which achieves the same result as passing a vector (these are sampled randomly by internal functions to evaluate all input combinations:

res1 <- connecticutRiverModel(
  nRuns = 1,
  nYears = 10,
  timing = list(sample(c(1,2,3),1),1,1,1,1),
  upstream = list(
    holyoke = c(0.50, 0.60, 0.70),
    cabot = 1,
    spillway = 1,
    gatehouse = 1,
    vernon = 1
  ),
  downstream = list(
    holyoke = c(0.80, 0.90, 0.95),
    cabot = 1,
    gatehouse= 1,
    vernon = 1
  ),
  northfield = list(
    turnersA = 0.95,
    turnersJ = 0.95,
    vernonA = 0.95,
    vernonJ = 0.95
  ),
  pSpillway = 1,
  inRiverF = 0,
  commercialF = 0,
  bycatchF = 0,
  indirect = 1,
  latent = 1,
  watershed = TRUE
  )
danStich commented 3 years ago

resolved by recasting as a vector and using a sampled object in parallel examples.