mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Merge branch 'ent-8371-recorte-de-predicciones' into 'develop'
Clip predictions if the module has max. and min. values. See merge request artica/pandorafms!4581
This commit is contained in:
commit
873f56f551
@ -286,6 +286,16 @@ sub exec_capacity_planning_module($$$$) {
|
|||||||
if ($type eq 'estimation_absolute') {
|
if ($type eq 'estimation_absolute') {
|
||||||
# y = theta_0 + x * theta_1
|
# y = theta_0 + x * theta_1
|
||||||
$pred = $theta_0 + ($now + $target_value) * $theta_1;
|
$pred = $theta_0 + ($now + $target_value) * $theta_1;
|
||||||
|
|
||||||
|
# Clip predictions.
|
||||||
|
if ($target_module->{'max'} != $target_module->{'min'}) {
|
||||||
|
if ($pred < $target_module->{'min'}) {
|
||||||
|
$pred = $target_module->{'min'};
|
||||||
|
}
|
||||||
|
elsif ($pred > $target_module->{'max'}) {
|
||||||
|
$pred = $target_module->{'max'};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# Predict the date.
|
# Predict the date.
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user