Objet stockant une contrainte linéaire de la forme lowerBound ≤ Sum(a(i) x(i)) ≤ upperBound, où lowerBound et upperBound sont des constantes, a(i) sont des coefficients constants et x(i) sont des variables (inconnues).
Type de variable qui ne peut prendre que des valeurs entières.
CONTINUOUS
Enum
Type de variable pouvant prendre n'importe quelle valeur réelle.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/26 (UTC)."],[[["\u003cp\u003eThe Linear Optimization Service enables the modeling and resolution of linear and mixed-integer linear programs within Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eIt provides classes like \u003ccode\u003eLinearOptimizationConstraint\u003c/code\u003e, \u003ccode\u003eLinearOptimizationEngine\u003c/code\u003e, and \u003ccode\u003eLinearOptimizationSolution\u003c/code\u003e to define, solve, and retrieve optimization results.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLinearOptimizationEngine\u003c/code\u003e allows adding variables, constraints, setting objective functions (maximization or minimization), and solving the linear program.\u003c/p\u003e\n"],["\u003cp\u003eSolutions can be evaluated using methods like \u003ccode\u003egetObjectiveValue\u003c/code\u003e, \u003ccode\u003egetStatus\u003c/code\u003e, and \u003ccode\u003egetVariableValue\u003c/code\u003e to understand the optimization outcome.\u003c/p\u003e\n"],["\u003cp\u003eThe service utilizes various statuses (e.g., \u003ccode\u003eOPTIMAL\u003c/code\u003e, \u003ccode\u003eFEASIBLE\u003c/code\u003e, \u003ccode\u003eINFEASIBLE\u003c/code\u003e) and variable types (\u003ccode\u003eINTEGER\u003c/code\u003e, \u003ccode\u003eCONTINUOUS\u003c/code\u003e) to represent the solution state and variable characteristics.\u003c/p\u003e\n"]]],["The linear optimization service models and solves linear and mixed-integer linear programs. Key actions include: creating an engine (`LinearOptimizationEngine`), adding variables with bounds and types, adding constraints to the model, setting the objective function's direction (maximize or minimize), and setting coefficients for variables in the objective function and constraints. The `solve()` method then computes the solution. The `LinearOptimizationSolution` object contains methods to determine solution status, objective value, and variable values.\n"],null,[]]