예제 #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            VzwCostOptimization costOpt = new VzwCostOptimization();

            if (File.Exists(Directory.GetCurrentDirectory() + "\\plan.xml"))
            {
                costOpt.LoadPlanInformation(Directory.GetCurrentDirectory() + "\\plan.xml");
            }
            else
            {
                costOpt.CreateTable();
            }

            costOpt.ReadFile(Settings.Default.FilePath);
            var optimalPlan = costOpt.SearchPlans(Settings.Default.FilePath);

            try
            {
                costOpt.UpdateFile(Settings.Default.FilePath, optimalPlan);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.WriteLine("Done...");
            Console.ReadKey();
        }
예제 #2
0
 public DNA(int geneSize, string path)
 {
     FilePath = path;
     costCalc = new VzwCostOptimization();
     rand     = new Random(DateTime.Now.Millisecond);
     Genes    = new List <double>();
     for (var i = 0; i < geneSize; i++)
     {
         Genes.Add(1 + rand.NextDouble());
     }
     costCalc.LoadPlanInformation(Directory.GetCurrentDirectory() + "\\plan.xml");
 }