2020-02-21 11:45:32 +00:00
|
|
|
let guesstimatorString = "20 to 80";
|
2020-02-17 19:45:32 +00:00
|
|
|
|
2020-02-10 23:32:44 +00:00
|
|
|
module Model = {
|
2020-02-14 21:53:47 +00:00
|
|
|
let make = (currentDateTime: MomentRe.Moment.t) => {
|
2020-02-15 23:01:59 +00:00
|
|
|
let genericDistribution =
|
|
|
|
GenericDistribution.make(
|
2020-02-17 19:45:32 +00:00
|
|
|
~generationSource=GuesstimatorString(guesstimatorString),
|
2020-02-19 12:06:41 +00:00
|
|
|
~unit=TimeDistribution({zero: currentDateTime, unit: `years}),
|
2020-02-15 23:01:59 +00:00
|
|
|
(),
|
2020-02-14 21:53:47 +00:00
|
|
|
);
|
2020-02-15 23:01:59 +00:00
|
|
|
Prop.Value.GenericDistribution(genericDistribution);
|
2020-02-10 23:32:44 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
module Interface = {
|
|
|
|
let dayKey = "Day";
|
|
|
|
|
2020-02-17 16:53:30 +00:00
|
|
|
let run = (p: array(option(Prop.Value.t))) => {
|
|
|
|
switch (p) {
|
2020-02-14 21:53:47 +00:00
|
|
|
| [|Some(DateTime(currentYear))|] => Some(Model.make(currentYear))
|
2020-02-10 23:32:44 +00:00
|
|
|
| _ => None
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
let model: Prop.Model.t =
|
|
|
|
Prop.{
|
|
|
|
name: "Global Catastrophe",
|
2020-02-10 23:45:54 +00:00
|
|
|
description: "The chances of having at least one catastrophe per year in the future, assuming no other catastrophe until then.",
|
2020-02-10 23:32:44 +00:00
|
|
|
version: "1.0.0",
|
|
|
|
author: "Ozzie Gooen",
|
2020-02-19 10:07:50 +00:00
|
|
|
inputTypes: [|TypeWithMetadata.currentYear|],
|
2020-02-10 23:32:44 +00:00
|
|
|
outputTypes: [||],
|
|
|
|
run,
|
|
|
|
};
|
|
|
|
};
|