aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs
index 66ce418..f785bb0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,25 +1,17 @@
-use hiccup::Mortgage;
use hiccup::MortgageUpdate::*;
-use hiccup::MortgageUpdates;
+use hiccup::{MortgageUpdates, Simulation};
use std::collections::HashMap;
-fn h1() {
- let m = Mortgage::new(390_000., 0.028, 30);
-
+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 sim = m.clone().simulate(updates);
- sim.render_table();
-}
-fn h2() {
- let m = Mortgage::new(200_000., 0.01621, 30);
- let sim = m.clone().simulate(HashMap::new());
- sim.render_table();
-}
+ // let mut sim = Simulation::new(200_000., 0.01621, 30);
+ // let updates: MortgageUpdates = HashMap::new();
-fn main() {
- h1();
+ sim.run(updates);
+ sim.render_table();
}