Exemplo n.º 1
0
        protected Block1Node Create(Field field, BlockPath path, ApplyParameters pars)
        {
            var score = pars.Evaluator.GetScore(field, Depth, pars.Parameters);

            pars.Evaluations++;
            return(new Block1Node(field, path, score, pars.Next.BranchingFactor1));
        }
Exemplo n.º 2
0
 public PlyLog(int round, BlockPath move, int score, byte depth, TimeSpan elapsed, int evaluations)
 {
     Ply         = round;
     Move        = move;
     Score       = score;
     Depth       = depth;
     Elapsed     = elapsed;
     Evaluations = evaluations;
 }
Exemplo n.º 3
0
		public PlyLog(int round, BlockPath move, int score, byte depth, TimeSpan elapsed, int evaluations)
		{
			Ply = round;
			Move = move;
			Score = score;
			Depth = depth;
			Elapsed = elapsed;
			Evaluations = evaluations;
		}
        internal static BlockPath Create(Block block, Position source, Position target)
        {
            var actions = new List <ActionType>();

            switch (block.Rotation)
            {
            case Block.RotationType.Left: actions.Add(ActionType.TurnLeft); break;

            case Block.RotationType.Uturn: actions.Add(ActionType.TurnLeft); actions.Add(ActionType.TurnLeft); break;

            case Block.RotationType.Right: actions.Add(ActionType.TurnRight); break;
            }
            var delta = source.Col - target.Col;

            if (delta >= 0)
            {
                for (var i = 0; i < delta; i++)
                {
                    actions.Add(ActionType.Left);
                }
            }
            else
            {
                for (var i = 0; i < -delta; i++)
                {
                    actions.Add(ActionType.Right);
                }
            }
            var down = target.Row - source.Row - block.Bottom;

            for (var i = 0; i < down; i++)
            {
                actions.Add(ActionType.Down);
            }
            return(BlockPath.Create(actions.ToArray()));
        }
 public TempPath(Block block, Position position, BlockPath path)
 {
     Block    = block;
     Position = position;
     Path     = path;
 }
 public Block1Node(Field field, BlockPath path, int score, int branchingfactor)
     : base(field, score)
 {
     Path            = path;
     BranchingFactor = branchingfactor;
 }
		public TempPath(Block block, Position position, BlockPath path)
		{
			Block = block;
			Position = position;
			Path = path;
		}