求助高手啊~!!! 感激不尽!
' g! K, o x0 n* b+ b* ?( f! P0 U5 z4 C" ~" r
如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:9 F8 z! ~/ w7 |! b' T# l
***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********& f( J) ~7 ?& M& \. r4 E( i, R
***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********5 z6 T' h" r1 q1 c: Z' I
, u& b- X9 g- z. v
7 y& Y; {$ e7 l% D0 \! }( \! jif (inv1<=ss1 and inv2>ss2 and inv3>ss3)3 K: W& d9 k; h4 ^
out1=S1-inv1;1 M! u7 w1 S, [4 K: l0 k
out2=0;
' S1 A2 @) I9 m3 \! h7 a+ kout3=0; /货品1需要补货/
. g* w% g! u! i7 D+ f8 Y( t v c/ m0 k0 U+ D( |/ i: l- @
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)& Q1 R S1 K, o
out1=0;
x8 E. |) ^) L. [8 ]+ J( vout2=S2-inv2;
& t4 J [4 a# m* p% tout3=0; /货品2需要补货/
5 B% |* D* h3 o! l; a# l3 |" _1 O3 N+ |( X. G( L
else if (inv1>ss1 and inv2>ss2 and inv3<=ss3) _7 v( K3 ?; I4 I3 G2 i9 Z
out1=0;
: X! a$ ]1 W9 @; E/ n+ ?2 `out2=0;
- }( w0 c0 w2 e/ d# ]. x* }out3=S3-inv3; /货品3需要补货/ g: D( {5 F" N
% v# r1 z1 X$ T: @else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)3 s" P2 e9 D4 G% U/ F7 Q/ j9 |
out1=S1-inv1;( m; u; C" c& T; h0 W, z: S
out2=S2-inv2;
$ w* W6 F e5 R" E9 M2 D3 Z+ zout3=0; /货品1,2需要补货/; M$ n3 Q/ [( p/ c5 U: n7 C* }, a
7 v4 v4 i7 Z) E; M
else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)
6 c# M/ Y; p3 Lout1=S1-inv1;
$ }4 |6 B# x! O9 A" i6 \$ Aout2=0;
6 s) c- O9 H4 Q, e6 Tout3=S3-inv3; /货品1,3需要补货/1 J6 A! _2 e3 |7 n( t9 M# G o; f) ]4 E
( u' D0 z: x6 U3 l! g0 ]: G3 c- @else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)$ Y0 g% [9 N& ?- ?5 O
out1=0;- `- f3 e d# h4 J \7 c/ B
out2=S2-inv2;, |* P, P, V8 k* w/ |
out3=S3-inv3; /货品2,3需要补货/% |6 P+ D) Y+ z9 c: H- S
( f: c1 p. }" }" u0 V
else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)8 @) Y9 a$ C. ^
out1=S1-inv1;
$ Z" n6 Y. C5 M+ U9 g$ d/ O' u8 x6 v2 qout2=S2-inv2;
6 }/ E6 }2 Z: h$ B& j2 d3 k* Hout3=S3-inv3; /货品1,2,3需要补货/, C9 B6 t0 F+ X/ I
4 n! b2 q( t" Y9 M7 x B问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",$ } J+ {7 i U& d0 d
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.4 _1 p9 T9 D+ o3 W' k& S
. {* ?, h! d4 r0 h* Z请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?% P' k" ~) e9 r6 z% g9 V
谢谢~!!!!!!! |