设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5160|回复: 0

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

  [复制链接]
发表于 2011-12-4 21:25:53 | 显示全部楼层 |阅读模式
求助高手啊~!!! 感激不尽!- K* g( \) J; R, d* i/ {  l2 a

# a  r8 t( h" |. w如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:
' N4 ~2 l% I  ]$ P***********其中inv1,2,3分别表示3种货品各自的库存量,  ss1,2,3分别表示各自的安全库存 ***********4 L$ i( Y8 `+ o3 g# [
***********S1,2,3分别表示各自的最大库存,  out1,2,3分别为各自的补货量***********6 ?. c) Q% w$ |% L! @
% q: ~* _. H3 ]  F% C
3 S: T4 B  ~* l3 q
if (inv1<=ss1 and inv2>ss2 and inv3>ss3)" G8 b7 p. h1 q
out1=S1-inv1;) t* B/ ~: i$ @2 }( ]& U6 w
out2=0;
' u1 a2 F  I$ @& W. d$ `& ^out3=0; /货品1需要补货/
! J$ s: A* {7 q3 S' i+ D; U4 t: z& E+ Z6 t6 C
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)
/ A- `5 {: I" u$ E8 K: Z- iout1=0;
3 e4 }6 w% T# E& fout2=S2-inv2;
) R: [' k" ]' _1 {! _2 yout3=0; /货品2需要补货/
& X, c" z* \, Z5 b3 ]: h/ o# ^$ x/ o2 C' ]% v$ w5 E8 m9 h
else if (inv1>ss1 and inv2>ss2 and inv3<=ss3)% c: U$ U% n! @7 i7 w, ~
out1=0;
2 F& _0 c8 W3 ?/ Gout2=0;- H2 u" o2 ?7 }3 O* m
out3=S3-inv3; /货品3需要补货/
5 d  Y* ^7 S; c/ e9 Y! V+ M+ D7 y. f9 U* r, ]5 E; r# z7 w
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)8 ]5 A' c: V! V% @4 z
out1=S1-inv1;( v) A# s2 d  A
out2=S2-inv2;
; H; J3 S; i  e! Iout3=0; /货品1,2需要补货/
2 Y& L5 S1 P0 S: B8 B/ ~% T! K  j) `- d' Y( c1 k
else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)
; p" o6 ]8 o# P5 Y+ Bout1=S1-inv1;2 t1 E3 P  A" F* Q/ _- Z
out2=0;
6 F# ^  I# l0 A! M/ wout3=S3-inv3; /货品1,3需要补货/! l1 {, n7 j# q
% }/ |( b8 B, `0 K4 I% C- N! }
else if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)
9 |4 U' [0 S& W0 t1 L" t- Y9 Wout1=0;
4 r- {: E+ N! I% a. U" |out2=S2-inv2;
' H8 e" b+ G) S6 n. X, {out3=S3-inv3; /货品2,3需要补货/4 m3 x0 P6 G- d7 }& B' y% v

' a+ O$ T- D/ M, Delse if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)& z- C" {: n8 E; ^7 Y
out1=S1-inv1;) b& h0 d$ A' ^  V2 u
out2=S2-inv2;
5 w- J  H( G2 f' R6 a2 Oout3=S3-inv3; /货品1,2,3需要补货/9 H1 n: n1 q" z
6 t/ W! ~& D% J+ n/ N
问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",
8 h; l9 l. V% N& g. f0 Z/ P但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果./ V/ B2 d$ W. g7 W1 A2 h
' U; u. s5 p- j
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?9 ~/ c' O! Q9 d; K0 f$ E* ?: g8 O
谢谢~!!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-4-2 19:02 , Processed in 0.015464 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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