/// <summary>
        /// Initializes this instance.
        /// </summary>
        public override void Initialize()
        {
            Console.WriteLine("Function arguments and expected result: arg1,arg2=expected result.");
            Console.WriteLine("Sample1: 1,2,3=6");
            Console.WriteLine("Sample2: 2,3,4=24");
            Console.WriteLine("When finish, type ENTER to start the GA.");

            m_inputs = new List<FunctionBuilderInput>();
            do
            {
                var parts = Console.ReadLine().Split('=');

                if (parts.Length != 2)
                {
                    Console.WriteLine("Max number of operations?");
                    m_maxOperations = Convert.ToInt32(Console.ReadLine());

                    break;
                }

                var arguments = parts[0].Split(',');

                var input = new FunctionBuilderInput(
                    arguments.Select(a => Convert.ToDouble(a)).ToList(),
                    Convert.ToDouble(parts[1]));

                m_inputs.Add(input);
            }
            while (true);

            m_fitness = new FunctionBuilderFitness(m_inputs.ToArray());
        }
        /// <summary>
        /// Gets the function result.
        /// </summary>
        /// <returns>The function result.</returns>
        /// <param name="function">The function.</param>
        /// <param name="input">The arguments values and expected results of the function.</param>
        public double GetFunctionResult(string function, FunctionBuilderInput input)
        {
            var expression = new NCalc.Expression(function);

            for (int i = 0; i < m_parameterNames.Length; i++)
            {
                expression.Parameters.Add(m_parameterNames[i], input.Arguments[i]);
            }

            var result = expression.Evaluate();

            return (double)result;
        }
        /// <summary>
        /// Gets the function result.
        /// </summary>
        /// <returns>The function result.</returns>
        /// <param name="function">The function.</param>
        /// <param name="input">The arguments values and expected results of the function.</param>
        public double GetFunctionResult(string function, FunctionBuilderInput input)
        {
            var expression = new NCalc.Expression(function);

            for (int i = 0; i < m_parameterNames.Length; i++)
            {
                expression.Parameters.Add(m_parameterNames[i], input.Arguments[i]);
            }

            var result = expression.Evaluate();

            return((double)result);
        }