Esempio n. 1
0
 public AdaptiveSolver(Phrases phrases)
 {
     this.phrases = phrases;
     finder = new MagicDfsFinder(phrases);
     fastest = BuildSolver(new MephalaOracle(new MagicDfsFinder(phrases, 2), WeightedMetric.Keening));
     fast = BuildSolver(new MephalaOracle(finder, WeightedMetric.Keening));
     fast2 = BuildSolver(new MephalaOracle(finder, WeightedMetric.Sunder));
     slowest = BuildSolver(new HircineOracle(finder, WeightedMetric.Debug, 4, 5));
     slow = BuildSolver(new HircineOracle(finder, WeightedMetric.Debug, 3, 5));
 }
Esempio n. 2
0
        private static SubmitionJson Solve(ProblemJson p, int seed)
        {
            var phrases = new Phrases(Phrases.DefaultPowerWords);

            var map = p.ToMap(seed);
            var finder = new MagicDfsFinder(phrases);
            var bestRes = new Solver(phrases, finder, new MephalaOracle(finder, WeightedMetric.Keening)).Solve(map);
            //            var s2 = new Solver(finder, new AzuraOracle()).Solve(map);
            //            var bestRes = new[] { s1, s2 }.OrderByDescending(s => s.Score).First();
            return new SubmitionJson
            {
                problemId = p.id,
                seed = seed,
                solution = phrases.ToOriginalPhrase(bestRes.Commands),
                tag = bestRes.Name + "-" + DateTime.Now
            };
        }
Esempio n. 3
0
 static double Run(Map map, List<WeightedMetric> metric)
 {
     var phrases = new Phrases(Phrases.DefaultPowerWords);
     var finder = new MagicDfsFinder(phrases);
     var mephala = new MephalaOracle(finder, metric);
     var solver = new Solver(phrases, finder, mephala);
     // Console.Write("Solving ");
     //Console.WriteLine(argument.Code.Select(z => Math.Round(z, 3).ToString()).Aggregate((a, b) => a + " " + b));
     var result = solver.Solve(map);
     //Console.WriteLine("Result" + result.Score + "\n\n");
     return result.Score;
 }