设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3929|回复: 0

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

  [复制链接]
发表于 2011-12-4 21:25:53 | 显示全部楼层 |阅读模式
求助高手啊~!!! 感激不尽!
7 w. ~4 n& H8 r" e0 M5 N5 p6 Y3 R( q
如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:9 C+ Q) @2 ^4 s, V, c
***********其中inv1,2,3分别表示3种货品各自的库存量,  ss1,2,3分别表示各自的安全库存 ***********
2 m; g1 `: Z5 V7 L***********S1,2,3分别表示各自的最大库存,  out1,2,3分别为各自的补货量***********
& h, ]. I: J3 C
, m- _+ g" [4 x. L. |8 t
8 \. M3 x: K4 m9 y$ ]3 Wif (inv1<=ss1 and inv2>ss2 and inv3>ss3)/ d4 R, I" g5 V* E# n
out1=S1-inv1;
4 Y2 O4 ^. R2 I, V  I- \out2=0;
( Z. n0 y0 R7 p% O5 R7 oout3=0; /货品1需要补货/
, r( V: X# l5 \0 q. M- y
9 P( c$ z" A' \& @else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)
# I4 i/ P, P8 R' n# v% M+ xout1=0;
. a+ ?. D$ g$ Eout2=S2-inv2;
# |, N0 Y: Q: `! Q. B2 J2 M6 Aout3=0; /货品2需要补货/' a( @3 n+ f5 O2 {
% q- @# P( B9 _) Z- p
else if (inv1>ss1 and inv2>ss2 and inv3<=ss3)* C+ Y; n1 C: X. f9 F; l  f; ?
out1=0;2 B9 w4 p% @8 ~) ~, I
out2=0;" Q" P5 r& K* c9 j0 ^$ K
out3=S3-inv3; /货品3需要补货/0 g: ^$ m+ n- N( l: m6 a
3 J% J. D3 K" i
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)
. R  ~+ i; g% Cout1=S1-inv1;& G+ M3 m9 {5 ]9 h) O
out2=S2-inv2;
; e& |$ K  s% @8 E; i1 oout3=0; /货品1,2需要补货/' v& o& p; h% i6 n# H, B

6 a6 u9 s: _; N5 Q6 oelse if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)
: o2 D4 m/ `+ o7 @! K2 mout1=S1-inv1;4 ?- @5 ]+ w/ B6 M- n, \0 \
out2=0;, T: ]- y0 M6 k7 u9 o" V
out3=S3-inv3; /货品1,3需要补货// c5 x9 U& U  y6 Q0 k$ t) d

% N, @: u( }* T- jelse if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)
& N! s+ K/ S9 I; B5 {0 I9 p! e: fout1=0;: ?* [& C7 ?" n% ^9 }( j8 ?
out2=S2-inv2;7 G9 r, f- H6 @( C
out3=S3-inv3; /货品2,3需要补货/
9 v$ n; O6 u8 H# _* y1 f* y, k. D% {8 R5 ]" p9 j
else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
! T$ c# L0 b5 z; Cout1=S1-inv1;
7 d  L, L" s9 ?# I$ lout2=S2-inv2;
0 l6 i. u. I" [& b# @: |5 Pout3=S3-inv3; /货品1,2,3需要补货/
4 s3 Z9 R2 E) M  ?* j4 a
- j. k+ n+ ]% y问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",; f7 W0 \: u% d/ F0 S( }
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.8 J" y  {7 T( G
5 J( V5 y/ K/ M9 B
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?
  d) `) L* O2 t9 p谢谢~!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-17 07:40 , Processed in 0.020452 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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