Spaces:
Sleeping
Sleeping
Rodrigo Ferreira Rodrigues commited on
Commit ·
d9d98b8
1
Parent(s): 8665589
handling case where no path is reachable
Browse files
path_planning_evaluate.py
CHANGED
|
@@ -215,9 +215,9 @@ class Path_Planning_evaluate(evaluate.Metric):
|
|
| 215 |
r_metrics = {}
|
| 216 |
r_metrics.update({
|
| 217 |
'compliance_ratio': metrics['compliance']/(total_reach+total_unreach),
|
| 218 |
-
'success_ratio': metrics['correct']/total_reach,
|
| 219 |
-
'optimal_ratio': metrics['optimal']/total_reach,
|
| 220 |
-
'feasible_ratio': metrics['feasible']/total_reach,
|
| 221 |
'distance': metrics['distance']/diff if diff > 0 else metrics['distance'],
|
| 222 |
'unreachable_acc': metrics['n_detect_unreachable']/total_unreach if total_unreach > 0 else -1,
|
| 223 |
})
|
|
|
|
| 215 |
r_metrics = {}
|
| 216 |
r_metrics.update({
|
| 217 |
'compliance_ratio': metrics['compliance']/(total_reach+total_unreach),
|
| 218 |
+
'success_ratio': metrics['correct']/total_reach if total_reach > 0 else -1,
|
| 219 |
+
'optimal_ratio': metrics['optimal']/total_reach if total_reach > 0 else -1,
|
| 220 |
+
'feasible_ratio': metrics['feasible']/total_reach if total_reach > 0 else -1,
|
| 221 |
'distance': metrics['distance']/diff if diff > 0 else metrics['distance'],
|
| 222 |
'unreachable_acc': metrics['n_detect_unreachable']/total_unreach if total_unreach > 0 else -1,
|
| 223 |
})
|