求助高手啊~!!! 感激不尽!% y+ _ E3 Z1 p5 V! s! E
% Y8 r z" g( F1 l0 U6 G8 K ]
如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:% a* f0 m, z8 K$ O
***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********4 s! h* k+ ^: n' `: a( d% `
***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********! @5 b. t0 X7 h: ]& v
# b7 `4 j1 {8 l0 e* O q
# i: r! R$ K3 fif (inv1<=ss1 and inv2>ss2 and inv3>ss3)
( ^* G/ c: Q: H) y- {& ^out1=S1-inv1;
; n7 ?5 [, J9 u' Z3 w+ Cout2=0;
0 u: t/ |: j8 Y! W: B# zout3=0; /货品1需要补货/
) I' H' [% a& h5 D5 {3 F; j
: e+ N# g4 n. _; K( U9 e `4 b& Delse if (inv1>ss1 and inv2<=ss2 and inv3>ss3)
4 @5 V0 E% X: R8 |6 m& b3 rout1=0;3 ]" @ ]# s& Q1 |. w9 u
out2=S2-inv2;
1 {3 T _% F/ S2 r6 h8 v8 l7 Cout3=0; /货品2需要补货/) z3 U6 d/ s2 i1 u3 |: y+ V! ~# q. _
5 E' i/ L7 c1 ?- r& o
else if (inv1>ss1 and inv2>ss2 and inv3<=ss3)) a# Z0 e0 }& x4 [# U4 s2 u
out1=0;8 s, I8 U5 g' c0 {$ ?
out2=0;9 ~2 M; K0 [3 K H: I
out3=S3-inv3; /货品3需要补货/9 ?- T; n' ~& M
9 B' A6 N+ R% g. }" ?% felse if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)9 z0 i. Z2 h8 s/ f
out1=S1-inv1;& C1 m9 T* I/ @+ `% I
out2=S2-inv2;
# C6 M0 @5 F5 \) ~- S8 S5 ?out3=0; /货品1,2需要补货/( U2 K% i) }$ B1 b
$ I/ [0 i. L" T0 D9 j
else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)' N% k) i% o0 {' T9 z! B& P: @! R1 m
out1=S1-inv1;# M9 g Y+ B; T3 z" u
out2=0;- p E9 ~6 M7 D5 X1 s. X
out3=S3-inv3; /货品1,3需要补货/- x! z% X. S: I3 n4 {
! i- q$ Y, k: m0 K( i0 L2 f
else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3). {5 s" w6 T/ s6 y, Q
out1=0;8 [& N3 K' Y% Z1 N
out2=S2-inv2;
, G7 V# `% w+ b) u" Q2 u% e8 A# Tout3=S3-inv3; /货品2,3需要补货/) }, j: E# C9 S8 _- R9 S' `
8 v) Q6 D3 G; |: M" i" m* lelse if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
2 y6 {4 Z9 X9 [/ V7 Fout1=S1-inv1;
$ @/ c6 J" a2 d: p, U/ lout2=S2-inv2;
& |+ F: G7 m5 X8 Eout3=S3-inv3; /货品1,2,3需要补货/
: X3 i. ? K* z3 E5 h, G1 R2 {1 U- Q9 U) I
问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",6 T3 H) r/ u" }* i* e( R! S9 t
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.
/ j6 s& a+ Z# B) m0 ]6 |. a6 b3 w6 R2 y: \! G( u& |0 o: W
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?# o- ]* i/ a+ z% c0 C5 u
谢谢~!!!!!!! |