求助高手啊~!!! 感激不尽!& a d- p( A! S C2 S; L" W
8 V* Y) E7 z A, G如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:
Y4 z& r: m0 B# u( s: Q***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********8 {9 c& ~ L- a; {! w
***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********
/ `: z/ H+ e8 H. o' G
1 V& w/ e0 K' D+ {/ ~' E4 a1 Y" @* f+ h# [- d; g- [* B! z
if (inv1<=ss1 and inv2>ss2 and inv3>ss3)
8 r# X6 ^9 e; } ]# o* {9 e2 D" Qout1=S1-inv1;
" ]1 d6 n+ R' }out2=0;* @8 \7 M. f/ `+ k; l
out3=0; /货品1需要补货/
0 R. Y$ D- B9 A* t0 ]/ ]+ M
( `* ^4 u- a0 B& E- N. nelse if (inv1>ss1 and inv2<=ss2 and inv3>ss3)- h- d9 M: F$ ]. p% n3 y) w7 _! P
out1=0;( t+ I7 ~# p, A: y! x8 a s5 {) d5 C
out2=S2-inv2;! j3 e2 p0 Q* Z& M( H1 D
out3=0; /货品2需要补货/
6 K! Z; j; h& y$ l! I' y
& V- S& }5 C; ?9 Lelse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)8 a# S+ M/ E+ D* J
out1=0;2 P& |3 d) G/ R4 V7 h$ `
out2=0;
% c6 E( _4 q1 R9 x/ Qout3=S3-inv3; /货品3需要补货/( f0 k) \* y# t; g' b# S
2 r7 G6 ?7 N( L' c7 N: w m/ C$ Z
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)$ n2 J' y8 q4 { u
out1=S1-inv1;. Z, @9 o& h9 ~* U
out2=S2-inv2;
h& G" s- D- Kout3=0; /货品1,2需要补货/' w' H. `& H$ m% q" S; _ E! S5 P
o# _! K- N# ?; v( h* g4 t/ Telse if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)
0 G% L0 a$ b$ K, Mout1=S1-inv1;& K M G2 v- k2 p% r( e
out2=0;
9 u) K9 [, A7 v( h- V" s# iout3=S3-inv3; /货品1,3需要补货// u% @1 f: f ]/ x6 W, Y9 a
3 c- o( X) z! m6 w0 s+ eelse if (inv1>ss1 and inv2<=ss2 and inv3<=ss3): u% R( B2 @; d0 C# ^/ l* ~# N
out1=0;
- @1 P% |- h0 Zout2=S2-inv2;
* o; F% K+ b) _2 [% s. t, F: ~out3=S3-inv3; /货品2,3需要补货/5 q# m$ \- r6 ~/ P L% w7 l, N
: Q8 H( [* Z, l$ V
else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)" S9 g& r/ i2 n ~, I
out1=S1-inv1;9 Y9 l% w# c9 I' _ L. X' @6 b, p
out2=S2-inv2;
. l5 b2 j7 Y0 | \) [out3=S3-inv3; /货品1,2,3需要补货/
0 q: m0 Z% w5 O: w w+ f, h& |8 A
6 n* z, S, [' {问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",/ \: S& t. q/ v6 ^/ r0 A1 _( Y4 q
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.5 n d( V/ h3 I$ X2 y5 i
; d) ^* S% Z/ R4 M
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?
o# i' |% G4 Q谢谢~!!!!!!! |