设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6091|回复: 0

[求助] 【求助! Equation公式】关于多品类补货的公式编写

  [复制链接]
发表于 2011-12-4 21:25:53 | 显示全部楼层 |阅读模式
求助高手啊~!!! 感激不尽!: \4 w% ]2 Y% a% W2 ?

# I1 Y/ n) c2 T. ?+ t如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:
7 d9 r% }3 Y1 r/ W& ?% f* l7 J5 F1 t***********其中inv1,2,3分别表示3种货品各自的库存量,  ss1,2,3分别表示各自的安全库存 ***********
  d; c9 p8 g/ o& l***********S1,2,3分别表示各自的最大库存,  out1,2,3分别为各自的补货量************ k4 r, z) u: X5 u( l! E
8 _' y8 d; N& L+ w, \2 S: V

6 N7 K. p7 W1 e5 s9 y& [if (inv1<=ss1 and inv2>ss2 and inv3>ss3)7 {2 Z9 y5 C+ O8 y% t% i
out1=S1-inv1;
0 Z5 R( r6 J2 m8 iout2=0;
; v& b( @( |: {; Cout3=0; /货品1需要补货/& I" s! T; [+ K! U4 _- W
! ^6 q) [+ `4 O- q
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)& ^/ T) c; \/ X
out1=0;) b; x. N: j+ Y
out2=S2-inv2;& Y0 Z/ A' `# S1 a2 l" j4 @
out3=0; /货品2需要补货/  E& L( j+ G! K* V7 f% J0 x' n

7 h5 ?& l: b9 S( aelse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)
9 C" z) n. |7 iout1=0;, Y0 w  q" q2 ^$ q4 i
out2=0;2 k* @$ A9 ]& ~% P4 I
out3=S3-inv3; /货品3需要补货/& k* H5 `: g, b: D' `
% I- m4 t2 R' x* P! H
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3): `% G& }! ^7 M! X. U. H
out1=S1-inv1;% W  a) e4 x9 Y8 v
out2=S2-inv2;- X$ m+ U3 ~  x6 b0 e$ m
out3=0; /货品1,2需要补货// n& e$ b2 q. @- s8 T6 n% D9 r& s3 I

' A) `, w* |2 N- g1 S1 pelse if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)
% O7 d( k8 b0 a7 H! T" z1 d, `" h: @out1=S1-inv1;, X2 H: t, I, O  r$ Q4 D$ b, A$ a7 ?  }
out2=0;) J+ r0 H& ^* n
out3=S3-inv3; /货品1,3需要补货/+ f2 m* L7 m" T

# O, \# r5 S. y! N  ~else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)
" C. ^+ Y$ U! h; s" Qout1=0;
, ~" D5 p+ b' f1 p! `: z7 @0 Gout2=S2-inv2;# F! I( B, s# I# p
out3=S3-inv3; /货品2,3需要补货/
  U& A) B1 ]: F. w& U) Z3 r* r
! R0 F3 I' g2 M3 ?* ]else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
+ C* _( D1 |( u7 Oout1=S1-inv1;: v8 y. p0 Z3 _8 e) b5 }$ i7 @
out2=S2-inv2;
1 w0 J0 U4 Y+ a/ Y7 Fout3=S3-inv3; /货品1,2,3需要补货/1 T2 j/ v3 a/ Q) c- b8 r

3 D0 H2 {1 T, w8 L+ O8 z问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",
3 f+ b/ K0 l: M2 [! d- }但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.
( Q6 }4 A" S5 F8 D2 w: ?  `- D9 ~9 a- K$ Z
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?! R$ F+ t" W. e: y. n* @$ e, U
谢谢~!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-8-21 20:02 , Processed in 0.014615 second(s), 16 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表