/// <summary>
        /// Initializes this instance.
        /// </summary>
        public override void Initialize()
        {
            Console.WriteLine("Type the equation:");
            Console.WriteLine("Samples:");
            Console.WriteLine("     3*x - 2*y + 4*z = 7");
            Console.WriteLine("     x * y - 3 * z + t = 8");
            Console.WriteLine("     a + b * c + d - f / g = 1000");
            Console.WriteLine("     a*x^2 + b * x + c = 100");
            Console.WriteLine("     a^3 - 4*b^2 + 3*c - 4 = 0");

            m_equation = Console.ReadLine();

            var equationParts = m_equation.Split('=');
            m_equationLeftPart = equationParts[0];
            m_equationRightPart = equationParts[1];

            var reader = new TokenReader();
            var tokens = reader.Read(m_equationLeftPart);
            m_variables = new List<string>();

            foreach (var token in tokens)
            {
                if (token.TokenType == TokenType.Text)
                {
                    var value = token.Value as string;

                    if (!m_variables.Contains(value))
                    {
                        m_variables.Add(value);
                    }
                }
            }

            var engine = new CalculationEngine();
            m_equationResult = (int)engine.Calculate(m_equationRightPart);
        }
        private int GetEquationResult(Gene[] genes)
        {
            var variableValues = new Dictionary<string, double>();

            for (int i = 0; i < m_variables.Count; i++)
            {
                variableValues.Add(m_variables[i], (int)genes[i].Value);
            }

            var engine = new CalculationEngine();
            var result = engine.Calculate(m_equationLeftPart, variableValues);

            return (int)result;
        }
        private void Calculate()
        {
            CalculationEngine engine = new CalculationEngine();

            Result = (decimal)engine.Calculate(Expression.Replace('÷', '/').Replace('×', '*'));
        }