public void addHeuristicCpuCost ( double cost ) { if ( cost <= 0 ) { throw new IllegalArgumentException ( "Heuristic costs must be positive." ) ; } this . heuristicCpuCost += cost ; // check for overflow if ( this . heuristicCpuCost < 0 ) { this . heuristicCpuCost = Double . MAX_VALUE ; } }
Adds the given heuristic CPU cost to the current heuristic CPU cost for this Costs object .