本帖最后由 zorsite 于 2016-4-7 11:54 编辑 : u2 ?# c6 t4 h% E7 K7 r; w* m4 R- P0 v
! ^- W& B; \8 ^9 X& ] ?+ X模型中有四个实体:
: p4 }% a& j, z- f# R- a发生器,处理器,暂存区,独立暂存区。
& J: L3 t2 C$ O. y, V发生器,处理器,暂存区依次A连接。
O1 _( j5 P7 W2 v# ^6 ]独立暂存区不与任何实体相连。$ d. H+ ?3 T( Q3 K! T
6 y5 R9 _/ k/ g! N发生器中产生两种类型的临时实体,
4 B5 Z, W5 R, `9 w4 W7 S第一种临时实体加工后传送到暂存区,
- J5 o; b" J$ P6 b- ~! K6 ^0 R第二种临时实体加工后“移动”到独立暂存区。! N2 T' c* i) E$ }' |3 y9 d4 k
. o3 {# F8 b/ d
发生器中创建触发中代码如下:8 V; U* i$ C4 U8 f
setitemtype(item,duniform(1,2));
# T, M% i2 T% V. |5 H. ?colorarray(item,getitemtype(item));
& \. A+ A! V3 ^ l( U
& ?; ~$ n( p0 ]/ V处理器的“加工结束触发”中加入以下代码:
: v& A, D* _6 p* D6 e: |if (getitemtype(item)==2) moveobject(item,node("独立暂存区", model()));
: B& O; x5 ~" O ]
7 c9 g! q7 P* C' K% Y7 A各种触发器触发时间的先后顺序为:/ L. F. Y0 m9 N. ]' J. f
重置触发à进入触发à预置结束触发à加工结束触发à发送至端口à使用运输工具à离开触发
B3 M7 D' V" J2 B X加工结束触发在发送至端口触发之前,
& N1 H: h c# u7 r3 C5 I) v: R理论上来讲,第二种临时实体加工完成后先应该先被移动到独立暂存区。
2 w) Z& m, P9 Q- l! X) e
8 ~5 D- C9 N& \! w7 r可是模型运行起来并不是这样子,所有的临时实体全部堆积在暂存区。* C) y/ f9 r& s: O& Z, X+ b: S
没有任何临时实体进入“独立暂存区”。
$ U% P& Z% r& b5 _请问问题出在哪里?+ N8 v0 X( u: F! I8 D
6 T$ W' k4 m9 @% Q% ?! q' fmoveobject (obj object, obj location[, num outport])
% y! s& O6 \2 I& D5 W/ y" OMoves object to the specified location
: }( S. e( O) G& M1 c! Z移动对象到指定位置。
+ J3 K$ L! v0 D# [Description6 j, u8 ~8 v, K, f0 Z
This command moves the object to the specified location through the specified port.
. N+ v6 ^; m) s8 y/ T0 b可以指定从哪个端口输出。
" U: y% Q& q G1 N* Z7 j8 E6 iThe 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.
# |8 l/ v5 D j7 G7 l这个端口并不一定要真正存在,主要是为了告诉接收方对象是通过哪个端口进入的。% |4 ? M. B1 _5 i; i+ i+ x- q
When an object moves into location, the OnReceive event function of location is executed.
c1 M. U# {9 r) I& Z) x当对象移动到指定位置时,将激活(执行)接收方的“接收触发”事件。(什么实体会有接收触发?)
& [/ |" u# e9 C' vThis includes the OnEntry trigger function.
9 |7 V& C7 u9 N7 \. M+ ~这包括“进入触发”。(什么意思?接收方的进入触发吗?这句话有什么含义?)6 e% F; F% i6 F2 Z$ ~- J* d
Explicitly calling this on a flowitem with events queued up for it may cause problems.
# C6 ~/ z, Y1 ]: Y$ ^9 ?# J如果临时实体有事件要执行时使用这个命令将会引发不可预知的错误。- O+ J S* O" Q$ W
Only use when you know that no events are pending for the object being moved.7 O- @" R# m! w4 [
只有被移动的对象没有任何事件要执行的时候才能使用这个命令。1 s" E- t" w4 z3 i- z2 O
|