本帖最后由 zorsite 于 2016-4-7 11:54 编辑 , w* k/ h! K% {, L* G3 _8 p% {
* B6 k, { q5 e% N. w6 U* v
模型中有四个实体:' u6 @, v+ m" U, J/ J4 v
发生器,处理器,暂存区,独立暂存区。
* @' A4 B/ _* d( S1 j/ t发生器,处理器,暂存区依次A连接。
8 d2 \ v. ]# N# S独立暂存区不与任何实体相连。( f; j; S- F g7 w4 r# p
{0 z! Q, t7 D+ u# M% g7 N
发生器中产生两种类型的临时实体,* s; W5 N% T: X1 U; |( _
第一种临时实体加工后传送到暂存区,
% |- z: O; g: a/ U' L a [. I. T第二种临时实体加工后“移动”到独立暂存区。* \ G3 I" t& E! @" I
0 Y) L$ T) v i$ \$ \4 \) r发生器中创建触发中代码如下:1 _! a. d6 N! b4 S7 H/ N. G, g0 r
setitemtype(item,duniform(1,2)); $ M* G& h- B9 F _' s) D
colorarray(item,getitemtype(item));# ]# h% L, N. @- O& D! ^
+ Y7 F" d; K. Z1 z' c/ ]
处理器的“加工结束触发”中加入以下代码:
7 R3 ]1 Q) M/ @( I* ]( {if (getitemtype(item)==2) moveobject(item,node("独立暂存区", model()));
) }1 v# y3 {5 d' J# V% X- ^- f+ T0 {) g/ h5 p0 r; z& M2 y
各种触发器触发时间的先后顺序为:
k2 x( m. Q8 n r: f$ F1 f重置触发à进入触发à预置结束触发à加工结束触发à发送至端口à使用运输工具à离开触发
- B" v T" d/ [: t1 j. N加工结束触发在发送至端口触发之前,5 G" }7 z2 O# [9 G: ]0 M% }' O0 T/ O4 z! b
理论上来讲,第二种临时实体加工完成后先应该先被移动到独立暂存区。
6 w# f0 O; z4 Y9 ^& B! R. K& ~' o; v5 ]: B1 v) R# F
可是模型运行起来并不是这样子,所有的临时实体全部堆积在暂存区。
0 L. J) ~+ d4 D p' B" I( F( o没有任何临时实体进入“独立暂存区”。
( |; K0 m* Z" J2 J请问问题出在哪里?
/ N% u }+ O5 u1 h" R
7 x3 ]% c! D1 T* k; m' ]2 f% `4 D2 Lmoveobject (obj object, obj location[, num outport])
" x* R* f4 m. b$ cMoves object to the specified location
) S6 L; B# _* b' U2 p移动对象到指定位置。2 Q* ?- k. ]0 v) E: \- P
Description/ W2 I+ x2 h1 [' c3 d
This command moves the object to the specified location through the specified port. 5 j+ Z7 [7 |# W
可以指定从哪个端口输出。7 t& ~; T0 N6 V9 B! C0 _5 @0 l
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.
+ W/ A+ z& ~8 u4 a这个端口并不一定要真正存在,主要是为了告诉接收方对象是通过哪个端口进入的。
1 @+ X- T! V9 q# [' T: h" m* A" ZWhen an object moves into location, the OnReceive event function of location is executed.
/ `4 a5 D* w5 D @0 l( M) |当对象移动到指定位置时,将激活(执行)接收方的“接收触发”事件。(什么实体会有接收触发?)
, \9 G2 L, O" U* O& e+ lThis includes the OnEntry trigger function.
6 f) q1 N- b8 K+ w这包括“进入触发”。(什么意思?接收方的进入触发吗?这句话有什么含义?)
- D6 S1 ?5 l3 R+ q* CExplicitly calling this on a flowitem with events queued up for it may cause problems.
2 i0 _& N/ t* }; h! }3 L如果临时实体有事件要执行时使用这个命令将会引发不可预知的错误。: J3 f: i3 S. |5 J% z; \
Only use when you know that no events are pending for the object being moved.
( O3 Z9 v0 X7 y$ ]- A' W8 [只有被移动的对象没有任何事件要执行的时候才能使用这个命令。
+ Q8 t8 ^$ K1 j. L$ q |