本帖最后由 zorsite 于 2016-4-7 11:54 编辑 + U' c f3 a9 ~
& @$ g, h8 L& |! v模型中有四个实体:1 f- L" h" V7 L# j+ ?
发生器,处理器,暂存区,独立暂存区。+ \( J( t e4 g
发生器,处理器,暂存区依次A连接。
l) a% |4 w, c( E# l1 n独立暂存区不与任何实体相连。" @- I; n# z5 I. H' Z% z# w) v
4 c& p* K( e, z' |" W/ [发生器中产生两种类型的临时实体,. c3 ^& M+ R6 ~# r1 U
第一种临时实体加工后传送到暂存区,
' c* P9 B3 F% w3 k5 V1 B: x7 k第二种临时实体加工后“移动”到独立暂存区。! |4 x+ K( r; S6 s
' B* K0 P" U" m- _
发生器中创建触发中代码如下:3 J, C9 C/ N( ?/ D
setitemtype(item,duniform(1,2));
" W5 O; }' _( D( n( E! qcolorarray(item,getitemtype(item));
: l& T% |% @1 V. X& _6 ^
9 L) \! \3 ]/ b0 E处理器的“加工结束触发”中加入以下代码:
7 }# N! v5 H: l) ~9 m6 Z# C2 H4 H. Rif (getitemtype(item)==2) moveobject(item,node("独立暂存区", model()));
( `! F0 [' s# o1 O7 A8 T! C9 f+ b
各种触发器触发时间的先后顺序为:
' \" ~! h! G' T- L' _ V Y重置触发à进入触发à预置结束触发à加工结束触发à发送至端口à使用运输工具à离开触发4 O: y& o3 k4 f: {+ }& r) A
加工结束触发在发送至端口触发之前,' U, |0 Q6 R9 f* x0 s5 t) l. D$ w
理论上来讲,第二种临时实体加工完成后先应该先被移动到独立暂存区。
: n. Q& [; ^1 y
: h3 i, U& ^0 [) v( ]2 W( ^) b可是模型运行起来并不是这样子,所有的临时实体全部堆积在暂存区。
2 B: |5 R# N9 M# Y没有任何临时实体进入“独立暂存区”。! S0 h5 g/ d& g, \ d1 j# b! z7 i
请问问题出在哪里?+ [( m2 u: y7 U& m1 b5 y
' t8 Y$ p7 Z% O
moveobject (obj object, obj location[, num outport])9 }1 ^+ D: y5 V
Moves object to the specified location& e7 |( T3 v3 W5 W% y1 j
移动对象到指定位置。/ M8 h5 v3 p# k+ k
Description k9 X# ~5 _& R; F% f' i8 D4 Z
This command moves the object to the specified location through the specified port. - q, k; L" o& @. C
可以指定从哪个端口输出。
- s& s0 e+ d7 oThe 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.
/ k2 {. h- |( D/ c9 e% _这个端口并不一定要真正存在,主要是为了告诉接收方对象是通过哪个端口进入的。
9 K: J3 I/ y0 S- }6 z& NWhen an object moves into location, the OnReceive event function of location is executed. 2 {. p( S7 d8 V; p% X2 p9 g2 r
当对象移动到指定位置时,将激活(执行)接收方的“接收触发”事件。(什么实体会有接收触发?), U3 n0 L7 [. Y; b/ W2 ]) o
This includes the OnEntry trigger function. $ L! J$ O. W. [
这包括“进入触发”。(什么意思?接收方的进入触发吗?这句话有什么含义?)
?0 \. D) j# C5 W0 [: qExplicitly calling this on a flowitem with events queued up for it may cause problems.
C, c7 M, n4 o4 E) J如果临时实体有事件要执行时使用这个命令将会引发不可预知的错误。
/ l \% I9 q) A* E4 E6 _' O5 YOnly use when you know that no events are pending for the object being moved.
4 p. @7 }- y" r( m' I: j0 @只有被移动的对象没有任何事件要执行的时候才能使用这个命令。
8 J& y" D" z* `; V: m |