コード例 #1
0
        public override Variable[] CreateVariables()
        {
            Variable[] variables = new Variable[Problem.NumberOfVariables];

            for (int i = 0, li = Problem.NumberOfVariables; i < li; i++)
            {
                variables[i] = new RealVariable(Problem.LowerLimit[i], Problem.UpperLimit[i]);
            }

            return(variables);
        }
コード例 #2
0
        /// <summary>
        /// Returns a exact copy of the <code>Real</code> encodings.variable
        /// </summary>
        /// <returns>the copy</returns>
        public override Variable DeepCopy()
        {
            Variable result;

            try
            {
                result = new RealVariable(this);
            }
            catch (Exception ex)
            {
                Logger.Log.Error(this.GetType().FullName + ".DeepCopy()", ex);
                Console.WriteLine("Error in " + this.GetType().FullName + ".DeepCopy()");
                result = null;
            }

            return(result);
        }