Add inflation to epoch phases (#6787)

This commit is contained in:
Jack May
2019-11-07 10:53:04 -08:00
committed by GitHub
parent 180bc1784e
commit a9c4cd6cbe
5 changed files with 127 additions and 25 deletions

View File

@ -42,6 +42,16 @@ impl Default for Inflation {
}
impl Inflation {
pub fn new_disabled() -> Self {
Self {
initial: 0.0,
terminal: 0.0,
taper: 0.0,
foundation: 0.0,
foundation_term: 0.0,
storage: 0.0,
}
}
/// inflation rate at year
pub fn total(&self, year: f64) -> f64 {
let tapered = self.initial * ((1.0 - self.taper).powf(year));