SolvingMode
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Определяет, как решатель должен обрабатывать запрос. Во всех режимах, кроме VALIDATE_ONLY
, если запрос недействителен, вы получите ошибку INVALID_REQUEST
. См. maxValidationErrors
, чтобы ограничить количество возвращаемых ошибок.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-08-29 UTC.
[null,null,["Последнее обновление: 2025-08-29 UTC."],[[["\u003cp\u003eThe solver's behavior is determined by the selected mode, with modes other than \u003ccode\u003eVALIDATE_ONLY\u003c/code\u003e returning an \u003ccode\u003eINVALID_REQUEST\u003c/code\u003e error for invalid requests.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDEFAULT_SOLVE\u003c/code\u003e solves the model and may provide warnings in \u003ccode\u003eOptimizeToursResponse.validation_errors\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVALIDATE_ONLY\u003c/code\u003e solely validates the model, populating \u003ccode\u003eOptimizeToursResponse.validation_errors\u003c/code\u003e with as many errors as possible.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDETECT_SOME_INFEASIBLE_SHIPMENTS\u003c/code\u003e focuses on identifying and populating infeasible shipments into \u003ccode\u003eOptimizeToursResponse.validation_errors\u003c/code\u003e or \u003ccode\u003eOptimizeToursResponse.skipped_shipments\u003c/code\u003e without fully solving the request, but it doesn't find all infeasible shipments.\u003c/p\u003e\n"]]],[],null,["# SolvingMode\n\nDefines how the solver should handle the request. In all modes but `VALIDATE_ONLY`, if the request is invalid, you will receive an `INVALID_REQUEST` error. See [maxValidationErrors](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/projects.locations/optimizeTours#body.request_body.FIELDS.max_validation_errors) to cap the number of errors returned.\n\n| Enums ||\n|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `DEFAULT_SOLVE` | Solve the model. Warnings may be issued in \\[OptimizeToursResponse.validation_errors\\]\\[google.cloud.optimization.v1.OptimizeToursResponse.validation_errors\\]. |\n| `VALIDATE_ONLY` | Only validates the model without solving it: populates as many [OptimizeToursResponse.validation_errors](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/OptimizeToursResponse#FIELDS.validation_errors) as possible. |\n| `DETECT_SOME_INFEASIBLE_SHIPMENTS` | Only populates [OptimizeToursResponse.validation_errors](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/OptimizeToursResponse#FIELDS.validation_errors) or [OptimizeToursResponse.skipped_shipments](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/OptimizeToursResponse#FIELDS.skipped_shipments), and doesn't actually solve the rest of the request (`status` and `routes` are unset in the response). If infeasibilities in `injectedSolutionConstraint` routes are detected they are populated in the [OptimizeToursResponse.validation_errors](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/OptimizeToursResponse#FIELDS.validation_errors) field and [OptimizeToursResponse.skipped_shipments](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/OptimizeToursResponse#FIELDS.skipped_shipments) is left empty. *IMPORTANT*: not all infeasible shipments are returned here, but only the ones that are detected as infeasible during preprocessing. |"]]