public HarmonySearchAverageTestResult(HarmonySearchType harmonySearchType, HarmonyGeneratorType harmonyGeneratorType, ObjectiveFunctionType objectiveFunctionType, IEnumerable <HarmonySearchTestResult> testResults) : base(testResults)
        {
            HarmonySearchType     = harmonySearchType;
            ObjectiveFunctionType = objectiveFunctionType;
            HarmonyGeneratorType  = harmonyGeneratorType;

            ImprovisationCount = (int)testResults.Average(r => r.ImprovisationCount);
        }
Exemplo n.º 2
0
        public HarmonySearchTestScenario(HarmonyGeneratorType generatorType)
        {
            var harmonyGeneratorTypes = new List <HarmonyGeneratorType> {
                generatorType
            };

            Settings = CreateSettings(harmonyGeneratorTypes, null, null);
        }
Exemplo n.º 3
0
        public HarmonySearchTestScenario(ObjectiveFunctionType functionType, HarmonyGeneratorType generatorType)
        {
            var harmonyGeneratorTypes = new List <HarmonyGeneratorType> {
                generatorType
            };
            var objectiveFunctionTypes = new List <ObjectiveFunctionType> {
                functionType
            };

            Settings = CreateSettings(harmonyGeneratorTypes, null, objectiveFunctionTypes);
        }
        /// <summary>
        /// Gets the Harmony generator instance.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="function">The function.</param>
        /// <param name="graph">The graph.</param>
        /// <param name="source">The source.</param>
        /// <param name="destination">The destination.</param>
        /// <returns></returns>
        public static IHarmonyGenerator <StopTimeInfo> GetInstance(HarmonyGeneratorType type, IObjectiveFunction <StopTimeInfo> function, Graph <int, StopTimeInfo> graph, Location source, Location destination)
        {
            switch (type)
            {
            case HarmonyGeneratorType.RandomStopTime:
                return(new RandomStopTimeHarmonyGenerator(function, graph, source, destination));

            case HarmonyGeneratorType.RandomStop:
                return(new RandomStopHarmonyGenerator(function, graph, source, destination));

            case HarmonyGeneratorType.RandomDirectedStop:
                return(new DirectedStopTimeHarmonyGenerator(function, graph, source, destination));

            default:
                return(new DirectedStopTimeHarmonyGenerator(function, graph, source, destination));
            }
        }