diff --git a/cost_function.py b/cost_function.py index 5b5bc26b55522cc31a59e0e2c7c0b0a7fcff2973..4377144696ebee34057af5c2ea69000cbd90e186 100755 --- a/cost_function.py +++ b/cost_function.py @@ -79,6 +79,11 @@ def node_to_prop(node_list, e_overestim, array_d_init, handlers): prop = {"pos": shapeRec.shape.points[0], "speed": shapeRec.record.speed} prop["radius"] = handlers[i_SHPC]["readers"]["max_speed_contour"]\ .record(ishape).r_eq_area + + if prop["radius"] < 0: + prop["radius"] = handlers[i_SHPC]["readers"]["outermost_contour"]\ + .record(ishape).r_eq_area + properties.append(prop) return properties