/// <inheritdoc/>
        public double Compute(BasicStat continuousActivationStat,
                              BasicStat continuousActivationDiffStat,
                              MovingDataWindow activationMDW,
                              SimpleQueue <byte> firingMDW,
                              double activation,
                              double normalizedActivation,
                              bool spike
                              )
        {
            PredictorActivationDiffStatFigureSettings cfg = (PredictorActivationDiffStatFigureSettings)Cfg;

            if (cfg.Window == PredictorActivationDiffStatFigureSettings.NAWindowNum)
            {
                return(continuousActivationDiffStat.Get(cfg.Figure));
            }
            else
            {
                if (activationMDW.UsedCapacity >= cfg.Window)
                {
                    return(activationMDW.GetDataDiffStat(cfg.Window).Get(cfg.Figure));
                }
                else
                {
                    return(0d);
                }
            }
        }
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="cfg">The configuration of the predictor.</param>
 public PredictorActivationDiffStatFigure(PredictorActivationDiffStatFigureSettings cfg)
 {
     Cfg = cfg;
     return;
 }
Example #3
0
 /// <summary>
 /// The copy constructor.
 /// </summary>
 /// <param name="source">The source instance.</param>
 public PredictorActivationDiffStatFigureSettings(PredictorActivationDiffStatFigureSettings source)
     : this(source.Figure, source.Window)
 {
     return;
 }