|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ E3 k- }5 s5 p/ b J) M& F
9 x7 ?" ]) p5 i! N s8 r* M, o% D e
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。, u; t1 ~& k; n. B3 n4 W1 s v
* n' O# J' Y3 a9 |! Z9 x7 r9 A
begin P_read arriving1 j7 u Z5 ~0 g( k, Y0 i" Y
while 1=1 do begin6 t! p5 }4 Y7 C1 Q
read A_tote from "data.txt" with delimiter "\n"
+ U+ A" X& T1 q& l read A_time from "data.txt" with delimiter "\n"7 z \, F0 @9 L) y- V, L7 r! c( y
read A_leave from "data.txt" with delimiter "\n"
+ P/ b% Q/ B0 v% w0 q, w1 X9 B read A_picks from "data.txt" with delimiter "\n"9 ~& P2 T. L" X% l+ j
set load type to A_tote
7 A- O; D; R/ ~: V6 z% Y( J if A_tote="tote 1" then set A_induct to 1: m) D3 I& ~) p6 S* C! B
else if A_tote="tote 2" then set A_induct to 2
3 }2 H9 U. h" L6 f# j6 @' P+ Z else set A_induct to 3
& E! @2 n7 c9 E. g7 z& s set A_i to 0) O& [$ }( H! n: \3 O
clone 1 load to P_induction
" t, G: h, I# ]) e wait for A_time sec
/ b3 v0 o" D5 J5 r* w. @2 ^- ^ end
' b% I4 A" G7 m7 W6 s8 z) Qend
9 }8 C6 t: L o
# j) C" L9 x% z( s3 M* h3 `begin P_induction arriving4 c( W5 } Z# R' c) v0 z+ I! y
if A_induct=1 then clone 1 load to P_pick1
8 u7 o# p5 M2 [6 z else if A_induct=2 then clone 1 load to P_pick2# M/ V7 ?/ P5 D* n$ |
else clone 1 load to P_pick3
+ \* N$ V4 I6 P9 ~; [end
! b( H- a* V* r9 `" L* p: j* f
( H4 j; |( s# z# @9 ~begin P_pick1 arriving
2 @( m, u9 ?. ^4 p: B; _1 t set A_i to 1
0 E. Z- E$ K& x3 R move into Q_induct1; W" Q. \: m- y! B, E1 v
move into pickaisle.induct1% Z% B7 \1 ~6 Y" @
while A_i<=30 do begin
$ E4 N7 o2 O- q5 h- m7 b3 U* o: z travel to pickaisle.con(A_i)
" V# e5 t1 F' |. X! C- z: ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% w2 h W' t6 A: i else wait for 10 sec) w: ~4 u' Z* q V# f) h
if A_i=A_leave then send to die. l6 S% r" l5 } l$ b
else inc A_i by 1
5 K, D& y5 r! g/ c8 @5 j end
2 q0 h1 O% W5 W; ]5 I- a- \end& n, H! B+ l# T! L1 Q
. q# b& [% S- H7 ^begin P_pick2 arriving
& E: U5 x" I. F+ K) ~* ?6 P( u set A_i to 11
+ S" G# ?" w$ x# e move into Q_induct2
7 w! i5 f0 @7 n move into pickaisle.induct2
' F) | t& f' {( P, [* L while A_i<=30 do begin7 P4 W- ]& Q; A) n. k
travel to pickaisle.con(A_i)
. e+ t; T. @8 X) w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- R- q$ a6 D+ {! w6 N
else wait for 10 sec
^( {0 Q* P8 `& s6 Q2 R5 W, V8 g; S6 M if A_i=A_leave then send to die! n) f$ O5 \3 E K9 A" E, N8 o. i
else inc A_i by 14 v o' l7 b- h; ]! g& a
end; q+ @) b! G# F3 A8 Q Z
end
/ z* Q4 d* F* w, m/ b) R( @1 K1 U- Q" d: Z' x, F1 Z
begin P_pick3 arriving {2 ?" _" ]5 ~! f1 B4 X
set A_i to 218 [5 a* t3 N9 n
move into Q_induct3: k# B/ D: a! f7 b7 X& U5 ?* `8 p
move into pickaisle.induct33 \$ `$ B! d' R* J7 Y
while A_i<=30 do begin2 x& r4 ^7 ]9 H! K
travel to pickaisle.con(A_i)" @/ Q9 j4 H4 |5 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ p; o; }& w& O% x9 ~ j: b5 N
else wait for 10 sec
5 N0 j% ~. r0 p4 h+ o2 v3 u if A_i=A_leave then send to die
7 [6 D' G R$ A9 q# W* m else inc A_i by 1
: x% ^8 L& e" h9 }! S end
" k+ d3 D% r( Q0 K; eend |
最佳答案
查看完整内容
pickaisle.induct1/2/3是个什么东东?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
|