本帖最后由 zorsite 于 2016-4-7 11:54 编辑
: j/ w0 y9 z; h/ C" x
: v+ W! V7 r* ]3 T9 t模型中有四个实体:1 I( q; ?8 c' u& ?
发生器,处理器,暂存区,独立暂存区。
. J* D9 c) _$ v发生器,处理器,暂存区依次A连接。
& A" `" Y4 _0 }独立暂存区不与任何实体相连。
2 S4 a* n4 X* D5 E5 _
( L& `% a1 k9 m9 o) f9 U; C q发生器中产生两种类型的临时实体,
7 g( _* |$ A+ e; \- m( w) l: ]第一种临时实体加工后传送到暂存区,
# t$ t+ [3 e( S9 n0 Z+ f n第二种临时实体加工后“移动”到独立暂存区。
9 e0 Z: x4 L7 P" d/ C
# o+ u* p: Y6 J# j# s/ T m发生器中创建触发中代码如下:
( {2 m, F! v% L+ e2 A. V5 V( Esetitemtype(item,duniform(1,2)); . ]$ V+ x: v3 a+ ~1 Z+ g8 x% `
colorarray(item,getitemtype(item));
: O' Z3 o' H; X+ j" H4 f: o3 Y! [. }, M9 V9 c8 s
处理器的“加工结束触发”中加入以下代码:
6 n/ U$ P6 b6 v5 d2 f# o* S2 l6 X1 bif (getitemtype(item)==2) moveobject(item,node("独立暂存区", model()));
6 f: {' V6 I/ y$ ~9 S* Z+ `/ M, E; x8 l3 L$ o0 Z
各种触发器触发时间的先后顺序为:. T5 s4 ^% ]4 \" J# z
重置触发à进入触发à预置结束触发à加工结束触发à发送至端口à使用运输工具à离开触发0 @6 m% t* ?- _9 O% @
加工结束触发在发送至端口触发之前,7 z, W+ X% w G
理论上来讲,第二种临时实体加工完成后先应该先被移动到独立暂存区。
) U3 {& M- W- F# {$ | a5 ~9 H$ Q7 ]* R' I) m y
可是模型运行起来并不是这样子,所有的临时实体全部堆积在暂存区。* y" C2 @5 S/ u5 O6 V
没有任何临时实体进入“独立暂存区”。
0 W8 o f3 v B/ ?* a- I, h; e请问问题出在哪里?3 a7 A( J5 p( [1 V
2 V% j w* Y6 i p, j9 V& Smoveobject (obj object, obj location[, num outport])
4 @0 ^% |, p1 W2 UMoves object to the specified location
& h. a4 G/ }4 z: \4 d% B移动对象到指定位置。
( L# d# q! c X* i9 WDescription
/ s! k" |0 f5 K kThis command moves the object to the specified location through the specified port.
! H: q9 e0 X' R- D可以指定从哪个端口输出。
. W* f; U* I9 L, E7 f, a: e7 L6 [The specified port does not have to actually exist, this value is used by the receiving location to be able to reference the port the object came in through. C, a8 ^' n/ @" V! R
这个端口并不一定要真正存在,主要是为了告诉接收方对象是通过哪个端口进入的。5 |* j0 T/ _* D) z9 A
When an object moves into location, the OnReceive event function of location is executed. 2 y1 q( v* J3 O% d2 J
当对象移动到指定位置时,将激活(执行)接收方的“接收触发”事件。(什么实体会有接收触发?): D3 x6 i! J; t5 k
This includes the OnEntry trigger function. 2 o1 @( b! d+ R2 {, R* {
这包括“进入触发”。(什么意思?接收方的进入触发吗?这句话有什么含义?)
( f0 J7 T7 R. @# x9 }; O! RExplicitly calling this on a flowitem with events queued up for it may cause problems.
+ I( Y8 n5 {3 i) X如果临时实体有事件要执行时使用这个命令将会引发不可预知的错误。0 L8 e, \# |5 {
Only use when you know that no events are pending for the object being moved.2 u" a4 ]% z" J. M8 s
只有被移动的对象没有任何事件要执行的时候才能使用这个命令。; `& O. U3 ` o9 y% i. a
|