NREL / SSRS

A stochastic agent-based model for predicting raptor movements during updraft-subsidized directional flights
https://www.osti.gov/doecode/biblio/63192
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

Add options to specify a normal distribution of updraft thresholds #20

Closed ewquon closed 1 year ago

ewquon commented 2 years ago

New options (from config.py):

    updraft_threshold_stdev: float = 0.0  # if > 0, sample from truncated normal distribution
    updraft_threshold_realization_min: float = -2.5  # if `updraft_threshold_stdev` > 0, potentials are calculated for these discrete threshold values (in stdevs about the mean `updraft_threshold`)
    updraft_threshold_realization_max: float = 2.5  # if `updraft_threshold_stdev` > 0, potentials are calculated for these discrete thresold values (in stdevs about the mean `updraft_threshold`)
    updraft_threshold_realization_step: float = 0.5  # if `updraft_threshold_stdev` > 0, potentials are calculated for these discrete thresold values (in stdevs about the mean `updraft_threshold`)
    smooth_threshold_cutoff: bool = False  # set to True for legacy behavior

Notes:

  1. For backwards compatibility, set smooth_threshold_cutoff to True and updraft_threshold_stdev to 0.0
  2. Setting updraft_threshold_stdev > 0 triggers a different run mode in which different directional potential realizations are calculated for discrete threshold values (this dictates the added cost):
    • from: updraft_threshold - updraft_threshold_realization_min*updraft_threshold_stdev
    • to: updraft_threshold + updraft_threshold_realization_max*updraft_threshold_stdev
    • by steps of: updraft_threshold_realization_step*updraft_threshold_stdev
  3. Output data naming is based on the mean updraft_threshold, different potential fields are saved (*_r0, *_r1, ...) corresponding to the discrete updraft threshold values specified above
    • Note: The code does NOT HAVE ANY WAY TO CHECK whether the saved potential field realizations actually correspond to the specify updraft threshold realization parameters, so it is up to the user to clean up those data files if the relevant parameters change.
  4. generate_simulated_track will operate based on a random threshold value (normally distributed), an updraft field with that threshold applied (as a hard cutoff), and a directional potential realization that is interpolated from the existing realizations (instead of performing a new matrix solve for each track)
  5. if a random threshold value is outside the threshold realization bounds, it is set to the nearest extrema (updraft_threshold_realization_[min|max])

FYI @rthedin, @DaveBrandes I intend to merge this in after completing my latest validation effort