全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学
814 0
2012-04-20
以下程序的加亮部分不怎么懂,大家知道应该找什么样的资料学习吗,我不知道是不是要找编程规则之类的书,希望大家多给我建议,先谢谢啦


data model;
      array grade{6} grade1-grade6;
      length _type_ $ 8 _row_ $ 8 _col_ $ 8;
      keep _type_ _row_ _col_ _coef_;

      ncust=5;
      nmach=4;
      ngrade=6;

      /* generate the objective function */

      _type_='MAX';
      _row_='OBJ';
      do k=1 to nmach;
         do i=1 to ncust;
            link readobj;     /* read the objective coefficient data */
            do j=1 to ngrade;
               if grade{j}^=. then do;
                  _col_='X'||put(i,1.)||put(j,1.)||put(k,1.);
                  _coef_=grade{j};
                  output;
               end;
            end;
         end;
      end;

       /* generate the demand constraints */        do i=1 to ncust;          link readdmd;        /* read the demand data */          do j=1 to ngrade;             if grade{j}^=. then do;                _type_='EQ';                _row_='DEMAND'||put(i,1.)||put(j,1.);                _col_='_RHS_';                _coef_=grade{j};                output;                _type_=' ';                do k=1 to nmach;                   _col_='X'||put(i,1.)||put(j,1.)||put(k,1.);                   _coef_=1.0;                   output;                end;             end;          end;       end;       /* generate the machine constraints */        do k=1 to nmach;          link readres;       /* read the machine data */          _type_='LE';          _row_='MACHINE'||put(k,1.);          _col_='_RHS_';          _coef_=avail;          output;          _type_=' ';          do i=1 to ncust;             do j=1 to ngrade;                if grade{j}^=. then do;                   _col_='X'||put(i,1.)||put(j,1.)||put(k,1.);                   _coef_=grade{j};                   output;                   end;                end;             end;          end;    readobj: set object;    return;    readdmd: set demand;    return;    readres: set resource;    return;    run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群