Exemple #1
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            InceratorConfiguration options = new InceratorConfiguration();

            if (Parser.Default.ParseArguments(args, options))
            {
                var incerator = new Incerator(options, new ModelRepository());
#if DEBUG
                incerator.Run();
#else
                try
                {
                    incerator.Run();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
#endif
            }
            else
            {
                Console.WriteLine("You are using me wrongly!");
                Console.WriteLine("Usage: Incerator optimize [options]");
                Console.WriteLine(options.GetHelp());
            }
        }
Exemple #2
0
        private void LoadNotifySystem(InceratorConfiguration options)
        {
            var configModel   = repository.Resolve(options.Configuration);
            var configuration = configModel.RootElements[0] as Configuration;

            NotifySystem.DefaultSystem = new ConfiguredNotifySystem(repository, configuration);
        }
Exemple #3
0
        private void RunAnalysis(InceratorConfiguration options)
        {
            var sysOut = Console.Out;

            Console.SetOut(TextWriter.Null);

            var type = Type.GetType(options.Type);

            if (type == null)
            {
                throw new InvalidOperationException("The specified analysis type does not exist.");
            }
            if (!typeof(Analysis).IsAssignableFrom(type))
            {
                throw new InvalidOperationException("The specified analysis type is not an analysis.");
            }

            var analysis = (Analysis)Activator.CreateInstance(type);

            analysis.Run(repository);

            Console.SetOut(sysOut);
        }
Exemple #4
0
 public Benchmark(InceratorConfiguration options, ModelRepository repository)
 {
     Options    = options;
     Repository = repository;
 }
Exemple #5
0
        private static IList <MeasuredConfiguration <Configuration> > PerformGeneticAlgorithm(Configuration baseConfiguration, IBenchmark <Configuration> benchmark, InceratorConfiguration configuration)
        {
            var geneticSearch = new GeneticOptimization(benchmark, baseConfiguration);

            return(geneticSearch.Optimize(configuration.Generations, configuration.PopulationSize).ToList());
        }
Exemple #6
0
 public Incerator(InceratorConfiguration options, ModelRepository repository)
 {
     this.options    = options;
     this.repository = repository;
 }