@Override
    public CalculateRouteMatrixResult calculateRouteMatrix(CalculateRouteMatrixRequest request) {
        request = beforeClientExecution(request);
        return executeCalculateRouteMatrix(request);
    }
<p>
<a href="https://docs.aws.amazon.com/location/latest/developerguide/calculate-route-matrix.html"> Calculates a
route matrix</a> given the following required parameters: <code>DeparturePositions</code> and
<code>DestinationPositions</code>. <code>CalculateRouteMatrix</code> calculates routes and returns the travel
time and travel distance from each departure position to each destination position in the request. For example,
given departure positions A and B, and destination positions X and Y, <code>CalculateRouteMatrix</code> will
return time and distance for routes from A to X, A to Y, B to X, and B to Y (in that order). The number of
results returned (and routes calculated) will be the number of <code>DeparturePositions</code> times the number
of <code>DestinationPositions</code>.
</p>
<note>
<p>
Your account is charged for each route calculated, not the number of requests.
</p>
</note>
<p>
Requires that you first <a
href="https://docs.aws.amazon.com/location-routes/latest/APIReference/API_CreateRouteCalculator.html">create a
route calculator resource</a>.
</p>
<p>
By default, a request that doesn't specify a departure time uses the best time of day to travel with the best
traffic conditions when calculating routes.
</p>
<p>
Additional options include:
</p>
<ul>
<li>
<p>
<a href="https://docs.aws.amazon.com/location/latest/developerguide/departure-time.html"> Specifying a departure
time</a> using either <code>DepartureTime</code> or <code>DepartNow</code>. This calculates routes based on
predictive traffic data at the given time.
</p>
<note>
<p>
You can't specify both <code>DepartureTime</code> and <code>DepartNow</code> in a single request. Specifying both
parameters returns a validation error.
</p>
</note></li>
<li>
<p>
<a href="https://docs.aws.amazon.com/location/latest/developerguide/travel-mode.html">Specifying a travel
mode</a> using TravelMode sets the transportation mode used to calculate the routes. This also lets you specify
additional route preferences in <code>CarModeOptions</code> if traveling by <code>Car</code>, or
<code>TruckModeOptions</code> if traveling by <code>Truck</code>.
</p>
</li>
</ul>

@param calculateRouteMatrixRequest
@return Result of the CalculateRouteMatrix operation returned by the service.
@throws InternalServerException
        The request has failed to process because of an unknown server error, exception, or failure.
@throws ResourceNotFoundException
        The resource that you've entered was not found in your AWS account.
@throws AccessDeniedException
        The request was denied because of insufficient access or permissions. Check with an administrator to
        verify your permissions.
@throws ValidationException
        The input failed to meet the constraints specified by the AWS service.
@throws ThrottlingException
        The request was denied because of request throttling.
@sample AmazonLocation.CalculateRouteMatrix
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/location-2020-11-19/CalculateRouteMatrix" target="_top">AWS
     API Documentation</a>
aws-java-sdk-location/src/main/java/com/amazonaws/services/location/AmazonLocationClient.java