|
最近在学习flexsim的时候,记录一些心得。
5 e3 `" _9 d9 p: z8 \ c模型描述:小车上有一个装有许多item的托盘,使用一个简单的协作任务序列:要求搬运员将这些item 移动到Queue1 中, 最后将 pallet 移动到Queue2
( D, F4 N) `( d+ ~* _1 s0 P9 P7 B8 I5 B0 l8 |! n
>>>>>>content()命令在一次触发中出现多次, <<<<<<<9 J, K4 Z5 I! ^. t* v% L
6 W( P- u) l. a3 ~关键代码如下:
' E; }1 p/ Y& E8 \0 L9 Pint contn = 0; //记录搬运次数% K3 o, b& w0 p' Z
for( i =1 ; i<=content(pallet) ; i++ )
) L# c5 D* d. ?+ p{ let op load the item from pallet , and put it on queue1 //op = operator y. G; M% s I! `7 O
contn = 1 + contn ;
6 }5 f$ q2 w% g) A }
1 r8 p y& C/ U, Q. ]7 Z" ~if ( contn == content (pallet ) )4 B) O0 w- O; B4 G! z
{ let op load the pallet from car , and put it on queue2 //car
B- C# {, x( F}
( P( F+ t) B; z7 o5 `; d
5 x% @* q( y" t3 N N9 w9 x2 q- I这段代码中,content(pallet)的值在for()中和在if()中是相等的吗?
' e( D+ \ b# U4 U o请大家一起讨论! |
|