Esempio n. 1
0
        /// <summary>
        /// Entry point to the program.
        /// </summary>
        /// <param name="args">If 'master' is included as argument, a
        /// <see cref="Master{TTargetAlgorithm,TInstance,TResult}"/> is starting using the remaining arguments.
        /// Otherwise, a <see cref="Worker"/> is started with the provided arguments.</param>
        public static void Main(string[] args)
        {
            ProcessUtils.SetDefaultCultureInfo(CultureInfo.InvariantCulture);
            LoggingHelper.Configure($"parserLog_{ProcessUtils.GetCurrentProcessId()}.log");

            // Parse arguments.
            var argsParser = new BbobRunnerConfigurationParser();

            if (!ArgumentParserUtils.ParseArguments(argsParser, args))
            {
                return;
            }

            var bbobConfig = argsParser.ConfigurationBuilder.Build();

            if (argsParser.IsMaster)
            {
                switch (bbobConfig.GenericParameterization)
                {
                case GenericParameterization.RandomForestAverageRank:
                    GenericBbobEntryPoint <
                        GenomePredictionRandomForest <AverageRankStrategy>,
                        GenomePredictionForestModel <GenomePredictionTree>,
                        AverageRankStrategy> .Run(argsParser.AdditionalArguments, bbobConfig);

                    break;

                case GenericParameterization.RandomForestReuseOldTrees:
                    GenericBbobEntryPoint <
                        GenomePredictionRandomForest <ReuseOldTreesStrategy>,
                        GenomePredictionForestModel <GenomePredictionTree>,
                        ReuseOldTreesStrategy> .Run(argsParser.AdditionalArguments, bbobConfig);

                    break;

                case GenericParameterization.StandardRandomForest:
                case GenericParameterization.Default:
                default:
                    GenericBbobEntryPoint <
                        StandardRandomForestLearner <ReuseOldTreesStrategy>,
                        GenomePredictionForestModel <GenomePredictionTree>,
                        ReuseOldTreesStrategy> .Run(argsParser.AdditionalArguments, bbobConfig);

                    break;
                }
            }

            else
            {
                Worker.Run(args);
                return;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Entry point to the program.
        /// </summary>
        /// <param name="args">If 'master' is included as argument, a
        /// <see cref="Master{TTargetAlgorithm,TInstance,TResult}"/> is starting using the remaining arguments.
        /// Otherwise, a <see cref="Worker"/> is started with the provided arguments.</param>
        public static void Main(string[] args)
        {
            LoggingHelper.Configure("bbobParserLog.txt");

            var configParser = new BbobRunnerConfigurationParser();

            if (!ArgumentParserUtils.ParseArguments(configParser, args))
            {
                return;
            }

            var bbobConfig = configParser.ConfigurationBuilder.Build();

            if (bbobConfig.IsMaster)
            {
                switch (bbobConfig.GenericParameterization)
                {
                case GenericParameterization.RandomForestAverageRank:
                    GenericBbobEntryPoint <
                        GenomePredictionRandomForest <AverageRankStrategy>,
                        GenomePredictionForestModel <GenomePredictionTree>,
                        AverageRankStrategy> .Run(configParser.AdditionalArguments, bbobConfig);

                    break;

                case GenericParameterization.RandomForestReuseOldTrees:
                    GenericBbobEntryPoint <
                        GenomePredictionRandomForest <ReuseOldTreesStrategy>,
                        GenomePredictionForestModel <GenomePredictionTree>,
                        ReuseOldTreesStrategy> .Run(configParser.AdditionalArguments, bbobConfig);

                    break;

                case GenericParameterization.StandardRandomForest:
                case GenericParameterization.Default:
                default:
                    GenericBbobEntryPoint <
                        StandardRandomForestLearner <ReuseOldTreesStrategy>,
                        GenomePredictionForestModel <GenomePredictionTree>,
                        ReuseOldTreesStrategy> .Run(configParser.AdditionalArguments, bbobConfig);

                    break;
                }
            }

            else
            {
                Worker.Run(args);
                return;
            }
        }