本帖最后由 zorsite 于 2016-4-7 11:54 编辑 5 m, V9 [% ]5 N; M
" ^3 l: c; p# J) p, M
模型中有四个实体:1 b1 _8 j* q+ O+ t
发生器,处理器,暂存区,独立暂存区。
- \3 ~2 |! I6 H y2 Z发生器,处理器,暂存区依次A连接。
. ^9 {% j$ @- _( B& R+ g独立暂存区不与任何实体相连。8 A( q2 `9 X0 G9 p: K
8 Z$ q, r# @3 `" h5 Q+ b
发生器中产生两种类型的临时实体,/ Z; ]' h4 Y# }( v9 ?3 P
第一种临时实体加工后传送到暂存区," Z+ \+ t! L" X- @4 ~% ]% c
第二种临时实体加工后“移动”到独立暂存区。 J/ @6 |9 d- G6 S4 u! I
# _8 f5 | k. f( ^4 i/ C' o3 F, {发生器中创建触发中代码如下:; G3 R$ c# \; ?! Q/ a0 t
setitemtype(item,duniform(1,2)); ! c, w; D) g; J P8 l& G' w* y
colorarray(item,getitemtype(item));/ Q2 `8 N8 v5 F. e0 J N8 K
& m( j, t b: P, {0 r4 z处理器的“加工结束触发”中加入以下代码:
: F9 e! q4 X6 S+ r: ?* O9 I ~if (getitemtype(item)==2) moveobject(item,node("独立暂存区", model()));" g+ C; E n1 T4 H( F3 w" Z' y
, O$ q4 i0 ~8 O2 c
各种触发器触发时间的先后顺序为:
5 h0 d4 Y) a1 U) t重置触发à进入触发à预置结束触发à加工结束触发à发送至端口à使用运输工具à离开触发3 O7 B u7 R0 {1 G
加工结束触发在发送至端口触发之前,
A3 c8 f0 F. \- d7 M" o: s理论上来讲,第二种临时实体加工完成后先应该先被移动到独立暂存区。
$ @- l; }. b8 J) v" T- e F$ P
4 K q1 K6 D+ t可是模型运行起来并不是这样子,所有的临时实体全部堆积在暂存区。0 A t9 ?" M- I& n5 C N
没有任何临时实体进入“独立暂存区”。* l. N! q& v. `: J( q/ P$ a# p
请问问题出在哪里?
8 m) U) P2 f! f8 r! \1 K7 U0 E" u
, q7 y" `% }- _0 cmoveobject (obj object, obj location[, num outport])
8 ], U. v: k1 g: o8 ~Moves object to the specified location
' U x4 `7 H3 u! {. S# G1 F移动对象到指定位置。
- s, I5 R9 O2 ?7 v) A" yDescription4 ^- [/ z2 h5 s
This command moves the object to the specified location through the specified port.
( [4 d4 @3 ^/ G% o" r可以指定从哪个端口输出。
1 v- F' a4 Q$ n4 F PThe 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. 2 h f+ F. `* g* V
这个端口并不一定要真正存在,主要是为了告诉接收方对象是通过哪个端口进入的。
/ [9 D" a) W8 I. P9 ZWhen an object moves into location, the OnReceive event function of location is executed. / R' O7 g4 T9 }
当对象移动到指定位置时,将激活(执行)接收方的“接收触发”事件。(什么实体会有接收触发?)# n* w7 p: i: L$ Y/ V
This includes the OnEntry trigger function.
~3 F9 k. ~" C; s这包括“进入触发”。(什么意思?接收方的进入触发吗?这句话有什么含义?)4 m2 t) K2 u7 l4 Q, |$ z
Explicitly calling this on a flowitem with events queued up for it may cause problems. % N7 ~) M: P/ d6 w
如果临时实体有事件要执行时使用这个命令将会引发不可预知的错误。1 _2 @2 \' _. R- S; F; Q
Only use when you know that no events are pending for the object being moved.
# w, z4 i2 o$ w! P& H只有被移动的对象没有任何事件要执行的时候才能使用这个命令。2 R! y5 d) ?& ~1 G. W; [
|