Configuration

A new optimization algorithm is now the default for HERE Tour Planning API /async requests. Learn about the new algorithm →

The configuration object contains a list of settings you can use to tweak the optimization algorithm's default behavior.

📘

Note

This setting is part of the problem request body in the /problems and /async/problems endpoints.

The termination settings enable you to control the runtime of the optimization algorithm and when to stop. See the following example:

{
  "configuration": {
    "termination": {
      "maxTime": 2,
      "stagnationTime": 1
    }
  },
...
}
  • Max time

    Specify maxTime to set the maximum time, in seconds, that the algorithm can run to solve the problem. If the algorithm cannot find a solution within that time, it stops when the limit expires.

  • Stagnation time

    Specify the parameter stagnationTime, in seconds, to stop the optimization algorithm if it cannot find an improved solution over a period of stagnationTime.

  • Search effort

    Specify the searchEffort parameter to control how much improvement the algorithm must achieve during each stagnationTime period to keep searching. Use this parameter to balance solution quality against runtime.

    📘

    Important

    The searchEffort parameter supports the following values:

    ValueBehavior
    quickRequires a large improvement to continue. The algorithm stops sooner.
    balancedDefault. Requires a moderate improvement to continue.
    thoroughTreats even small improvements as progress. The algorithm searches longer before it stops.
    {
      "configuration": {
        "termination": {
          "maxTime": 300,
          "stagnationTime": 60,
          "searchEffort": "thorough"
        }
      },
    ...
    }

Algorithm selection

Set the classicMode parameter in the configuration object to select the optimization algorithm that solves a request. The default algorithm depends on the endpoint. For more information about which endpoints use which algorithm by default, how to compare results, and the updates about the transition period during which the API permits the use of either algorithm, see New default optimization algorithm.

The classicMode parameter supports the following values:

  • true: Uses the previous optimization algorithm. The algorithm ignores the searchEffort setting.
  • false: Uses the new optimization algorithm.
  • Omitted: Uses the default algorithm for the endpoint.

The following example selects the new optimization algorithm to solve a request:

{
  "configuration": {
    "classicMode": false
  },
...
}

Next steps

  • To understand the problem structure that contains this configuration, see Problem.
  • For request structure and available options, see the API Reference.

Did this page help you?