Decoupled Predictor from i18next.

master
CatStarwind 5 years ago
parent 114f4f769b
commit f1a6680fcd

@ -657,7 +657,6 @@ class Predictor {
}
yield {
pattern_description: i18next.t("patterns.fluctuating"),
pattern_number: 0,
prices: predicted_prices,
probability,
@ -736,7 +735,6 @@ class Predictor {
}
}
yield {
pattern_description: i18next.t("patterns.large-spike"),
pattern_number: 1,
prices: predicted_prices,
probability,
@ -783,7 +781,6 @@ class Predictor {
}
yield {
pattern_description: i18next.t("patterns.decreasing"),
pattern_number: 2,
prices: predicted_prices,
probability,
@ -864,7 +861,6 @@ class Predictor {
}
yield {
pattern_description: i18next.t("patterns.small-spike"),
pattern_number: 3,
prices: predicted_prices,
probability,
@ -992,7 +988,6 @@ class Predictor {
}
generated_possibilities.unshift({
pattern_description: i18next.t("patterns.all"),
pattern_number: 4,
prices: global_min_max,
weekGuaranteedMinimum: Math.min(...generated_possibilities.map(poss => poss.weekGuaranteedMinimum)),

@ -279,13 +279,14 @@ const calculateOutput = function (data, first_buy, previous_pattern) {
$("#output").html("");
return;
}
let pat_desc = {0:"fluctuating", 1:"large-spike", 2:"decreasing", 3:"small-spike", 4:"all"};
let output_possibilities = "";
let predictor = new Predictor(data, first_buy, previous_pattern);
let analyzed_possibilities = predictor.analyze_possibilities();
let buy_price = parseInt(buy_input.val());
previous_pattern_number = "";
for (let poss of analyzed_possibilities) {
var out_line = "<tr><td class='table-pattern'>" + poss.pattern_description + "</td>";
var out_line = "<tr><td class='table-pattern'>" + i18next.t("patterns." + pat_desc[poss.pattern_number]) + "</td>";
const style_price = buy_price || poss.prices[0].min;
if (previous_pattern_number != poss.pattern_number) {
previous_pattern_number = poss.pattern_number;

Loading…
Cancel
Save