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
            };
        }
Beispiel #2
0
 public void Test()
 {
     var p = new ProblemJson
     {
         filled = new List<CellJson> { new CellJson { x = 1, y = 2 } },
         height = 10,
         width = 12,
         id = 42,
         sourceLength = 22,
         sourceSeeds = new List<int> { 1, 2, 3 },
         units = new List<UnitJson>
         {
             new UnitJson
             {
                 members = new List<CellJson> {new CellJson {x = 10, y = 11}},
                 pivot = new CellJson {x = 10, y = 11}
             }
         }
     };
     var s = JsonConvert.SerializeObject(p, Formatting.Indented);
     Approvals.Verify(s);
 }