|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, g( b+ x6 o: n9 C( E: ~% h0 j
3 L9 n! }- V" X( B v' K我的问题是,在每个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中的数值,不知道会不会有什么不妥。& t$ s: |( {/ S' M. l: n) J E7 N
* m5 Q# c) V* ^/ N
begin P_read arriving3 Z! j7 A6 g# |$ _# U; G0 j3 t
while 1=1 do begin% _3 O d+ F( w+ m
read A_tote from "data.txt" with delimiter "\n"
8 H6 e& T( q5 A" t- z" G* f read A_time from "data.txt" with delimiter "\n"
* _9 q# m! i$ @8 x3 k3 Q( F read A_leave from "data.txt" with delimiter "\n"* s! l2 Y% `+ i
read A_picks from "data.txt" with delimiter "\n"& K# m r/ y% U2 e9 C+ _
set load type to A_tote! c; }% }0 [* H, W, q
if A_tote="tote 1" then set A_induct to 1
" A, `' t9 J* i8 V else if A_tote="tote 2" then set A_induct to 2
$ U8 W' s: T# {6 N2 b9 d else set A_induct to 3
6 A' [# z( [# m set A_i to 0
1 o9 }! I, {+ n! _7 e+ J% S clone 1 load to P_induction
9 d% G% W, K# P2 G2 Z z* j wait for A_time sec- Q/ e4 V1 A& A. G$ t
end
3 D4 r" D6 G5 \* V: O* A2 }. b8 Eend
9 Q. K2 X9 {7 r& c7 T' m& O$ ^/ w5 P3 v4 I/ [
begin P_induction arriving
9 O. D( t/ o5 Z; Z# {5 b if A_induct=1 then clone 1 load to P_pick1/ M& Z, M: F8 u5 h! A
else if A_induct=2 then clone 1 load to P_pick27 U$ |; Q* E$ O
else clone 1 load to P_pick3/ \" T! p0 b/ a) t% @
end8 z# _' Q: b* A# F3 E) I
5 M- B, z/ h% N# R
begin P_pick1 arriving
2 K$ o, T- A$ r6 I9 J5 C: b) { set A_i to 1+ x) d1 {7 a) p' N* s) {
move into Q_induct1
2 Y1 h1 o/ @& D7 \ move into pickaisle.induct1
( D% Z: J# f0 ?. j2 m while A_i<=30 do begin" f7 j ], n' S1 [% l. g1 P
travel to pickaisle.con(A_i)
; B: A& X$ d5 [( w- x( K+ ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ]3 j, f" _: K6 Z h% { else wait for 10 sec
/ ]2 ^$ l# _& F% H if A_i=A_leave then send to die* X' g$ U7 }, I7 h; }
else inc A_i by 1
; j, d8 l: a9 W- A4 Y7 F, q3 X end
: i5 o8 B0 x3 _$ ~end, G; u/ ~" r9 g" |' L
( b$ z( o: `6 M/ s& fbegin P_pick2 arriving F$ w% W2 ]' D0 v' ~- ?. u9 _
set A_i to 11
+ c; |% n; X+ L( H A# C' B4 {& Y2 G$ I move into Q_induct2" W) n* h c8 d
move into pickaisle.induct2
; y w; @' y. h$ g1 m/ Q. i while A_i<=30 do begin/ P: P, Y+ q% h/ g5 N- o
travel to pickaisle.con(A_i)
' W# q% Z3 V @: E: j1 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 d3 {9 j6 b6 N# ]6 S
else wait for 10 sec3 n5 }4 q' T3 \% |
if A_i=A_leave then send to die
' C) a! `6 S" f4 Q3 P2 e else inc A_i by 10 F+ E6 H0 l" h: C
end, i7 D$ p+ s z
end) @- V* F- @; D
4 {5 q+ Q+ \& H" b* W( t
begin P_pick3 arriving
1 q$ X+ r( ~2 j+ X4 a/ }' I set A_i to 21
( ~3 z" \6 n2 `7 g+ u move into Q_induct3* T/ w- F# P1 z
move into pickaisle.induct3, `& v6 v- I/ N- K3 n
while A_i<=30 do begin* ] k7 P; e+ P8 ~0 \, Z
travel to pickaisle.con(A_i)% y6 R3 |2 ]/ d5 m. ~: k+ @" s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' O, z9 o. N+ X4 o) s5 a+ Z5 o% ?% [ else wait for 10 sec, n' M1 q' {. }5 p7 R/ A( t
if A_i=A_leave then send to die
" ^$ b8 J& N" b7 F! ?" A else inc A_i by 1/ j- P6 V4 J8 f n9 b: v1 }, ~6 H# v: E
end' I+ w3 _1 [" F; c: l
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,其它按你的 ...
|