/// <summary>
 /// Transforms this result to a line that can be written to a file
 /// </summary>
 /// <returns>The result in a line</returns>
 public string GetResultLine()
 {
     return
         (SolutionTime.TotalSeconds.ToString(ExportationConstants.FORMATTER) + ExportationConstants.CSV_DELIMITER +
          ObjectiveValue.ToString(ExportationConstants.FORMATTER) + ExportationConstants.CSV_DELIMITER +
          BestBound.ToString(ExportationConstants.FORMATTER) + ExportationConstants.CSV_DELIMITER +
          Gap.ToString(ExportationConstants.FORMATTER));
 }
        //*************************************
        //*****ToString() overriden method*****
        //*************************************


        public override string ToString()
        {
            string tempString = "";             //string to be returned

            for (int i = 0; i < Template.DesignVariables.Count; i++)
            {
                tempString = tempString + genes[i].ToString("F6") + "\t";
            }
            for (int i = 0; i < Template.Constraints.Count; i++)
            {
                tempString = tempString + constraintViolationValues[i].ToString("F6") + "\t";
            }
            tempString = tempString + penalty.ToString("F6") + "\t" + ObjectiveValue.ToString("E1") + "\t" + FitnessValue.ToString("E1");
            return(tempString);
        }
        public IObjectiveValue Create(
            decimal value)
        {
            IObjectiveValue result = null;

            try
            {
                result = new ObjectiveValue(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(result);
        }
예제 #4
0
        public IObjectiveValue Create(
            decimal value)
        {
            IObjectiveValue result = null;

            try
            {
                result = new ObjectiveValue(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(result);
        }