设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6037|回复: 0

[求助] 【求助! Equation公式】关于多品类补货的公式编写

  [复制链接]
发表于 2011-12-4 21:25:53 | 显示全部楼层 |阅读模式
求助高手啊~!!! 感激不尽!  i. d( o; `- q+ e# H& r( a

4 p# M- f& T/ t, J3 x2 u如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:" z& h' t5 z3 F
***********其中inv1,2,3分别表示3种货品各自的库存量,  ss1,2,3分别表示各自的安全库存 ***********
" R$ P; \. v0 o! _/ }* [8 u***********S1,2,3分别表示各自的最大库存,  out1,2,3分别为各自的补货量***********; U5 }* q# K% N3 r! _7 }5 |/ d7 T

4 K7 f, _3 z( l- R8 K  ?
, [, y6 a2 d; o. Hif (inv1<=ss1 and inv2>ss2 and inv3>ss3)
: G' S( c7 B8 |' i+ q% t7 r! Dout1=S1-inv1;
6 ?0 i6 \" n7 C  o# Jout2=0;. m1 k; Z' ~  b6 I7 x  @: l
out3=0; /货品1需要补货/' |6 B/ b& {/ o# O) e. g# l$ {
1 Z: c2 e' k  b' B% K- {
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)
% m& n/ Y* \' e( ^0 O* |0 E& |out1=0;* B3 L% g! R2 L3 x
out2=S2-inv2;
- [& ]! e$ o& V. m! l1 i) A( X, gout3=0; /货品2需要补货/4 |% [$ r0 n! O! }

7 J4 ]: V0 o# K9 |# belse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)
/ p6 f' q$ h! dout1=0;
. {9 J9 t- J/ f$ c3 I: qout2=0;2 c  r0 R5 a  r& m( Q
out3=S3-inv3; /货品3需要补货/
9 b( }- c/ l+ y9 q
6 @$ D" @7 J% K% m" I6 eelse if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)' a$ Z- ?" O2 h
out1=S1-inv1;: a+ C/ q# m) S) W$ E; @
out2=S2-inv2;$ n4 }5 f' L4 X, R3 q/ e) C$ R, I
out3=0; /货品1,2需要补货/
; j  g6 `( s- C6 r6 D, s
; q( L% m9 O) C2 b6 yelse if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)7 Q* {# G0 W) H9 X
out1=S1-inv1;& J& {# s" y: P- q
out2=0;: d1 y$ l/ _( u2 \0 J, O' I2 H
out3=S3-inv3; /货品1,3需要补货/
* n9 Y8 L, N% A, V, r0 n  i% ?6 B) k
else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)
" h/ h- ^! Y$ J. }out1=0;
" n7 ~& [9 E$ q  d* _" Eout2=S2-inv2;
% q; A* G6 E' u& P* Z( b4 i3 pout3=S3-inv3; /货品2,3需要补货/
7 ~# z5 A9 x0 ]  h  {; ]" s) S0 q, b6 L8 ^! g
else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
: ?, D) C* ]6 {; a$ @, J' g) j5 Gout1=S1-inv1;7 l; O' t/ u! F( z- B, c
out2=S2-inv2;
$ B: }# }; l( o& dout3=S3-inv3; /货品1,2,3需要补货/
0 ^% B" L- g: E  l
& Y( [) x9 ?0 j& h问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",3 n. `; c: ^* I- e# f
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.
& e& R$ Y! s; Y# G9 b
0 i7 y$ r* R2 k2 Q+ Q请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?
! ]& W- q2 R; [& c: s5 t# G谢谢~!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-8-10 08:39 , Processed in 0.017614 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表