src/yapf/yapf_base.hpp
changeset 9104 928a6de16975
parent 8329 77e50bd6ad67
child 10429 1b99254f9607
equal deleted inserted replaced
9103:ef4a10ed7f9f 9104:928a6de16975
   136 
   136 
   137 		bool bDestFound = (m_pBestDestNode != NULL) && (m_pBestDestNode != m_pBestIntermediateNode);
   137 		bool bDestFound = (m_pBestDestNode != NULL) && (m_pBestDestNode != m_pBestIntermediateNode);
   138 
   138 
   139 #ifndef NO_DEBUG_MESSAGES
   139 #ifndef NO_DEBUG_MESSAGES
   140 		perf.Stop();
   140 		perf.Stop();
   141 		if (_debug_yapf_level >= 3) {
   141 		if (_debug_yapf_level >= 2) {
   142 			int t = perf.Get(1000000);
   142 			int t = perf.Get(1000000);
   143 			_total_pf_time_us += t;
   143 			_total_pf_time_us += t;
   144 
   144 
   145 			UnitID veh_idx = (m_veh != NULL) ? m_veh->unitnumber : 0;
   145 			if (_debug_yapf_level >= 3) {
   146 			char ttc = Yapf().TransportTypeChar();
   146 				UnitID veh_idx = (m_veh != NULL) ? m_veh->unitnumber : 0;
   147 			float cache_hit_ratio = (m_stats_cache_hits == 0) ? 0.0f : ((float)m_stats_cache_hits / (float)(m_stats_cache_hits + m_stats_cost_calcs) * 100.0f);
   147 				char ttc = Yapf().TransportTypeChar();
   148 			int cost = bDestFound ? m_pBestDestNode->m_cost : -1;
   148 				float cache_hit_ratio = (m_stats_cache_hits == 0) ? 0.0f : ((float)m_stats_cache_hits / (float)(m_stats_cache_hits + m_stats_cost_calcs) * 100.0f);
   149 			int dist = bDestFound ? m_pBestDestNode->m_estimate - m_pBestDestNode->m_cost : -1;
   149 				int cost = bDestFound ? m_pBestDestNode->m_cost : -1;
   150 
   150 				int dist = bDestFound ? m_pBestDestNode->m_estimate - m_pBestDestNode->m_cost : -1;
   151 			DEBUG(yapf, 3, "[YAPF%c]%c%4d- %d us - %d rounds - %d open - %d closed - CHR %4.1f%% - c%d(sc%d, ts%d, o%d) -- ",
   151 
   152 			  ttc, bDestFound ? '-' : '!', veh_idx, t, m_num_steps, m_nodes.OpenCount(), m_nodes.ClosedCount(),
   152 				DEBUG(yapf, 3, "[YAPF%c]%c%4d- %d us - %d rounds - %d open - %d closed - CHR %4.1f%% - c%d(sc%d, ts%d, o%d) -- ",
   153 			  cache_hit_ratio, cost, dist, m_perf_cost.Get(1000000), m_perf_slope_cost.Get(1000000),
   153 				  ttc, bDestFound ? '-' : '!', veh_idx, t, m_num_steps, m_nodes.OpenCount(), m_nodes.ClosedCount(),
   154 			  m_perf_ts_cost.Get(1000000), m_perf_other_cost.Get(1000000)
   154 				  cache_hit_ratio, cost, dist, m_perf_cost.Get(1000000), m_perf_slope_cost.Get(1000000),
   155 			);
   155 				  m_perf_ts_cost.Get(1000000), m_perf_other_cost.Get(1000000)
       
   156 				);
       
   157 			}
   156 		}
   158 		}
   157 #endif /* !NO_DEBUG_MESSAGES */
   159 #endif /* !NO_DEBUG_MESSAGES */
   158 		return bDestFound;
   160 		return bDestFound;
   159 	}
   161 	}
   160 
   162