|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 _! u. m" G' x: J0 ?8 C$ t
3 b, t- q3 k" Y4 C8 F. G0 i5 w我的问题是,在每个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中的数值,不知道会不会有什么不妥。; j" ]$ k- d/ I/ k
; x w: }6 v s! T% C( t
begin P_read arriving
6 Y- _9 J+ `- P2 Q9 ~( k( I& W while 1=1 do begin
# h$ l. l* z' W7 T" n$ k/ B read A_tote from "data.txt" with delimiter "\n"
4 d, X' T% y( t1 `4 B read A_time from "data.txt" with delimiter "\n"
8 T# }5 P5 _: w& s5 v. k9 T& ? read A_leave from "data.txt" with delimiter "\n"
' z2 q# z) h2 S: M# i. d% G( D read A_picks from "data.txt" with delimiter "\n"
6 [+ q; V( q0 b& d! W, ` set load type to A_tote& @, \7 E; k: M- p$ d2 w8 ^
if A_tote="tote 1" then set A_induct to 1
8 D% E" s |) d else if A_tote="tote 2" then set A_induct to 2
& }4 }- C7 _: j" S" c+ D% M else set A_induct to 3
# s5 [% I# U% [' h set A_i to 09 V' i* X! P" r7 R9 @3 R/ o- P
clone 1 load to P_induction
6 U( H/ _% w2 N+ | J wait for A_time sec* ?3 j) A" S: J. H0 a6 B
end
* c7 h+ d2 V4 P: Rend
1 H; n( K! H! k4 g6 l/ g+ r7 t) `% o2 }6 H+ ]6 n3 f: z: n
begin P_induction arriving
8 e6 G Z; n. K: D/ o if A_induct=1 then clone 1 load to P_pick1
+ @% Q; p$ P+ @7 P0 U5 ] else if A_induct=2 then clone 1 load to P_pick2
( x8 e: r7 M/ v, J else clone 1 load to P_pick3
" T; Z' P; _1 l$ H8 Wend, `2 B' P, Q! Y b! d. b
/ c5 {- T4 o' K+ m7 @begin P_pick1 arriving
% O; o3 k' j1 E( i) v) J, b6 l, S$ |( X set A_i to 1$ }4 t9 o: D4 Z3 {4 v2 C
move into Q_induct1
2 @5 O) m$ u9 @, a, ]" } move into pickaisle.induct17 n+ I8 X# I3 n r! }# Y
while A_i<=30 do begin" ~3 ^& @3 ~7 ~% d# `
travel to pickaisle.con(A_i)
8 f- D# c0 a7 M" k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! s# Y' @. K6 I( S. | else wait for 10 sec
; @6 Z1 K- Z1 A$ ~ if A_i=A_leave then send to die& }2 O/ ^8 K9 F# ~% K% n
else inc A_i by 1, k" q" t6 ~* p- ]: B
end
. W+ I% w5 V, e2 mend7 v# {7 H' D: L
/ }6 z" ^% D0 {
begin P_pick2 arriving
7 N' s8 l- U( O: D8 e set A_i to 114 U# B- V) O2 ]
move into Q_induct2/ T, S% f b) ~( z5 O' N9 c
move into pickaisle.induct2$ O" n4 D z5 {1 S _; M9 F9 b
while A_i<=30 do begin: j3 b- ?5 R$ T+ j
travel to pickaisle.con(A_i)+ \9 ] ~1 Z& l/ u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 D+ h6 i) x4 T# b$ C& F
else wait for 10 sec1 t: L" o" t- y/ E, x$ T+ a
if A_i=A_leave then send to die/ y' s7 S. ^9 c/ K# `/ N
else inc A_i by 1/ L. X7 {* w& Z9 X! F
end
$ Z6 \! w: `, l4 }/ _, F; N2 Bend
# u4 ]( Y0 H+ q( P# x6 q: a9 I6 e1 c j" d
begin P_pick3 arriving, L% H8 j+ ?6 u: V5 f1 H
set A_i to 21
9 z; @0 s8 x8 R! Y6 \9 b move into Q_induct3
# q) k: L( P0 `% t3 e- n/ W9 n move into pickaisle.induct3
2 x( c+ b# ^9 K: H! g+ y while A_i<=30 do begin
; {$ `5 Z. }3 _9 @" @ travel to pickaisle.con(A_i). c* @" K9 a7 A4 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! p* f% i# z: W else wait for 10 sec: ?. O0 [$ y P( l# q9 c) Y. t
if A_i=A_leave then send to die
) \* m0 q( K0 U0 A$ [ else inc A_i by 1( R: F% C8 w8 Y# ~, N
end: O ], }2 G/ e) I" F+ d
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,其它按你的 ...
|