示例#1
0
        public IEnumerable <RaceSolution> GetSolutions(RaceState problem, Countdown countdown)
        {
            var ch           = new SimpleConsistentFlagChooser();
            var pairOfFlags  = ch.GetNextFlagsFor(problem);
            var firstCarRes  = ChooseMoveForCar(true, problem, pairOfFlags.FirstCarNextFlag, ch);
            var secondCarRes = ChooseMoveForCar(false, problem, pairOfFlags.SecondCarNextFlag, ch);

            yield return(new RaceSolution(new[]
        public IEnumerable <RaceSolution> GetSolutions(RaceState problem, Countdown countdown)
        {
            var fChooser = new SimpleConsistentFlagChooser();

            var(f1, f2) = fChooser.GetNextFlagsFor(problem);
            var firstDelta  = f1 - problem.FirstCar.Pos;
            var secondDelta = f2 - problem.SecondCar.Pos;

            yield return(new RaceSolution(new (
                                              ICarCommand firstCarAcceleration,
                                              ICarCommand secondCarAcceleration)[]