Esempio n. 1
0
        /// <summary>
        /// Creates an initialized instance.
        /// </summary>
        /// <param name="elem">A xml element containing the configuration data.</param>
        public FeedingPatternedSettings(XElement elem)
        {
            //Validation
            XElement settingsElem = Validate(elem, XsdTypeName);

            //Parsing
            Slices    = int.Parse(settingsElem.Attribute("slices").Value, CultureInfo.InvariantCulture);
            Bidir     = (NeuralPreprocessor.BidirProcessing)Enum.Parse(typeof(NeuralPreprocessor.BidirProcessing), settingsElem.Attribute("bidir").Value, true);
            VarSchema = (InputPattern.VariablesSchema)Enum.Parse(typeof(InputPattern.VariablesSchema), settingsElem.Attribute("variablesSchema").Value, true);
            XElement uniElem = settingsElem.Elements("unification").FirstOrDefault();

            if (uniElem != null)
            {
                UnificationCfg = new UnificationSettings(uniElem);
            }
            else
            {
                UnificationCfg = new UnificationSettings();
            }
            XElement steadyFieldsElem = settingsElem.Elements("steadyFields").FirstOrDefault();

            if (steadyFieldsElem != null)
            {
                SteadyFieldsCfg = new SteadyFieldsSettings(steadyFieldsElem);
            }
            else
            {
                SteadyFieldsCfg = null;
            }
            Check();
            return;
        }
Esempio n. 2
0
 //Constructors
 /// <summary>
 /// Creates an itialized instance.
 /// </summary>
 /// <param name="slices">Specifies how many times to collect predictors during the pattern preprocessing.</param>
 /// <param name="bidir">Specifies whether and how to preprocess pattern in both time directions.</param>
 /// <param name="varSchema">Specifies the variables organization schema in the pattern.</param>
 /// <param name="unificationCfg">The configuration of the pattern unification.</param>
 /// <param name="steadyFieldsCfg">The configuration of the steady external input fields.</param>
 public FeedingPatternedSettings(int slices = DefaultSlices,
                                 NeuralPreprocessor.BidirProcessing bidir = DefaultBidir,
                                 InputPattern.VariablesSchema varSchema   = DefaultVarSchema,
                                 UnificationSettings unificationCfg       = null,
                                 SteadyFieldsSettings steadyFieldsCfg     = null
                                 )
 {
     Slices          = slices;
     Bidir           = bidir;
     VarSchema       = varSchema;
     UnificationCfg  = unificationCfg == null ? new UnificationSettings() : (UnificationSettings)unificationCfg.DeepClone();
     SteadyFieldsCfg = steadyFieldsCfg == null ? null : (SteadyFieldsSettings)steadyFieldsCfg.DeepClone();
     Check();
     return;
 }
Esempio n. 3
0
 /// <summary>
 /// The deep copy constructor.
 /// </summary>
 /// <param name="source">The source instance.</param>
 public UnificationSettings(UnificationSettings source)
     : this(source.Detrend, source.UnifyAmplitude, source.ResamplingCfg)
 {
     return;
 }