action_time | R Documentation |
Add timekeeping to a g3 model
g3a_time(
start_year,
end_year,
step_lengths = c(12),
final_year_steps = quote( length(step_lengths) ),
project_years = g3_parameterized("project_years", value = 0, optimise = FALSE),
retro_years = g3_parameterized("retro_years", value = 0, optimise = FALSE),
run_at = g3_action_order$initial,
run_stop_at = g3_action_order$time)
start_year |
Year model run will start. |
end_year |
After this year, model run will stop. |
step_lengths |
Either an MFDB time grouping, e.g. |
final_year_steps |
Number of steps of final year to include. Either as an integer or quoted code, in which case it will be calcuated when the model runs. For example:
|
project_years |
Number of years to continue running after the "end" of the model. Must be Defaults to an unoptimized |
retro_years |
Adjust end_year to finish model early. Must be The true end year of the model will be Defaults to an unoptimized |
run_at , run_stop_at |
Integer order that actions will be run within model, see |
The actions will define the following variables in your model:
Current iteration of model, starts at 0 and increments until finished
Current step within individual year
Proportion of year this step contains, e.g. quarterly = 3/12
Current year
TRUE iff this is the final step of the year
TRUE iff we are currently projecting past end_year
Total # of iterations (including projection) before model stops
Total # of years (including projection) before model stops
An action (i.e. list of formula objects) that will...
Define cur_* variables listed above
If we've reached the end of the model, return nll
# Run model 2000..2004, in quarterly steps
time_action <- g3a_time(
start_year = 2000,
end_year = 2004,
c(3, 3, 3, 3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.