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