squiggle/src/models/GlobalCatastrophe.re
2020-02-23 12:49:33 +00:00

35 lines
928 B
ReasonML

let guesstimatorString = "20 to 80";
module Model = {
let make = (currentDateTime: MomentRe.Moment.t) => {
let distPlusIngredients =
DistPlusIngredients.make(
~guesstimatorString,
~unit=TimeDistribution({zero: currentDateTime, unit: `years}),
(),
);
Prop.Value.DistPlusIngredients(distPlusIngredients);
};
};
module Interface = {
let dayKey = "Day";
let run = (p: array(option(Prop.Value.t))) => {
switch (p) {
| [|Some(DateTime(currentYear))|] => Some(Model.make(currentYear))
| _ => None
};
};
let model: Prop.Model.t =
Prop.{
name: "Global Catastrophe",
description: "The chances of having at least one catastrophe per year in the future, assuming no other catastrophe until then.",
version: "1.0.0",
author: "Ozzie Gooen",
inputTypes: [|TypeWithMetadata.currentYear|],
outputTypes: [||],
run,
};
};