Esempio n. 1
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="cfg">The configuration of the predictor.</param>
 public PredictorFiringTrace(PredictorFiringTraceSettings cfg)
 {
     Cfg = cfg;
     if (cfg.Window == PredictorFiringTraceSettings.NAWindowNum)
     {
         Reset();
     }
     return;
 }
Esempio n. 2
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="cfg">The configuration of the predictor.</param>
 public PredictorActivationLinWAvg(PredictorActivationLinWAvgSettings cfg)
 {
     Cfg = cfg;
     if (cfg.Window == PredictorActivationLinWAvgSettings.NAWindowNum)
     {
         _continuousAvg = new WeightedAvg();
         Reset();
     }
     else
     {
         _continuousAvg = null;
     }
     return;
 }
Esempio n. 3
0
        /// <summary>
        /// Creates an instance of the predictor computer.
        /// </summary>
        /// <param name="cfg">The configuration of the predictor.</param>
        public static IPredictor CreatePredictor(IPredictorSettings cfg)
        {
            Type pType = cfg.GetType();

            if (pType == typeof(PredictorActivationSettings))
            {
                return(new PredictorActivation((PredictorActivationSettings)cfg));
            }
            else if (pType == typeof(PredictorActivationPowerSettings))
            {
                return(new PredictorActivationPower((PredictorActivationPowerSettings)cfg));
            }
            else if (pType == typeof(PredictorActivationStatFigureSettings))
            {
                return(new PredictorActivationStatFigure((PredictorActivationStatFigureSettings)cfg));
            }
            else if (pType == typeof(PredictorActivationRescaledRangeSettings))
            {
                return(new PredictorActivationRescaledRange((PredictorActivationRescaledRangeSettings)cfg));
            }
            else if (pType == typeof(PredictorActivationLinWAvgSettings))
            {
                return(new PredictorActivationLinWAvg((PredictorActivationLinWAvgSettings)cfg));
            }
            else if (pType == typeof(PredictorActivationDiffStatFigureSettings))
            {
                return(new PredictorActivationDiffStatFigure((PredictorActivationDiffStatFigureSettings)cfg));
            }
            else if (pType == typeof(PredictorActivationDiffRescaledRangeSettings))
            {
                return(new PredictorActivationDiffRescaledRange((PredictorActivationDiffRescaledRangeSettings)cfg));
            }
            else if (pType == typeof(PredictorActivationDiffLinWAvgSettings))
            {
                return(new PredictorActivationDiffLinWAvg((PredictorActivationDiffLinWAvgSettings)cfg));
            }
            else if (pType == typeof(PredictorFiringTraceSettings))
            {
                return(new PredictorFiringTrace((PredictorFiringTraceSettings)cfg));
            }
            else
            {
                throw new ArgumentException($"Unsupported type of predictor settings class {pType.Name}.", "cfg");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Creates an initialized instance.
        /// </summary>
        /// <param name="elem">A xml element containing the configuration data.</param>
        public PredictorsProviderSettings(XElement elem)
        {
            //Validation
            XElement settingsElem = Validate(elem, XsdTypeName);

            //Allocation
            PredictorCfgCollection = new List <IPredictorSettings>();
            //Parsing
            foreach (XElement predictorElem in settingsElem.Elements())
            {
                IPredictorSettings predictorCfg = PredictorFactory.LoadPredictorSettings(predictorElem);
                if (predictorCfg != null)
                {
                    PredictorCfgCollection.Add(predictorCfg);
                }
            }
            Check();
            return;
        }
Esempio n. 5
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="cfg">The configuration of the predictor.</param>
 public PredictorActivationPower(PredictorActivationPowerSettings cfg)
 {
     Cfg = cfg;
     return;
 }
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="cfg">The configuration of the predictor.</param>
 public PredictorActivationDiffStatFigure(PredictorActivationDiffStatFigureSettings cfg)
 {
     Cfg = cfg;
     return;
 }
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="cfg">The configuration of the predictor.</param>
 public PredictorActivationDiffRescaledRange(PredictorActivationDiffRescaledRangeSettings cfg)
 {
     Cfg = cfg;
     return;
 }
Esempio n. 8
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="cfg">The configuration of the predictor.</param>
 public PredictorActivation(PredictorActivationSettings cfg)
 {
     Cfg = cfg;
     return;
 }