solveClosestFacility method

Future<ClosestFacilityResult> solveClosestFacility(
  1. {required ClosestFacilityParameters closestFacilityParameters}
)

Solves a closest facility passing in a parameters object.

Executes the ClosestFacilityParameters defined for this ClosestFacilityTask and returns a ClosestFacilityResult containing the results.

Parameters:

  • closestFacilityParameters — The closest facility parameters.

Return Value: A Future that returns a ClosestFacilityResult type.

Implementation

Future<ClosestFacilityResult> solveClosestFacility(
    {required ClosestFacilityParameters closestFacilityParameters}) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ClosestFacilityTask_solveClosestFacilityAsync(
        _handle, closestFacilityParameters._handle, errorHandler);
  });
  return taskHandle
      .toFuture((element) => element.getValueAsClosestFacilityResult()!);
}