设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4804|回复: 0

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

  [复制链接]
发表于 2011-12-4 21:25:53 | 显示全部楼层 |阅读模式
求助高手啊~!!! 感激不尽!
7 @( a. i) C2 X: L1 K6 W7 b6 B' t$ `0 c
如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:
. t& @; {; ]& E5 M9 @/ l***********其中inv1,2,3分别表示3种货品各自的库存量,  ss1,2,3分别表示各自的安全库存 ***********
. _2 {1 ~' y8 f***********S1,2,3分别表示各自的最大库存,  out1,2,3分别为各自的补货量***********5 m4 y8 ]3 G4 r) i0 F
0 @, O6 t$ @$ ]9 N; B2 E

/ _1 a) M1 t! o" @) sif (inv1<=ss1 and inv2>ss2 and inv3>ss3)6 Y+ z* O( Q! X$ w
out1=S1-inv1;1 t) V0 K1 n5 q5 d  ~; P, M( E
out2=0;- A8 }& `& \/ Y% g$ L
out3=0; /货品1需要补货/5 c: K! _& G( b" k! ?1 |# R, f0 l

6 b8 N9 e- b/ X3 s- Eelse if (inv1>ss1 and inv2<=ss2 and inv3>ss3)7 T/ Y/ L, e' C' E+ v
out1=0;; |: d$ H0 s! o1 Q
out2=S2-inv2;6 H7 _( j, E) z# l# n% h: U+ u
out3=0; /货品2需要补货/
7 c9 G: F5 y# }9 I; L1 Y& @
. N: @( `2 y) x# J" [else if (inv1>ss1 and inv2>ss2 and inv3<=ss3)
" k5 L  l2 ]- o# {out1=0;8 s5 Y# k, I' D2 V6 p7 T& p
out2=0;
$ l/ ~$ K5 O2 o; B1 yout3=S3-inv3; /货品3需要补货/. t! C. |7 u6 \' D5 C/ f. I! K5 i8 @

1 ]( e, V) l8 J  g, t+ m; C: F5 nelse if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)
6 u* e1 z2 H9 \3 i; h& _out1=S1-inv1;  P  q1 J( U& M  p  \7 `
out2=S2-inv2;0 q& {8 u! o: Q! M# j+ ~
out3=0; /货品1,2需要补货/7 i3 E% g7 N+ Q  s0 Y5 y& I

5 Y& A/ ~( c* ]. Xelse if (inv1<=ss1 and inv2>ss2 and inv3<=ss3): Q' t6 B* z$ w9 }8 x7 n& n% V' n6 [
out1=S1-inv1;# E" _' u5 c+ N$ f1 s% `( I/ _0 G& y
out2=0;0 ^  S8 l7 M' z) d% C
out3=S3-inv3; /货品1,3需要补货// E: y, s) _: q. `* C

! Q2 L: F7 `3 t- L0 O# celse if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)2 p9 U# T* Q" Q5 K% r* ]2 ]
out1=0;
6 ^+ Z- J; T& M/ q+ bout2=S2-inv2;
8 Y6 K7 Z  h" ^* o+ c* p9 Oout3=S3-inv3; /货品2,3需要补货/  Y$ m3 H- k- {" b% {9 ?0 x- K, i
2 f1 J% z- g( W! {
else if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)$ a) L% W( I( k5 {: u6 Y0 `
out1=S1-inv1;, K$ i+ U7 ~1 u0 @) V. K
out2=S2-inv2;; w) Z& Y5 r* J8 ]
out3=S3-inv3; /货品1,2,3需要补货/
" l9 R" ^+ o2 C& ?' l5 }9 a) [
9 c+ X# z% ?$ x5 ?2 c问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",5 E# K3 M: H* Z: ]7 f
但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.9 i% s  Y7 C, B9 R  x
2 B1 M$ Y" z, R! F3 e; u. w9 I
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?5 F) m% R( L. }$ y5 W. e2 F
谢谢~!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-1-21 18:24 , Processed in 0.016431 second(s), 16 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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