Enum Status
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สถานะ
สถานะของโซลูชัน ก่อนที่จะแก้ปัญหา สถานะจะเป็น NOT_SOLVED
หลังจากนั้น สถานะจะเปลี่ยนไปเป็นค่าอื่นๆ โดยขึ้นอยู่กับว่าพบวิธีแก้ปัญหาหรือไม่ และวิธีแก้ปัญหานั้นมีประสิทธิภาพสูงสุดหรือไม่
หากต้องการเรียกใช้ enum ให้เรียกคลาสหลัก ชื่อ และพร็อพเพอร์ตี้ของ enum นั้น เช่น
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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\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. |"]]