求助高手啊~!!! 感激不尽!
% @& j4 @% F, m+ ?# k5 w
- Q4 N% w1 j# R4 t& a如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:
4 x1 c) D; T# z: S, d***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********
# C2 Y( r4 b4 o/ G1 v1 C9 l& c2 h***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********! X1 u8 r& m) h0 F9 | j/ C, N* L! C
5 n# u% @; r- o9 G( }
6 j& a8 D. P* J8 \) iif (inv1<=ss1 and inv2>ss2 and inv3>ss3)/ i; |" R" {8 Y* E
out1=S1-inv1;
" X! }" a( @ R9 [* xout2=0;
) x( ~; d4 d- B8 V( B& Rout3=0; /货品1需要补货/
# a. V/ Z# Q# b0 ?4 |+ x0 N
: A4 H% i2 Q7 {- }2 yelse if (inv1>ss1 and inv2<=ss2 and inv3>ss3)) }& Q! \! l: Y4 s
out1=0;6 p4 n: i, [- M F8 T
out2=S2-inv2;- [: k+ }8 V7 g8 c
out3=0; /货品2需要补货/
7 G+ i7 |& o) |1 l4 c& |
' o# | m5 c: i4 X2 pelse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)1 b% o3 B @0 w7 `% H
out1=0;: C5 X- `3 Z/ c$ U
out2=0;" k9 C2 p8 x4 f& G
out3=S3-inv3; /货品3需要补货/
6 N+ t) Z# `' C( g4 _7 b3 ^* Y3 E
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)
% x4 E. N) O3 n0 D& v8 S9 P0 H! t( fout1=S1-inv1; t( N9 w' J. s1 U0 A$ _
out2=S2-inv2;% U4 y# d x! \3 N
out3=0; /货品1,2需要补货/" k/ m0 o0 t" p% @- u6 O' C4 m
, [7 J, z6 U- P2 t4 w: ]else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)3 g! ?5 s, `- ]( r# j
out1=S1-inv1;+ L& H5 W' r6 t# x7 E% t
out2=0; e) ~! g2 o% R4 L3 b4 ~% a8 X
out3=S3-inv3; /货品1,3需要补货/ d; c: C8 o2 e4 U& c& f
& Z7 ^9 I7 q O, m
else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)
9 e' ?9 ?: Y9 C5 T- o* rout1=0;
: @& z. e9 f% Q, ^! [out2=S2-inv2;! u3 ]( U# l7 N$ y! Q. Y5 ~" K
out3=S3-inv3; /货品2,3需要补货/
/ E# g9 `' F0 j2 c# c f! q! e/ j8 ]6 x7 d* @9 I) U% N
else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)" y. b- V0 y; O2 E
out1=S1-inv1;2 n7 P! P: K/ _% W
out2=S2-inv2;! m- G4 A ~+ _* k: R; j
out3=S3-inv3; /货品1,2,3需要补货/( T+ r) S. W0 I+ {8 _) K
, X" Q+ K* W6 u
问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",+ a/ G& w( @# V+ S* M
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.) l: ^* D. a, g. s) G1 u; F
8 L+ t7 `- S; d4 E0 _/ Z请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?& t# k& }5 N) ^$ \. P' S
谢谢~!!!!!!! |