Exemple #1
0
        public Graph(ANode <TMove> init)
        {
            this.First = init;

            this.Opened = new List <ANode <TMove> >();
            this.Closed = new List <ANode <TMove> >();
        }
Exemple #2
0
 public ANode <TMove> FindIfExist(ANode <TMove> n)
 {
     if (this.Closed.Count < this.Opened.Count)
     {
         return(this.FindIfExistInClosed(n) ?? this.FindIfExistInOpened(n));
     }
     return(this.FindIfExistInOpened(n) ?? this.FindIfExistInClosed(n));
 }
Exemple #3
0
        public ANode <TMove> FindIfExistInClosed(ANode <TMove> n)
        {
            foreach (var node in this.Closed)
            {
                if (n.Equals(node))
                {
                    return(node);
                }
            }

            return(null);
        }
Exemple #4
0
 public abstract bool SameAs(ANode <TMove> mate);
Exemple #5
0
 public abstract double Heuristics(ANode <TMove> final);
Exemple #6
0
 public void Attach(ANode <TMove> child, TMove moveFromParentToChild)
 {
     child.Parent         = this;
     child.MoveFromParent = moveFromParentToChild;
 }
Exemple #7
0
 public void Finish(ANode <TMove> final)
 {
     this.Last = final;
 }