Enum Status
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
状态
解决方案的状态。在解决问题之前,状态为 NOT_SOLVED
;之后,状态将取任何其他值,具体取决于是否成功找到了解决方案以及解决方案是否最优。
如需调用枚举,您可以调用其父类、名称和属性。例如
LinearOptimizationService.Status.OPTIMAL
。
属性
属性 | 类型 | 说明 |
OPTIMAL | Enum | 找到最佳解决方案时的状态。 |
FEASIBLE | Enum | 找到可行(但不一定是最佳)解决方案时的状态。 |
INFEASIBLE | Enum | 当前模型不可行(无解)时的状态。 |
UNBOUNDED | Enum | 当前模型未绑定时的状态。 |
ABNORMAL | Enum | 当系统因意外原因而未能找到解决方案时显示的状态。 |
MODEL_INVALID | Enum | 模型无效时的状态。 |
NOT_SOLVED | Enum | 尚未调用 LinearOptimizationEngine.solve() 时的状态。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003eStatus\u003c/code\u003e property indicates the state of a Linear Optimization solution, initially set to \u003ccode\u003eNOT_SOLVED\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAfter attempting to solve the problem, the status changes to reflect if a solution was found and if it is optimal (\u003ccode\u003eOPTIMAL\u003c/code\u003e, \u003ccode\u003eFEASIBLE\u003c/code\u003e, \u003ccode\u003eINFEASIBLE\u003c/code\u003e, \u003ccode\u003eUNBOUNDED\u003c/code\u003e, \u003ccode\u003eABNORMAL\u003c/code\u003e, \u003ccode\u003eMODEL_INVALID\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eAccessing the status enum values is done using the format: \u003ccode\u003eLinearOptimizationService.Status.[property name]\u003c/code\u003e, such as \u003ccode\u003eLinearOptimizationService.Status.OPTIMAL\u003c/code\u003e.\u003c/p\u003e\n"]]],["The document outlines the `Status` of a solution within a system, initially `NOT_SOLVED` before any problem-solving attempt. After solving, the status changes to reflect the outcome. Possible statuses include `OPTIMAL` (best solution found), `FEASIBLE` (a solution exists, but may not be the best), `INFEASIBLE` (no solution), `UNBOUNDED` (model is unlimited), `ABNORMAL` (failed for unexpected reasons), and `MODEL_INVALID` (invalid model). Enums are accessed using `ParentClass.Name.Property`, like `LinearOptimizationService.Status.OPTIMAL`.\n"],null,["# Enum Status\n\nStatus\n\nStatus of the solution. Before solving a problem the status will be `NOT_SOLVED`;\nafterwards it will take any of the other values depending if it successfully found a solution and\nif the solution is optimal.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nLinearOptimizationService.Status.OPTIMAL`. \n\n### Properties\n\n| Property | Type | Description |\n|-----------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| `OPTIMAL` | `Enum` | Status when an optimal solution has been found. |\n| `FEASIBLE` | `Enum` | Status when a feasible (not necessarily optimal) solution has been found. |\n| `INFEASIBLE` | `Enum` | Status when the current model is unfeasible (has no solution). |\n| `UNBOUNDED` | `Enum` | Status when the current model is unbound. |\n| `ABNORMAL` | `Enum` | Status when it failed to find a solution for unexpected reasons. |\n| `MODEL_INVALID` | `Enum` | Status when the model is invalid. |\n| `NOT_SOLVED` | `Enum` | Status when [LinearOptimizationEngine.solve()](/apps-script/reference/optimization/linear-optimization-engine#solve()) has not been called yet. |"]]