|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 G6 U, i& \, q/ b
$ E2 Q! n! J Y Z5 h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* y, l8 K; p" H& n9 M
6 Y) }' h% {& K8 t) V: Kbegin P_read arriving
& j% ^& u! F7 J6 r while 1=1 do begin9 c. h1 h0 ?, P6 q6 t3 C
read A_tote from "data.txt" with delimiter "\n"8 Q5 d, k' W8 q6 e; }2 D7 Z
read A_time from "data.txt" with delimiter "\n"
% x# m7 f, E V* W9 w, O read A_leave from "data.txt" with delimiter "\n"
$ u) p, \# x# E5 } read A_picks from "data.txt" with delimiter "\n" m2 D" k6 D) L6 ?: i6 _
set load type to A_tote
) A& _! L% a {- U' |- W if A_tote="tote 1" then set A_induct to 1
1 m3 X( r+ f# v: ~- x else if A_tote="tote 2" then set A_induct to 2
% @+ {) }8 ?0 U2 V else set A_induct to 3 # r7 H7 d6 M! r1 Y4 ?) G. F
set A_i to 07 i; |& }' n3 k6 A* o, A
clone 1 load to P_induction
+ V: q& h$ ~1 `4 _, q# O# _ wait for A_time sec+ ^: w( P1 R4 z0 D
end* ?# ]. { c6 S% e, }' {
end& X; A! m+ G9 ~' J& ~
3 }) p: w4 d3 B% D' ]begin P_induction arriving. j& |9 S% D8 B; g
if A_induct=1 then clone 1 load to P_pick1* ]+ E) F$ a2 }5 l
else if A_induct=2 then clone 1 load to P_pick21 C; Z* B( T# h9 d# E& ?: Z6 X1 r
else clone 1 load to P_pick3
# k" ]' u7 Q) e: Send
# ^* Z- _9 u ^9 o+ M2 J- {# H' _$ B: J
begin P_pick1 arriving7 e( M* E; c0 B6 p
set A_i to 1) T# }* { v2 t/ i: r1 [: \: L
move into Q_induct1: B, U* \8 R% t0 Z( u
move into pickaisle.induct1
) s4 W6 S; o& Q+ D& ^ while A_i<=30 do begin( ^8 j* {3 V4 Y7 g# P5 C3 Z" t5 W
travel to pickaisle.con(A_i)
" i. S' \; C& u4 l+ e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; Y- V d9 }1 v
else wait for 10 sec+ K) g3 Q1 _% L! y0 c i
if A_i=A_leave then send to die
! f9 h4 X% x( t+ s, E5 n else inc A_i by 1
# h) V' m$ P8 h end( F! U$ M1 w) y& N" S
end* C: X* m. N8 F! t8 n1 A: a6 c
/ `- A/ N8 w1 Dbegin P_pick2 arriving
( h: y$ W U: R: [- f6 x set A_i to 11
9 Y6 f! [( W, M# K7 f1 a, u move into Q_induct2$ F z2 R1 x& W7 X& B% o& u
move into pickaisle.induct2 O# W7 u1 x# h6 F0 Y) p
while A_i<=30 do begin6 b3 H( E9 }1 }# c4 W0 ?1 h$ N3 G
travel to pickaisle.con(A_i)
& d' H* P( {: f7 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! X8 D6 q0 j% P1 R else wait for 10 sec( O. W( U W+ q% z
if A_i=A_leave then send to die% a( [. [9 I* ^) D1 `: k1 N7 r
else inc A_i by 11 ~4 ^/ E+ p* d+ C& k
end4 ]3 [2 W! k4 ?9 O6 @
end
5 d9 O( h. d) U+ ]3 p7 V' ]
! |9 `# o }" T/ S: ?5 D! R Xbegin P_pick3 arriving7 R* Y. h5 n7 n, b3 p! V' N
set A_i to 217 i0 [" { V( [4 l. P0 j7 {; O4 F. M% d
move into Q_induct3
7 t( v1 }. b' M7 H0 r move into pickaisle.induct33 O% g" N, @& B6 V/ b7 [3 m
while A_i<=30 do begin
9 |7 Z; M: b% ? travel to pickaisle.con(A_i)
, g! ?4 c3 |0 P0 H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 u; ]8 e# v- g% \
else wait for 10 sec) t) R" y6 W$ j1 ~& Z
if A_i=A_leave then send to die$ R U9 f1 ?& J& z# n! w& ^) J
else inc A_i by 17 B1 C S& X* U+ J
end3 g& a7 _3 x. ~1 v7 b' s+ m
end |
最佳答案
查看完整内容
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,其它按你的 ...
|