Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
DoğrusalOptimizasyonKısıtı
lowerBound ve upperBound sabitler, a(i) sabit katsayılar ve x(i) değişkenler (bilinmeyenler) olan lowerBound ≤ Sum(a(i) x(i)) ≤ upperBound biçiminde doğrusal bir kısıtlamayı depolayan nesne.
Aşağıdaki örnekte, 0 ile 5 arasında değerlere sahip bir x değişkeni ve 0 ≤ 2 * x ≤ 5 kısıtlaması oluşturulmaktadır. Bu, öncelikle alt sınır 5 ve üst sınır 5 ile bir kısıtlama oluşturarak yapılır. Ardından, bu kısıtlamadaki x değişkeninin katsayısı 2 olarak ayarlanır.
constengine=LinearOptimizationService.createEngine();// Create a variable so we can add it to the constraintengine.addVariable('x',0,5);// Create a linear constraint with the bounds 0 and 10constconstraint=engine.addConstraint(0,10);// Set the coefficient of the variable in the constraint. The constraint is now:// 0 <= 2 * x <= 5constraint.setCoefficient('x',2);
Kısıtlamadaki bir değişkenin katsayısını ayarlar. Varsayılan olarak, değişkenlerin katsayısı 0'dır.
constengine=LinearOptimizationService.createEngine();// Create a linear constraint with the bounds 0 and 10constconstraint=engine.addConstraint(0,10);// Create a variable so we can add it to the constraintengine.addVariable('x',0,5);// Set the coefficient of the variable in the constraint. The constraint is now:// 0 <= 2 * x <= 5constraint.setCoefficient('x',2);
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eLinearOptimizationConstraint\u003c/code\u003e objects define constraints in the form of \u003ccode\u003elowerBound ≤ Sum(a(i) x(i)) ≤ upperBound\u003c/code\u003e, where \u003ccode\u003ea(i)\u003c/code\u003e are coefficients and \u003ccode\u003ex(i)\u003c/code\u003e are variables.\u003c/p\u003e\n"],["\u003cp\u003eYou can set the coefficient of a variable within a constraint using the \u003ccode\u003esetCoefficient(variableName, coefficient)\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eConstraints are created with lower and upper bounds, and variables are added with their own bounds before being incorporated into the constraint.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code example demonstrates creating a variable, adding a constraint, and setting the coefficient for the variable within that constraint.\u003c/p\u003e\n"]]],[],null,[]]