我正在使用下面的代码设置 routingModel 的时间限制。
RoutingSearchParameters search_parameters = RoutingModel.DefaultSearchParameters();
search_parameters.FirstSolutionStrategy = FirstSolutionStrategy.Types.Value.PATH_CHEAPEST_ARC;
search_parameters.TimeLimitMs = 30000;
RoutingModel routing = new RoutingModel(number_of_locations, number_of_vehicles);
但是我不知道搜索完成后如何获取状态,所以我可以检查是否是时间限制取消它或由于其他原因没有找到解决方案。请帮忙
Assignment solution = routing.SolveWithParameters(search_parameters);
RoutingModel 类具有此静态属性,但我不知道如何从实例中读取它们:
public static readonly int ROUTING_FAIL;
public static readonly int ROUTING_FAIL_TIMEOUT;
public static readonly int ROUTING_INVALID;
public static readonly int ROUTING_NOT_SOLVED;
public static readonly int ROUTING_SUCCESS;