コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseNode"/> class.
 /// </summary>
 /// <param name="x">The x.</param>
 /// <param name="y">The y.</param>
 /// <param name="state">The crateLocations.</param>
 /// <param name="pathCost">The path cost.</param>
 /// <param name="parent">The parent.</param>
 /// <param name="action">The action.</param>
 public BaseNode(int x, int y, List <int[]> state, int pathCost, double heuristicValue, BaseNode parent = null, Move?action = null)
 {
     this.location       = new Tuple <int, int>(x, y);
     this.crateLocations = state;
     this.pathCost       = pathCost;
     this.parent         = parent;
     this.action         = action;
     this.heuristicValue = heuristicValue;
 }
コード例 #2
0
 /// <summary>
 /// Adds the child to queue.
 /// </summary>
 /// <param name="node">The node.</param>
 protected override void AddNodeToQueue(BaseNode node)
 {
     // Implements a LIFO queue
     this.queue.Insert(0, node);
 }