Git Product home page Git Product logo

shadia's People

Contributors

danstich avatar eringilligan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

galuardi

shadia's Issues

Multiple values per dam for timing

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
  )

v-2.0-updates

Need to implement significant updates to the package prior to submission of new models to peer review. These will include issues
#18, #22, #24, #38, #46, #47

These and other changes will include:
[x] Change watershed default value to FALSE because this will be used more commonly moving forward
[ ] Implementation of the downstream delay parameter
[ ] Implementation of truck & transport and user-facing arguments
[ ] Implementation of juvenile stocking at arbitrary locations in the watershed and user-facing arguments
[x] Implementation of seasonal passage performance standard specification or derivation
[x] Separation of adult and juvenile downstream dam survival and user-facing argument for downstream_juv
[x] Memory management and speed improvements (reduction of redundant object returns)
[ ] Ability to read upstream and downstream passage efficiencies from .csv files
[x] Ability to specify starting population size as number of spawners instead of age-1 fish
[ ] Implementation of Salmon Falls River model
[ ] Add watershed output toggle to models other than mohawkHudsonRiverModel()

Generalize application of moveC and delayC

I want to generalize the application of the individual-based upstream migration model (moveC) and delay calculations (delayC) based on the number of routes (nRoutes). Right now, we use logical queries based on river name, but several of the routines are identical based on number of routes.

CTR Fish not passing

Fish in the Connecticut River ABM are not passing upstream in the manner in which they should. Numbers in PUs 3-5 are shockingly low, and they do not match previous results from old code. This is probably a result of retroactively fitting this code into the PNR and MMR code. Need to have a look at this. Otherwise, the model is looking good.

Timing for watershed-scale models

Related to issue #24.

It appears that timing values for the first dam are not recycled at remaining dams as intended when watershed = TRUE.

Temporary workaround: can pre-sample the value for timing and then pass to function using object name, like this:

# Sample timing
times <- sample(c(1,2,3),1)  

# Run the model
res1 <- connecticutRiverModel(
  nRuns = 1,
  nYears = 2,
  timing = list(times, times, times, times, times),
  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
  )

Saco: dam passage being filled incorrectly

Upstream and downstream passage efficiencies are not being filled correctly during data write. May be occurring in fillOutputVectors.R or in writeData functions. The passage efficiencies are being implemented in the individual-based migration model (moveC) correctly as evidenced by movement of fish throughout the river.

setUpData slowing down

As we add more data sets, the data set up is slowing down. A lot of the fat can be trimmed from some of the data sets to speed load because we don't use a lot of the data but manipulation is done in place for transparency. Can do ahead of time, comment out code, and leave in place unused for reproducibility.

Standardize naming conventions

This one is a long way off and fairly low priority right now. But, would be nice to standardize naming conventions between inputs and outputs of all river models.

Remote parallel execution

Need to develop a direction/examples for parallel execution on remote clusters. Right now, it is up to the user to know how to do this.

Add @param for initial spawning population size

Would like to add this as "number of adult spawners". John S suggested reverse-engineering stable age distribution from a Leslie matrix. Can be done pretty easy by importing from demogR package as we do in anadrofish.

Bug: invalid length argument with no traceback

Looks like a bug was introduced in one of the variable storage routines during transition to a package. I think this may be related to garbage collection in R/innerLoopSampling.R. Need to look into it, because it causes cores to crash and execution is halted.

Fish not moving into NY

Fish in the Susquehanna River model are not moving into NY waters in the 'North Branch' movement route (upstream_path == 4). Thought that it was due to temperatures or long distance from mouth of river, but I cranked up movement speed parameters and closed off other routes, and fish are still not making it. Might be fine, but need to take a closer look.

R code cleanup

Remove deprecated or unused R code from release version

Comment updates

Need to update and double-check comments in .R files to make sure they are accurate.

User-specified arguments

Right now, changes to dam passage performance standards need to be specified in outer-loop-sampling.R

We need a way that these can be specified in the call to penobscotRiverModel() once the package is loaded. Ideally, this would be able to incorporate:

  1. Dam-specific upstream and downstream passage efficiencies for individual dams (or all dams set to be the same).

  2. Some standardization so that it can be passed from river to river as we develop more models.

Dam passage efficiencies not aligning

During first watershed application for a re-licensing, I noticed that the passage efficiencies for each dam were being randomly drawn from the values of the first dam, instead of all being set to the same randomly drawn value (intention).

I have added patches to all of the main ...RiverModel functions to resolve the issue

Daily vs seasonal passage

Need: functionality for users to supply seasonal passage efficiencies that we can convert to time-based rates.

Justification: we traditionally think about upstream and downstream passage in terms of seasonal efficiency and most projection models make assumptions about bulk efficiency to simulate effects of dams (habitat access) on populations. The models in shadia use individual-based migration models instead of (state-based) projection matrices. Upstream passage through dams is parameterized as a probability of passage per unit time (e.g. daily rates). This was done to align with how dam passage standards are prescribed and assessed (e.g. telemetry studies).

Results cleanup

Need to clean up results so that:

  1. only relevant outputs (excluding vars for sensitivity analysis) are returned in results list
  2. names match input/output parameter notation from manuscript

populationSize doesn't match sum of PUS

populationSize is calculated as the sum of males and females across production units before application of pre-spawn mortality, fishing mortality, and post-spawn mortality.

Production-unit population sizes are currently calculated after application of those rates.

Should re-code R files used in penobscotRiverModel() and merrimackRiverModel() so that the sum of production-unit spawners equals populationSize.

Results check

Double check to make sure that results across temporal and spatial replicates are equal

Juvenile downstream survival

Need to add ability to specify downstream survival through dams separately for juveniles and adults. Not sure what the best way is to do this. Could use a multiplier, but that would not allow for dam-specific juvenile survival evaluation. Can add as user-specified arguments, but the functions for each of the river models are getting really cumbersome to write out with all of the optional arguments...

Merrimack River needs second migration route

Following conversations with Michael Bailey, US Fish and Wildlife Service, Nashua, NH:

We need to add a second migration route for the Merrimack River. The second route needs to come in at the Pawtucket Dam, where there are two options for upstream and downstream migration. Should be two paths up, and two paths down. The two routes split about 1 km apart (upstream to downstream). Habitat is the same in both routes-- just need to sum within PUs across routes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.