zoukankan      html  css  js  c++  java
  • Lingo 优化实例 出版社问题

    model:

     

    data:

    LY_K=0.002;

    enddata

     

     

    sets:

     

    !1-72个科目每个科目的书号数;

    number/1..72/:anum;

    link(number);

     

    !每个书号的平均价格;

    price/1..72/:p;

     

    !单位书号的销售量 预测2006年的;

    perSH/1..72/:per;

     

    !1-72个科目2006年的申报数;

    ShenBao/1..72/:SBnum;

     

    !1-72个学科每个学科的满意度;

    QiangShi/1..72/:QSDnum;

     

    themax/1..72/:maxbrn;

     

    themin/1..72/:minbrn;

     

    endsets

     

    data:

    !每个科目的价格;

    p=25.8 25.5 28 26 24.7 25.6 27 22.9 25.9 24.5 26.4

    27.3 24.9 27.5 23.5 23.5 25.7 32.9 31.5 35.3 21 20.2

    24.8 19.6 18.6 23.3 13.1 18.4 22.5 25.7 34.4 18.7 33

    20.6 27.9 21.4 11.4 31.3 23.5 32.3 14.7 18.8 26.6 16.7

    13.4 14.8 17.5 24.2 22.5 32.3 20.8 21.6 23 35.4 20

    23.6 25.6 28 18.9 26.7 21.5 32.4 24 23.8 18.2 22.7

    37.5 22.2 20.7 22.7 24.3 32.2;

     

    !预测2006年单位书号的销售量;

    per=303 417 235 293 189 324 514 68 430 469 1693

    2256 514 1183 381 667 805 601 3202 1403 707 943

    9444 1386 1832 2887 720 652 495 3044 795 526 883

    330 547 274 80 847 415 408 6719 8179 9415 4991 22468

    8605 4426 1280 744 349 467 901 1559 1262 450 1067

    522 208 980 485 233 633 619 793 294 1466 609 483 597 464 651 1182;

     

    !申报数;

    SBnum=18 18 4 6 6 16 12 6 16 8 8 4 4 4 6 6 6 8 6 4 12

    38 52 8 24 34 12 6 24 12 40 4 2 22 8 16 6 6 10 6 4 10

    8 10 6 8 12 14 18 4 10 16 4 8 4 4 4 4 4 10 8 8 8 8 4

    4 8 10 8 6 4 4;

     

    !最小值;

    minbrn=9 9 2 5 5 8 7 3 8 4 4 2 2 2 3 3 4 4 3 4

    6 19 26 5 12 17 6 3 12 6 20 2 1 12 4 8 4 3 5

    3 2 5 4 5 3 4 6 8 9 2 5 8 2 4 2 2 2 2 2 6 4 4

    4 4 3 3 4 5 4 3 2 2;

    !最大值;

    maxbrn=17 17 4 11 11 16 13 5 13 6 8 4 4 2 7 4

    8 8 7 12 14 37 54 9 17 32 7 4 23 12 35

    6 0 24 8 18 8 2 10 2 1 8 4 14 2 8 11 18 20 1 11

    12 2 5 0 1 4 3 3 10 12 8 6 7 5 5 8 10 11 7 2 4;

     

    !强势度;

    QSDnum=0.131991725 0.051638823 0.146085315 0.206857543 0

    0.07416615 0.152560996 0.108649619 0.173819895 0.247067844

    0.51543091 0.420551551 0.008330198 0.104396816 0.306446938

    0.120455853 0.407474312 0.128449675 0.353964376 0.451080634

    0.271198513 0.727681569 1 0.605229637 0.703327274 0.607248301

    0.755746194 0.191524734 0.296030919 0.396618877 0.07036448

    0.158589935 0.281292614 0.357099428 0.343493752 0.356602354

    0.333964964 0.12823599 0.276531313 0.376264664 0.24546387

    0.328891682 0.343940617 0.286953176 0.383573713 0.321580332

    0.305769187 0.359836365 0.466671308 0.194701972 0.391536963

    0.69316555 0.511280626 0.527364935 0.518979433 0.397527973

    0.480554583 0.057503481 0.775428378 0.709538033 0.749738819

    0.711360233 0.619606857 0.746627333 0.283063235 0.714191386

    0.599737024 0.640177636 0.752452392 0.604555314 0.385286795 0.688381201;

    enddata

     

     

    !min=@sum(link:p*anum*per)*LY_K;

    !min=@sum(link:anum*QSDnum);

    max=lanbd;

    @sum(link:p*anum*per)*LY_K-24190*lanbd>37063.34;

    @sum(link:anum*QSDnum)-65.594*lanbd>183.8475;

    !总书号约束;

    @sum(number:anum)=500;

     

    !每个出版社能力分工;

    @sum(number(i)|(i #ge# 1) #and# (i #le# 10):anum)<114;

    @sum(number(i)|(i #ge# 11) #and# (i #le# 20):anum)<114;

    @sum(number(i)|(i #ge# 21) #and# (i #le# 30):anum)<153;

    @sum(number(i)|(i #ge# 31) #and# (i #le# 40):anum)<102;

    @sum(number(i)|(i #ge# 41) #and# (i #le# 48):anum)<111;

    @sum(number(i)|(i #ge# 49) #and# (i #le# 54):anum)<72;

    @sum(number(i)|(i #ge# 55) #and# (i #le# 60):anum)<44;

    @sum(number(i)|(i #ge# 61) #and# (i #le# 66):anum)<63;

    @sum(number(i)|(i #ge# 67) #and# (i #le# 72):anum)<72;

     

    !每个出版社必须大于自己申请数量的一半;

    @for(number(i):anum(i)>SBnum(i)/2);

     

    @for(number(i):anum(i)>minbrn(i));

    @for(number(i):anum(i)<SBnum(i));

     

     

    @for(number(i):@GIN(anum(i)));

     

    end

  • 相关阅读:
    第二次作业
    第四次作业
    第三次作业
    第二次作业
    第一次作业
    第四次作业
    第三次作业
    第二次作业
    第一次大学作业
    第四次作业
  • 原文地址:https://www.cnblogs.com/cntsw/p/3941054.html
Copyright © 2011-2022 走看看