求助高手啊~!!! 感激不尽!' G0 z5 w9 C: V! Y v
* v9 ]" W' ?7 B. l6 Z" M6 V如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:) g7 g; r( O: t
***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********
, x. m! y5 G; ?- B4 {/ K***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********/ w& ~, l3 f! O4 U9 g
8 |/ Z6 i- t# @: T/ @( B
" S/ v3 ~- J7 e0 C0 t. C* d/ f4 Vif (inv1<=ss1 and inv2>ss2 and inv3>ss3)
) u- ]. P9 r: ~% a5 Pout1=S1-inv1;& R2 u& r! G* |$ s% K
out2=0;! C* N3 \( }3 {
out3=0; /货品1需要补货/
4 [4 Y( X4 j$ K/ h) j* _, q) g! G$ @1 x! `. @- p
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)% Q* h" k0 A& j! g* a
out1=0;. Y0 n: O9 Q: y2 P p% k) a
out2=S2-inv2;
6 Y( {+ @1 o4 t3 C1 q* M1 tout3=0; /货品2需要补货// u0 B: [$ [2 U! n% Z
3 c( q# d1 p7 melse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)
- ~# ]% H6 |% v( b2 M5 r3 B5 Hout1=0;) f& j8 `; ]3 L5 i7 z ~
out2=0;
5 x: E$ }; W' H# w0 Nout3=S3-inv3; /货品3需要补货/9 A9 v/ r% V p" j9 V0 ^2 k
8 x, D1 n8 n6 e0 h' i! M1 O) T
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)4 O6 C0 p2 J- B. @% i
out1=S1-inv1;- c9 t/ L, Q/ l( a6 S, k
out2=S2-inv2;! p2 S8 U- W- R3 D" e2 I
out3=0; /货品1,2需要补货/
* p4 I0 m: v0 y9 S0 D; A9 c! c" y$ a9 c$ V
else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)
1 @& R4 s# ^: I+ ?9 F# c) Lout1=S1-inv1;
9 Q9 X- x% x8 h, {# Q4 ^( o9 h, I7 f4 eout2=0;! g; X& V! l9 I" p+ ?( k4 u+ ^1 X
out3=S3-inv3; /货品1,3需要补货/0 L- e4 j& h- K* U) X1 l+ M! J
, ~- M. \: i6 l* ?else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3), ^) ]" Y3 j( @
out1=0;
8 V6 G; G- D5 k' Xout2=S2-inv2;
9 |) R o9 x; K9 Yout3=S3-inv3; /货品2,3需要补货/
) f: U3 n: u. A% M! J3 ~) V- o; l7 J* W: i5 P
else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
) u7 V; N f) C" bout1=S1-inv1;: A' @5 @! x6 p( X1 A
out2=S2-inv2;3 O8 K( S( O* w' k' M
out3=S3-inv3; /货品1,2,3需要补货/
! A7 h- L) _+ x8 y2 z. `7 g6 U9 ~
- @/ i6 a0 S0 P7 [问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",# v' u3 M, D, c2 ~& {
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.* @7 y0 `1 u5 R9 p
! b) n D3 T6 c2 S
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?; Z6 G8 _/ I8 b- l5 ~; y5 ^
谢谢~!!!!!!! |