TODO: unit tests for simil days
[talweg.git] / pkg / R / F_Zero.R
index 247ab04..2c9a7b7 100644 (file)
@@ -1,20 +1,17 @@
-#' @include Forecaster.R
+#' Zero Forecaster
 #'
-#' @title Zero Forecaster
+#' Flat prediction: always forecast a serie of zeros.
+#' This serie is then adjusted using the ".pjump" function (see \code{Forecaster} class).
 #'
-#' @description Return 0 (and then adjust). Inherits \code{\link{Forecaster}}
-ZeroForecaster = setRefClass(
-       Class = "ZeroForecaster",
-       contains = "Forecaster",
+#' @docType class
+#' @format R6 class, inherits Forecaster
+#' @aliases F_Zero
+#'
+ZeroForecaster = R6::R6Class("ZeroForecaster",
+       inherit = Forecaster,
 
-       methods = list(
-               initialize = function(...)
-               {
-                       callSuper(...)
-               },
-               predictShape = function(today, memory, horizon, ...)
-               {
-                       rep(0., horizon)
-               }
+       public = list(
+               predictShape = function(data, today, memory, horizon, ...)
+                       rep(0, horizon)
        )
 )