コード例 #1
0
        public static object CreateSceOptimizer(object evaluator, ICloneableSystemConfiguration template, Type sysConfigType = null, object terminationCondition = null, SceParameters sceParams = null)
        {
            var helper = getHelper();
            var t      = sysConfigType ?? template.GetType();

            if (terminationCondition == null)
            {
                terminationCondition = CreateMaxWalltime(t);
            }
            return(invokeGenericMethod("internalCreateSceOptimizer", t, new object[] { evaluator, template, terminationCondition, sceParams }));
        }
コード例 #2
0
        public void Execute(string modelRunDefnFile, string modelOutputName, string runoffToMatchFile)
        {
            setRandSeed( );
            var evaluator        = ProblemDefinitionHelper.BuildEvaluator(modelRunDefnFile, modelOutputName, runoffToMatchFile);
            var candidateFactory = buildCandidateFactory(ProblemDefinitionHelper.BuildSystem(modelRunDefnFile, "runoff").Model);

            var scores = new IObjectiveScores[1000];
            var pSets  = new ICloneableSystemConfiguration[1000];

            for (int i = 0; i < scores.Length; i++)
            {
                pSets[i]  = candidateFactory.CreateRandomCandidate( );
                scores[i] = evaluator.EvaluateScore(pSets[i]);
            }
            IObjectiveScores[] paretoScores = ParetoRanking <IObjectiveScores> .GetParetoFront(scores);

            printSummary(scores);
            Console.ReadLine( );
        }