Example #1
0
 /// <summary>
 /// Creates an instance of Trapezoid transfer function with the specified
 /// properties.
 /// </summary>
 /// <param name="properties"></param>
 public Trapezoid(Properties properties)
 {
     this.LeftLow = (Double)properties.GetProperty("transferFunction.leftLow");
     this.LeftHigh = (Double)properties.GetProperty("transferFunction.leftHigh");
     this.RightLow = (Double)properties.GetProperty("transferFunction.rightLow");
     this.RightHigh = (Double)properties.GetProperty("transferFunction.rightHigh");
 }
Example #2
0
 /// <summary>
 /// Creates an instance of Ramp transfer function with specified properties.
 /// </summary>
 /// <param name="properties"></param>
 public Ramp(Properties properties)
 {
     this.Slope = (Double)properties.GetProperty("transferFunction.slope");
     this.YHigh = (Double)properties.GetProperty("transferFunction.yHigh");
     this.YLow = (Double)properties.GetProperty("transferFunction.yLow");
     this.XHigh = (Double)properties.GetProperty("transferFunction.xHigh");
     this.XLow = (Double)properties.GetProperty("transferFunction.xLow");
 }
Example #3
0
        /// <summary>
        /// Creates and returns instance of transfer function 
        /// </summary>
        /// <param name="tfProperties">transfer function properties</param>
        /// <returns>returns transfer function</returns>
        private static TransferFunction CreateTransferFunction(Properties tfProperties)
        {
            TransferFunction transferFunction = null;

            Type tfClass = (Type)tfProperties.GetProperty("transferFunction");

            ParameterInfo[] paramTypes = null;

            ConstructorInfo[] cons = tfClass.GetConstructors();
            for (int i = 0; i < cons.Length; i++)
            {
                paramTypes = cons[i].GetParameters();

                // use constructor with one parameter of Properties type
                if ((paramTypes.Length == 1) && (paramTypes[0].GetType() == typeof(Properties)))
                {
                    Type[] argTypes = new Type[1];
                    argTypes[0] = typeof(Properties);
                    ConstructorInfo ct = tfClass.GetConstructor(argTypes);

                    Object[] argList = new Object[1];
                    argList[0] = tfProperties;
                    transferFunction = (TransferFunction)ct.Invoke(argList);
                    break;
                }
                else if (paramTypes.Length == 0)
                { // use constructor without params
                    transferFunction = (TransferFunction)Activator.CreateInstance(tfClass);
                    break;
                }
            }

            return transferFunction;
        }
Example #4
0
 /// <summary>
 /// Creates an instance of Tanh neuron transfer function with the
 /// specified properties. 
 /// </summary>
 /// <param name="properties">properties of the Tanh function</param>
 public Tanh(Properties properties)
 {
     this.Slope = (Double)properties.GetProperty("transferFunction.slope");
 }
Example #5
0
 /// <summary>
 /// Creates an instance of Step transfer function with specified properties
 /// </summary>
 /// <param name="properties"></param>
 public Step(Properties properties)
 {
     this.YHigh = (Double)properties.GetProperty("transferFunction.yHigh");
     this.YLow = (Double)properties.GetProperty("transferFunction.yLow");
 }
Example #6
0
 /// <summary>
 /// Creates an instance of Gaussian neuron transfer function with the
 /// specified properties. 
 /// </summary>
 /// <param name="properties">properties of the Gaussian function</param>
 public Gaussian(Properties properties)
 {
     this.Sigma = (Double)properties.GetProperty("transferFunction.sigma");
 }