Пример #1
0
 //Constructors
 /// <summary>
 /// Creates an initialized instance
 /// </summary>
 /// <param name="externalFieldsCfg">External input fields settings</param>
 /// <param name="transformedFieldsCfg">Transformed input fields settings</param>
 /// <param name="generatedFieldsCfg">Generated input fields settings</param>
 /// <param name="routeToReadout">Specifies whether to route input fields to readout layer together with other predictors</param>
 public VaryingFieldsSettings(ExternalFieldsSettings externalFieldsCfg,
                              TransformedFieldsSettings transformedFieldsCfg = null,
                              GeneratedFieldsSettings generatedFieldsCfg     = null,
                              bool routeToReadout = DefaultRouteToReadout
                              )
 {
     ExternalFieldsCfg    = (ExternalFieldsSettings)externalFieldsCfg.DeepClone();
     TransformedFieldsCfg = transformedFieldsCfg == null ? null : (TransformedFieldsSettings)transformedFieldsCfg.DeepClone();
     GeneratedFieldsCfg   = generatedFieldsCfg == null ? null : (GeneratedFieldsSettings)generatedFieldsCfg.DeepClone();
     RouteToReadout       = routeToReadout;
     Check();
     return;
 }
Пример #2
0
        /// <summary>
        /// Creates an initialized instance.
        /// </summary>
        /// <param name="elem">Xml element containing the initialization settings.</param>
        public VaryingFieldsSettings(XElement elem)
        {
            //Validation
            XElement settingsElem = Validate(elem, XsdTypeName);

            //Parsing
            ExternalFieldsCfg = new ExternalFieldsSettings(settingsElem.Elements("externalFields").First());
            XElement transformedFieldsElem = settingsElem.Elements("transformedFields").FirstOrDefault();

            TransformedFieldsCfg = transformedFieldsElem == null ? null : new TransformedFieldsSettings(transformedFieldsElem);
            XElement generatedFieldsElem = settingsElem.Elements("generatedFields").FirstOrDefault();

            GeneratedFieldsCfg = generatedFieldsElem == null ? null : new GeneratedFieldsSettings(generatedFieldsElem);
            RouteToReadout     = bool.Parse(settingsElem.Attribute("routeToReadout").Value);
            Check();
            return;
        }
Пример #3
0
 /// <summary>
 /// The deep copy constructor
 /// </summary>
 /// <param name="source">The source instance.</param>
 public ExternalFieldsSettings(ExternalFieldsSettings source)
     : this()
 {
     AddFields(source.FieldCfgCollection);
     return;
 }