Exemple #1
0
        public static WeeklyActionPlanGenerationMethods ToWeeklyActionPlanGenerationMethod(this String val)
        {
            WeeklyActionPlanGenerationMethods retVal = WeeklyActionPlanGenerationMethods.None;

            switch (val)
            {
            case "Brute Force":
                retVal = WeeklyActionPlanGenerationMethods.BruteForce;
                break;

            case "Random Search":
                retVal = WeeklyActionPlanGenerationMethods.RandomSearch;
                break;

            case "Genetic Optimization":
                retVal = WeeklyActionPlanGenerationMethods.GeneticOptimization;
                break;
            }

            return(retVal);
        }
        private WeeklyIncomeActionPlan BuildRandomSolution(List <PairCondor> pairCondorCandidates, WeeklyActionPlanGenerationMethods generationMethod, int slots)
        {
            WeeklyIncomeActionPlan actionPlan = new WeeklyIncomeActionPlan();

            actionPlan.GenerationMethod = generationMethod;

            while (actionPlan.Pairs.Count < slots)
            {
                int idx = random.Next(pairCondorCandidates.Count);
                actionPlan.AddPairCondor(pairCondorCandidates[idx]);
            }

            return(actionPlan);
        }