SolvingMode
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
定義解算器應如何處理要求。在 VALIDATE_ONLY
以外的所有模式中,如果要求無效,您會收到 INVALID_REQUEST
錯誤。請參閱 maxValidationErrors
,瞭解如何限制傳回的錯誤數量。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eDefines how the solver processes the request, dictating whether it solves the model, validates it, or detects infeasible shipments.\u003c/p\u003e\n"],["\u003cp\u003eOffers three modes: \u003ccode\u003eDEFAULT_SOLVE\u003c/code\u003e for solving, \u003ccode\u003eVALIDATE_ONLY\u003c/code\u003e for validation, and \u003ccode\u003eDETECT_SOME_INFEASIBLE_SHIPMENTS\u003c/code\u003e for identifying problematic shipments.\u003c/p\u003e\n"],["\u003cp\u003eIn all modes except \u003ccode\u003eVALIDATE_ONLY\u003c/code\u003e, invalid requests will return an \u003ccode\u003eINVALID_REQUEST\u003c/code\u003e error, with potential for controlling the number of error messages.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDETECT_SOME_INFEASIBLE_SHIPMENTS\u003c/code\u003e mode focuses on pre-processing infeasibility detection without fully solving the problem.\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/documentation/route-optimization/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/documentation/route-optimization/reference/rest/v1/OptimizeToursResponse#FIELDS.validation_errors) as possible. |\n| `DETECT_SOME_INFEASIBLE_SHIPMENTS` | Only populates [OptimizeToursResponse.validation_errors](/maps/documentation/route-optimization/reference/rest/v1/OptimizeToursResponse#FIELDS.validation_errors) or [OptimizeToursResponse.skipped_shipments](/maps/documentation/route-optimization/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/documentation/route-optimization/reference/rest/v1/OptimizeToursResponse#FIELDS.validation_errors) field and [OptimizeToursResponse.skipped_shipments](/maps/documentation/route-optimization/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. |\n| `TRANSFORM_AND_RETURN_REQUEST` | This mode only works if `ShipmentModel.objectives` is not empty. The request is not solved. It is only validated and filled with costs corresponding to the given objectives. Also see the documentation of `ShipmentModel.objectives`. The resulting request is returned as `OptimizeToursResponse.processed_request`. Experimental: See \u003chttps://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request\u003e for more details. |"]]