|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! \; q. |0 V+ _0 g8 i( I9 J$ H) u; K2 x6 z. T$ c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% Z7 ~: B8 S/ z3 U7 ^
; f2 @' U( y- ]: s$ v3 Z# Sbegin P_read arriving
1 U7 x, k! c2 X while 1=1 do begin
' G( i/ Z) b* w read A_tote from "data.txt" with delimiter "\n"
" S( H. r0 M4 v- i' H8 I7 P. | read A_time from "data.txt" with delimiter "\n"+ Z8 u% I4 }5 t3 T7 e4 L/ m
read A_leave from "data.txt" with delimiter "\n"! K& l5 e" @0 d1 H
read A_picks from "data.txt" with delimiter "\n"8 g6 w6 M/ i& {9 {6 @. z2 `+ ]
set load type to A_tote7 f% y m# @. a, U% l9 d8 c
if A_tote="tote 1" then set A_induct to 1) H# |" P2 n6 P8 d
else if A_tote="tote 2" then set A_induct to 2
, U a9 h# s0 Q1 q I else set A_induct to 3 2 w, J: L- v$ F$ S
set A_i to 0
. p% ~: N/ Q! G j, P, M1 w clone 1 load to P_induction
@- U2 }4 v% m- m- O wait for A_time sec5 o0 c; {$ }+ Q8 {* r) V
end
9 l7 v# B( P. h" I5 C; a) Mend
, y) H( n3 e+ q7 N- A
8 I. ?0 U8 j" g! R$ j ebegin P_induction arriving' Y' ^( o# D* A% g
if A_induct=1 then clone 1 load to P_pick17 O( K4 e; X: z W% ]# N q/ n
else if A_induct=2 then clone 1 load to P_pick27 s! x4 H( U/ S! S8 \7 w
else clone 1 load to P_pick39 H- [, f1 `# C
end
* L3 q: E; V5 c9 [) ?) K3 I" G9 C0 e. h3 C# o4 k; c+ c
begin P_pick1 arriving) {; q: e" f* j; _
set A_i to 1
" n. p, K7 }, ~( q move into Q_induct1
. `. f' f$ e& [: k move into pickaisle.induct1
! r' r, [3 R" F3 D while A_i<=30 do begin% X) x' m, o" ^: }3 ^2 \, g
travel to pickaisle.con(A_i)' ]% d2 i* Y7 m- V3 i9 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! G2 |. `9 l u( {. a else wait for 10 sec0 K* ?5 d& G/ e
if A_i=A_leave then send to die; b$ k) o! g* Y3 v! U
else inc A_i by 1
( O( c$ A7 c; g4 i# a, b# R end3 N, s+ p+ h' E9 D+ s" b1 O8 z
end
+ j; }3 R* u" V: d) ]5 B
: A* ^" s, d4 S+ ybegin P_pick2 arriving& L3 Y8 B# O& l/ n( m6 E# H
set A_i to 11
) X1 C/ w4 l, c move into Q_induct2
/ _3 [. ] I6 ] [1 S F$ x move into pickaisle.induct25 [2 w! V4 W0 R! x/ I' [# V
while A_i<=30 do begin: V, L+ ?) I* d( g' ~: b
travel to pickaisle.con(A_i)6 J1 k5 P$ }. d/ B' [$ Q/ j* k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( [3 e/ m$ N' A* V8 U
else wait for 10 sec6 d8 A2 ^' ?8 E1 b5 H( {
if A_i=A_leave then send to die, E$ N- o, { p. }( l) m
else inc A_i by 1* Y+ G* V5 H! d# a( R/ k
end8 f& f f/ ?. `; ]; e" S' u
end
, S$ [1 [) ]. ]% F" E# [6 ~ R6 M3 T, v
# e B z, X+ S! qbegin P_pick3 arriving2 Q8 E! _: Q. r& V* x
set A_i to 21
4 L6 ~! x9 w/ e% Q* n8 u( d move into Q_induct3' S j7 O% L* i& ^0 O9 C. X9 g
move into pickaisle.induct32 V( d# a; W/ o% @
while A_i<=30 do begin- u; E9 O3 N; H' g) J& g
travel to pickaisle.con(A_i)
. R+ B2 s1 c' g5 ~0 u9 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Y; y, R0 C/ n8 Y
else wait for 10 sec) x0 K& o2 G3 a# `: Q( M: e
if A_i=A_leave then send to die1 x3 `# B% C$ Y' j# p
else inc A_i by 1 {" V' Q e8 u" B
end
/ i: V+ _& k* {: rend |
最佳答案
查看完整内容
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,其它按你的 ...
|