Esempio n. 1
0
        //Methods
        /// <summary>
        /// See the base.
        /// </summary>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            BaseFeatureFilterSettings cmpSettings = obj as BaseFeatureFilterSettings;

            if (Type != cmpSettings.Type)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates deep copy of given settings
        /// </summary>
        /// <param name="settings">Settings of feature filter</param>
        public static BaseFeatureFilterSettings DeepClone(BaseFeatureFilterSettings settings)
        {
            switch (settings.Type)
            {
            case BaseFeatureFilter.FeatureType.Binary:
                return(new BinFeatureFilterSettings((BinFeatureFilterSettings)settings));

            case BaseFeatureFilter.FeatureType.Enum:
                return(new EnumFeatureFilterSettings((EnumFeatureFilterSettings)settings));

            case BaseFeatureFilter.FeatureType.Real:
                return(new RealFeatureFilterSettings((RealFeatureFilterSettings)settings));

            default:
                throw new ArgumentException($"Unexpected feature type {settings.Type}", "settings");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Instantiates feature filter of proper type according to settings
        /// </summary>
        /// <param name="outputRange">Output range of feature filter</param>
        /// <param name="settings">Settings of feature filter</param>
        public static BaseFeatureFilter Create(Interval outputRange, BaseFeatureFilterSettings settings)
        {
            switch (settings.Type)
            {
            case BaseFeatureFilter.FeatureType.Binary:
                return(new BinFeatureFilter(outputRange, (BinFeatureFilterSettings)settings));

            case BaseFeatureFilter.FeatureType.Enum:
                return(new EnumFeatureFilter(outputRange, (EnumFeatureFilterSettings)settings));

            case BaseFeatureFilter.FeatureType.Real:
                return(new RealFeatureFilter(outputRange, (RealFeatureFilterSettings)settings));

            default:
                throw new ArgumentException($"Unexpected feature type {settings.Type}", "settings");
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public BaseFeatureFilterSettings(BaseFeatureFilterSettings source)
 {
     Type = source.Type;
     return;
 }