aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorGuillermo Ramos2025-02-06 00:40:51 +0100
committerGuillermo Ramos2025-02-07 00:09:06 +0100
commitca057d600ca54b3efebd6770dbe52acb38d9a25f (patch)
tree9033ed239112166d5033ae748c7617ab8d639570 /src/main.rs
parentf3a4bf7db8a4c6f5f6389361f920464e4b5e51ed (diff)
downloadhiccup-ca057d600ca54b3efebd6770dbe52acb38d9a25f.tar.gz
Another big refactor + perfect quota sim
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();
}