求助高手啊~!!! 感激不尽!2 m+ M6 t% k" y, q
4 C6 F& f& {: w [% t0 H如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:- v: k, b- L1 o f" D
***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********
' T" \% i% Y* G6 F2 S5 p! }***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********
5 H6 |+ V$ b5 ]7 ^- m* n' m; U O( D* A) P/ z% P$ H0 o
3 D. `3 a- B) v2 w! b) R/ {
if (inv1<=ss1 and inv2>ss2 and inv3>ss3)
, [2 h/ m" L$ n3 Oout1=S1-inv1; A5 \& l5 W+ W9 ~2 |6 o$ s
out2=0;& j2 t4 n, Z/ J: M" U5 t: f
out3=0; /货品1需要补货/
+ Y8 V$ g0 u2 G/ M: q
6 k$ {* K0 o6 ?7 ?+ q3 Kelse if (inv1>ss1 and inv2<=ss2 and inv3>ss3)
1 ~* w% N( h0 h* F5 k& fout1=0;9 w. @& `% w9 I
out2=S2-inv2;
( ]5 {( s( f8 a. ]2 Fout3=0; /货品2需要补货/
4 A2 x5 D- x$ |. F# S
0 A0 P# V& s2 helse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)
' d1 `' r3 Z- f- tout1=0;' T) K4 [ W$ ~% _7 ]$ v; J
out2=0;* f& P5 @: S+ Y7 Z' x9 c3 i
out3=S3-inv3; /货品3需要补货/$ |. S/ i. s( W4 p
\# R' D" c# _. G0 S% Z- b Pelse if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)
1 ?, j* W: n7 e# Y+ V3 wout1=S1-inv1;7 D/ c5 Z' f. @3 ^
out2=S2-inv2;
# x7 c2 Q2 r6 A) ^: t$ z: P7 ^% zout3=0; /货品1,2需要补货/3 _2 a9 x0 h; {% P( x; m) u6 I
* H; c* D; {6 s* T/ m' e3 t! g
else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3); F7 x. ^' W4 H# k0 |0 G" F; B) [
out1=S1-inv1;
' c% V3 T9 X [out2=0;9 V0 q3 c) |4 F" i! d7 c: r
out3=S3-inv3; /货品1,3需要补货/
) h+ r C5 j5 j" e! ?' b( j" N3 W( R# w4 U# P" ^/ E+ T
else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3); F- ]3 I v0 ]' g) J. I
out1=0;% s+ `% r+ v7 u. r
out2=S2-inv2;
7 D% w' p! b! N# W M: }out3=S3-inv3; /货品2,3需要补货/0 X, C2 f. b& D1 [# `/ K
7 {) y* g* }$ Q2 j# f9 Welse if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
6 h4 V# c* X6 t8 O5 g/ ?out1=S1-inv1;1 ~" o2 d. {2 C+ t6 z
out2=S2-inv2;
9 x# x* f' u' nout3=S3-inv3; /货品1,2,3需要补货/
Y' E& x$ T# U1 f* j+ }5 k7 B0 I; O0 w
问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",* f9 Y" U( o( P% K* r7 n
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.
; y2 Y6 h$ t& e; w' D6 N: h, ?2 O7 R: N% |: _4 B" I
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?
$ I0 x1 R* b7 E# Z' m1 P谢谢~!!!!!!! |