求助高手啊~!!! 感激不尽!/ W# Z: o+ E6 |; Q
6 Y. T3 ^7 _ ?% d1 I) O3 x
如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:. i; x! X4 ?+ k0 u1 x/ M. ~
***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********) O: Y& s: ]8 j: \) S8 }& i
***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********/ M; t) p, b; w1 r2 X7 c( J& [2 d
; b; K; H9 I/ g- P8 X0 ^/ T& l. P ^$ o
if (inv1<=ss1 and inv2>ss2 and inv3>ss3)" d. } d7 o2 g- S
out1=S1-inv1;% u3 q$ {* u* f; s9 W9 C. _% s
out2=0;( r( t2 |8 r0 v6 R
out3=0; /货品1需要补货/
7 x A7 C+ ^' y7 D* M, Z2 O+ m. \$ e7 J& X9 {
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)- P" l6 E+ [# n! ~: m: Y
out1=0;
" k) W7 g& O h7 |1 f/ M. L+ f, wout2=S2-inv2;: i7 O8 {' Z3 } v+ Z* V
out3=0; /货品2需要补货/& q9 Q3 o9 g5 C q- a4 L% ~$ K
- m% J: k# Z ]7 l5 lelse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)
0 w6 P# ]8 W/ ^# ]out1=0;
5 }. i0 O5 _, d/ T Jout2=0;
3 f4 X4 f- f0 @out3=S3-inv3; /货品3需要补货/
3 s! z( M3 A7 J& ~* V# J" l* q/ o$ D& v( w7 ~, }
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)
; K6 L; z0 O* y* G5 Y7 i; Cout1=S1-inv1;
8 H3 l1 m2 C4 _out2=S2-inv2;
: J% ]( @" ?4 u# Vout3=0; /货品1,2需要补货/
6 x; m3 d1 u+ s+ A' ~/ P$ E! [9 K8 Q" z" `, j7 t9 R& x6 z
else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)
* T' h/ P4 r3 `5 n- b- H( ~out1=S1-inv1; t# h9 r8 Z% F9 l4 ?$ p: G
out2=0;3 m0 r* x5 Q6 W3 h! ~" O/ |' _/ |+ E
out3=S3-inv3; /货品1,3需要补货/
i9 r$ G9 [( w0 U: d$ ~
+ ], a1 _( B% R/ l& telse if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)
6 ^, H" b5 \. dout1=0;
2 f- W, C; a- R4 ?: Z7 yout2=S2-inv2;
# _0 l0 l4 w1 h# Z9 @) F) G8 `out3=S3-inv3; /货品2,3需要补货/
" V3 R5 s6 Z+ @4 g% u
6 P+ l7 c! T; h, J. b! h) U: M) felse if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
" c5 Y* E& N* H% O& bout1=S1-inv1;
2 I6 T0 v b4 y; L4 I, b* ^out2=S2-inv2;' c' s' f6 K, H! S1 i
out3=S3-inv3; /货品1,2,3需要补货/
: Z4 a* U! B ?3 x6 P7 V3 k! }
9 L9 S* V, s* X5 b问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",3 m( h' f; ^; @2 I0 Z0 G
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.# n/ d* U) g9 N. s% _
+ F6 {5 Z8 r4 _$ k v3 {请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?" H3 ]8 i; M: g/ e- M6 k. U- y
谢谢~!!!!!!! |