Mathematics tools for excellent solution optimization models - Lingo

xiaoxiao2021-03-06  57

Lingo is a math tool for excellent solution optimization models. Whether it is linear planning or dynamic planning, it can be easily solved. Software life can be downloaded on www.lindo.org. Use lingo to solve the problem to need a certain input format so that LingO can process it. Each model is defined between "MODEL:" to start between "end". Collection Definitions between "Sets" and "Endsets", data definitions between "DATA" and "EndData". Then it is a constraint condition of the model, and you can write N groups. Then use SOLVE to iterate the problem. Use in lingo! As the beginning of the comment, each statement ends with a semicolon, and the function is started, such as @sum. Lingo is not sensitive to case. Examples and Helps included with Lingo are good learning materials. The following is the simplest example. MODEL:! Production line load balancing model;! This model involves loading tasks to workstation and avoiding bottlenecks, wanting to achieve load balancing, and minus working hours; sets:! Define task collection; task / abcdefghijk /: t ;! Definitions have paired (such as. A must do before B, B must do before C, etc.); PRED (Task, Task) / A, B, C, F C, G F, J G, J J, K D, E E E E E E, I H, J I, J /;! Define workstation collection; station / 1..4 /; define task and workstation pairing collection; TXS (Task, Station): x; ! When the task I is given to the workstation K, use x (i, k) = 1; Endsets Data:! For each element of the task set, the value is the task time, T = 45 11 9 50 15 12 12 12 12 8 9; Enddata! The following calculations constrain each workstation can only accept one task at a time; @for (task (i): @SUM (Station (k): x (i, k)) = 1); The following expressions constrain the order of the task must be defined in the PRED collection; @for (PRED (,): k * x (j, k) - k * x (i K)> = 0);! Define variables CYCTIME makes each workstation work time less than this value @for (station (k): @ SUM (TXS (i, k): t (i) * x (i, K)) <= cyctime);! Constrained CYCTIME is the smallest, SOLVE, will meet this requirements for the best solution when it is an iterative method; min = cyctime;! The last equality constraints the X value must be an integer. @For (txs: @bin (x)); End is the expression of this model, entering lingo and then SOLVE can get his best solution. Note (About this software and its more detailed method of solving the optimization model can refer to the "optimization model and experiment" of Tongji Education Press)

转载请注明原文地址:https://www.9cbs.com/read-113376.html

New Post(0)