aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: f785bb04d8c7ce496f49c1a8d108753131961d09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use hiccup::MortgageUpdate::*;
use hiccup::{MortgageUpdates, Simulation};
use std::collections::HashMap;

fn main() {
    let mut sim = Simulation::new(390_000., 0.028, 30);
    let updates: MortgageUpdates = HashMap::from_iter((0..29).map(|y| match y {
        0 => (0, Amortize(30_000.)),
        _ => (y * 12, Amortize(12_000.)),
    }));

    // let mut sim = Simulation::new(200_000., 0.01621, 30);
    // let updates: MortgageUpdates = HashMap::new();

    sim.run(updates);
    sim.render_table();
}