运筹学论文lingo
运筹学论文lingo
lingo常用于线性优化问题,结合运筹学中主要的优化问题类型,本系列将使用lingo求解常见的运筹学优化模型,主要包含:
一般来说,一个优化模型将由以下三部分组成: 1. 目标函数(Objective Function) :要达到的目标。 2. 决策变量(Decision variables) :每组决策变量的值代表一种方案。在优化模型中需要确定决策变量的最优值,优化的目标就是找到决策变量的最优值使得目标函数取得最优。 3. 约束条件(Constraints) :对于决策变量的一些约束,它限定决策变量可以取的值。 在写数学模型时,一般第一行是目标函数,接下来是约束条件,再接着是一些非负限制等。
运筹学实验 Lingo
程序 其中x表示是否派第i个人执行第j个任务 应该很清楚
model:
sets:
task/1..5/:;
person/1..5/:;
link(person,task):time,x;
endsets
data:
time=
8 6 10 9 12
9 12 7 11 9
7 4 3 5 8
9 5 8 11 8
4 6 7 5 11;
enddata
min=@sum(link:time*x);
@for(person(i):@sum(task(j):x(i,j))=1);
@for(task(j):@sum(person(i):x(i,j))=1);
@for(link:@bin(x));
end
运筹学用Lingo做课程设计选题(17):生产调运配问题
其中produce是第j车间生产第n产品产量
transport1是第j车间到第k项目运输n产品的量
transport2是第i仓库到第j车间运输第m材料的量
transport3是第i仓库到第k项目运输塑钢门窗的量
transport4是第i仓库到第k项目运输钢材m的量
model:
sets:
warehouse/1..2/:ownership2;
factory/1..2/:ttime;
item/1..5/:demand3;
material/1..3/:;
production/1..2/:;
link1(material,warehouse):ownership1;
link2(production,material):expend;
link3(factory,production):time,cost,produce,ability;
link4(item,production):demand1;
link5(item,material):demand2;
link6(factory,item):transportcost1;
link7(factory,item,production):transport1;
link8(warehouse,factory):transportcost2;
link9(warehouse,factory,material):transport2;
link10(warehouse,item):transportcost3,transport3;
link11(warehouse,item,material):transport4;
endsets
data:
ownership1=
5000 7000
5500 6500
10000 6000;
ownership2=380 450;
expend=
9 13 23
11 15 20;
time=
30 40
40 35;
ttime=20000 10000;
ability=
120 80
100 120;
cost=
320 300
280 360;
demand1=
80 0
100 90
100 60
60 50
30 120;
demand2=
50 30 40
0 120 100
70 120 160
40 90 30
60 90 40;
demand3=140 120 100 220 70;
transportcost1=
20 40 100 50 40
40 50 120 70 60;
transportcost2=
90 50
60 40;
transportcost3=
10 10 20 30 20
10 15 15 5 30;
enddata
min=@sum(link11(i,k,m):transport4(i,k,m)*transportcost3(i,k))
+@sum(link10(i,k):transport3(i,k)*transportcost3(i,k))
+@sum(link9(i,j,m):transport2(i,j,m)*transportcost2(i,j))
+@sum(link7(j,k,n):transport1(j,k,n)*transportcost1(j,k))
+@sum(link3(j,n):produce(j,n)*cost(j,n)+@if(produce(j,n)#gt#ability(j,n),200*(produce(j,n)-ability(j,n)),0));
@for(factory(j):@for(material(m):@sum(warehouse(i):transport2(i,j,m))=@sum(production(n):produce(j,n)*expend(n,m))));
@for(production(n):@for(factory(j):@sum(item(k):transport1(j,k,n))=produce(j,n)));
@for(warehouse(i):@sum(item(k):transport3(i,k))<=ownership2(i));
@for(warehouse(i):@for(material(m):@sum(item(k):transport4(i,k,m))+@sum(factory(j):transport2(i,j,m))<=ownership1(m,i)));
@for(factory(i):@sum(production(n):produce(i,n)*time(i,n))<=ttime(i));
@for(item(k):@for(production(n):@sum(factory(j):transport1(j,k,n))=demand1(k,n)));
@for(item(k):@for(material(m):@sum(warehouse(i):transport4(i,k,m))=demand2(k,m)));
@for(item(k):@sum(warehouse(i):transport3(i,k))=demand3(k));
end
运筹学用lingo做课程设计选题(17):生产调运配问题
model:
sets:
warehouse/1..2/:ownership2;
factory/1..2/:ttime;
item/1..5/:demand3;
material/1..3/:;
production/1..2/:;
link1(material,warehouse):ownership1;
link2(production,material):expend;
link3(factory,production):time,cost,produce,ability;
link4(item,production):demand1;
link5(item,material):demand2;
link6(factory,item):transportcost1;
link7(factory,item,production):transport1;
link8(warehouse,factory):transportcost2;
link9(warehouse,factory,material):transport2;
link10(warehouse,item):transportcost3,transport3;
link11(warehouse,item,material):transport4;
endsets
data:
ownership1=
5000 7000
5500 6500
10000 6000;
ownership2=380 450;
expend=
9 13 23
11 15 20;
time=
30 40
40 35;
ttime=20000 10000;
ability=
120 80
100 120;
cost=
320 300
280 360;
demand1=
80 0
100 90
100 60
60 50
30 120;
demand2=
50 30 40
0 120 100
70 120 160
40 90 30
60 90 40;
demand3=140 120 100 220 70;
transportcost1=
20 40 100 50 40
40 50 120 70 60;
transportcost2=
90 50
60 40;
transportcost3=
10 10 20 30 20
10 15 15 5 30;
enddata
min=@sum(link11(i,k,m):transport4(i,k,m)*transportcost3(i,k))
+@sum(link10(i,k):transport3(i,k)*transportcost3(i,k))
+@sum(link9(i,j,m):transport2(i,j,m)*transportcost2(i,j))
+@sum(link7(j,k,n):transport1(j,k,n)*transportcost1(j,k))
+@sum(link3(j,n):produce(j,n)*cost(j,n)+@if(produce(j,n)#gt#ability(j,n),200*(produce(j,n)-ability(j,n)),0));
@for(factory(j):@for(material(m):@sum(warehouse(i):transport2(i,j,m))=@sum(production(n):produce(j,n)*expend(n,m))));
@for(production(n):@for(factory(j):@sum(item(k):transport1(j,k,n))=produce(j,n)));
@for(warehouse(i):@sum(item(k):transport3(i,k))<=ownership2(i));
@for(warehouse(i):@for(material(m):@sum(item(k):transport4(i,k,m))+@sum(factory(j):transport2(i,j,m))<=ownership1(m,i)));
@for(factory(i):@sum(production(n):produce(i,n)*time(i,n))<=ttime(i));
@for(item(k):@for(production(n):@sum(factory(j):transport1(j,k,n))=demand1(k,n)));
@for(item(k):@for(material(m):@sum(warehouse(i):transport4(i,k,m))=demand2(k,m)));
@for(item(k):@sum(warehouse(i):transport3(i,k))=demand3(k));
end
上一篇:当代旅游杂志哪年创刊
下一篇:期刊网和知网有什么不同