示例#1
0
 private bool GoalTest(A_Star_MDDs_Node toCheck)
 {
     if (toCheck.GetDepth() == problem[0].levels.Length - 1)
     {
         return(true);
     }
     return(false);
 }
示例#2
0
        /// <summary>
        /// Prefers fewer conflicts. If the number of conflicts is the same, prefers more depth.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public int CompareTo(IBinaryHeapItem other)
        {
            A_Star_MDDs_Node that = (A_Star_MDDs_Node)other;

            if (this.conflictCount + this.targetDeltaConflictCount < that.conflictCount + that.targetDeltaConflictCount)
            {
                return(-1);
            }
            if (this.conflictCount + this.targetDeltaConflictCount > that.conflictCount + that.targetDeltaConflictCount)
            {
                return(1);
            }

            if (this.GetDepth() > that.GetDepth())
            {
                return(-1);
            }
            if (this.GetDepth() < that.GetDepth())
            {
                return(1);
            }

            return(0);
        }