标题: 如何实现变量的选择? [打印本页] 作者: shiyiming 时间: 2006-4-23 09:18 标题: 如何实现变量的选择? 我在做运筹学模型时,要实现变量的选择,该如何实现啊?谢谢各位帮帮忙!!
在程序:
data a1;
input _row_$ x1-x4 _type_$ _rhs_;
cards;
object 1.7 2.25 4.5 1.12 max .
con1 0.0012 0.0015 0.003 0.0008 le 27.252
con2 1 1 1 1 le 24000
bound 6500 5000 4000 3000 upperbd .
;
proc lp;
run;
怎么才能实现
if x1<1500 then x1=0 else x1不变;
if x2<1000 then x2=0 else x2不变;
if x3<1000 then x3=0 else x3不变;
if x4<900 then x4=0 else x4不变;
各位高手,帮忙解决解决!!感激不尽!!!tks!!作者: shiyiming 时间: 2006-4-23 09:59 标题: 输入数据的精度问题? 我试了好几次,觉得问题好像是输入的数据的精度受限,也就是con1中的小数不能输出正确,只有小数点后2位,
这个问题该怎么解决啊・・・
多谢高人指点!!!
tks!!作者: shiyiming 时间: 2006-4-29 22:45 标题: reply 我不知道这个是不是要的?
data hua;
input x1-x4 ;
if x1 lt 1500 then x1=0;
if x2 lt 1000 then x2=0;
if x3 lt 1000 then x3=0;
if x4 lt 900 then x4=0;
cards;
6500 50 4000 3000
650 500 400 300
;
run;
proc print;run;
请问你现在做的是什么运筹学模型,感兴趣!哈哈作者: shiyiming 时间: 2006-4-30 16:15 标题: 还是有疑问 这样是可以实现,但是在下面程序还是有些问题
data a1;
input _row_$ x1-x4 _type_$ _rhs_;
if x1 lt 1500 then x1=0;
if x2 lt 1000 then x2=0;
if x3 lt 1000 then x3=0;
if x4 lt 900 then x4=0;
cards;
object 1.7 2.25 4.5 1.12 max .
con1 0.0012 0.0015 0.003 0.0008 le 27.252
con2 1 1 1 1 le 24000
bound 6500 5000 4000 3000 upperbd .
inbd 1 2 3 4 integer .
;
proc lp;
run;
从运行结果来看,x1-x4的con行的系数全为0。由于5.1放假没有借到图书馆的SAS/OR的参考书,所以现在也不知道到底是何原因・・
我现在在做毕业论文,小用了一下SAS/OR做优化模型,另外在用时间序列做预测。你SAS应该学得蛮不错吧,以后多交流啊!!
呵呵・・作者: shiyiming 时间: 2006-5-3 09:58 标题: check the coefficient matrix A According to your coeffiecent matrix A, why A=0 in your dataset. if so, how this LP problem could be solved? hhaha.作者: shiyiming 时间: 2006-5-3 21:43 标题: re: 其实原问题是没有下界限制的,但是从实际问题来看,应该有下限限制,所以就加了个这几个条件限制。
但是现在通过软件来就不知道该怎样实现了,我也用Lingo试过了,也是有这个问题,Lingo也学得不好・・ <!-- s:x --><img src="{SMILIES_PATH}/icon_mad.gif" alt=":x" title="Mad" /><!-- s:x --> <!-- s:x --><img src="{SMILIES_PATH}/icon_mad.gif" alt=":x" title="Mad" /><!-- s:x -->