本帖最后由 zorsite 于 2016-4-7 11:54 编辑 ! D* r- `3 C( X% M }- o% a- `, N, u
8 d6 _# n9 E* ~4 C% d
模型中有四个实体:
% F% p, O! Z7 j5 `2 X7 n. t' g发生器,处理器,暂存区,独立暂存区。( P1 ~+ t7 ^: s
发生器,处理器,暂存区依次A连接。
4 s- {) w( o# F$ S* L独立暂存区不与任何实体相连。
. X& [2 e: v. i f. C: F' l
: K) I; m2 z) g# P9 Y' d4 J发生器中产生两种类型的临时实体,
0 d f' T0 w0 I Y% \0 Q) I第一种临时实体加工后传送到暂存区,
& |5 W6 W& Z& j5 `第二种临时实体加工后“移动”到独立暂存区。5 j) `4 O% B: C$ A9 o* [
( x: h, E* U% G) d发生器中创建触发中代码如下:4 Z0 u5 t4 H i0 J" M) v
setitemtype(item,duniform(1,2));
# E5 ^; F* w5 U: Tcolorarray(item,getitemtype(item));
+ ^. k3 G5 {+ T0 f+ J, s: }) }. ^$ J8 M9 |1 ^2 l; R
处理器的“加工结束触发”中加入以下代码:
7 P8 F6 _: m) L4 |# nif (getitemtype(item)==2) moveobject(item,node("独立暂存区", model()));+ a) T* \6 q7 y( p# ~3 N
* z! i4 k; ?. q2 p. J各种触发器触发时间的先后顺序为:
- S I: |* C3 ]3 C1 U5 `重置触发à进入触发à预置结束触发à加工结束触发à发送至端口à使用运输工具à离开触发
% r9 m1 r+ S4 ^' J$ V% N( o加工结束触发在发送至端口触发之前,
9 @0 b8 C+ [$ I' |% w理论上来讲,第二种临时实体加工完成后先应该先被移动到独立暂存区。; P4 w8 m& m% m- }' H P, c
9 N' B" a! U" g3 h+ l可是模型运行起来并不是这样子,所有的临时实体全部堆积在暂存区。
8 k4 M; m5 a6 `* j' }) z没有任何临时实体进入“独立暂存区”。6 m: J m3 L7 ~/ y
请问问题出在哪里?
! x7 {5 X# m& v1 X0 T9 N
. U. S3 c5 }! H! F- \7 |- Rmoveobject (obj object, obj location[, num outport])( X4 o, C; l, \% R6 T5 x3 n
Moves object to the specified location, m# ^* {2 N' D4 d: E" v: j& R
移动对象到指定位置。- O4 X! \2 E1 T2 L2 D
Description) S9 R$ H/ h. u1 C5 n
This command moves the object to the specified location through the specified port. 7 j1 Y% v" ]# w: o
可以指定从哪个端口输出。( Q1 \: c& @& N
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.
* l2 d( D; R, l6 R6 U7 W- P8 X这个端口并不一定要真正存在,主要是为了告诉接收方对象是通过哪个端口进入的。) V' a! Q- s1 P- L
When an object moves into location, the OnReceive event function of location is executed.
: w, U) X6 D8 f& C9 ?. C( L* h! L当对象移动到指定位置时,将激活(执行)接收方的“接收触发”事件。(什么实体会有接收触发?)
5 }" F8 I; ?2 G+ A! w: D& aThis includes the OnEntry trigger function.
" m0 E U# B' {. K4 q& z1 _# {2 C/ U7 i这包括“进入触发”。(什么意思?接收方的进入触发吗?这句话有什么含义?)
3 p0 z! O- J: l* O8 d( IExplicitly calling this on a flowitem with events queued up for it may cause problems. ( ~$ A" C9 b, R4 t' R8 [
如果临时实体有事件要执行时使用这个命令将会引发不可预知的错误。
: h3 i3 j+ y4 j% lOnly use when you know that no events are pending for the object being moved." N) N" S- y8 H7 i7 H3 R
只有被移动的对象没有任何事件要执行的时候才能使用这个命令。- ~4 j3 s, s+ o3 T! e, Y
|