|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 h1 p/ |- r s6 M
6 N$ `# E7 }- A! G- [; {- t我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 g$ F, Y0 H+ w
; j$ c4 ~ D# }3 a( G5 T' [5 z
begin P_read arriving
( `( y9 L0 S+ D( m; S/ X- j while 1=1 do begin, H* j1 Q% i k$ T3 z7 _
read A_tote from "data.txt" with delimiter "\n"
$ c/ `7 W4 Z5 x4 w9 ]% i/ K read A_time from "data.txt" with delimiter "\n"% B* l. d4 G4 O3 E M$ q/ n
read A_leave from "data.txt" with delimiter "\n"7 Y( v8 ~. S/ P/ e- I: G0 z
read A_picks from "data.txt" with delimiter "\n"7 B% E, |( b# s
set load type to A_tote
- R+ u8 W0 [3 S7 i2 J; A if A_tote="tote 1" then set A_induct to 1
/ n2 A% f" { {$ k7 D1 y3 n else if A_tote="tote 2" then set A_induct to 2
4 z. o( Q+ X8 t" W5 R else set A_induct to 3 ) W, d3 Q6 L) T# p' X+ J# @
set A_i to 0
9 E. p6 [( S) Y( K; j clone 1 load to P_induction/ G3 M! |6 ~! H; L$ ?
wait for A_time sec& O5 A2 b5 y3 B2 @2 {2 J
end" N7 [; a+ @: B, f; \9 _5 H
end3 W e* T# Y: G! N9 ^
4 d8 O& \; h0 X. s& T3 F
begin P_induction arriving0 |9 ^" _' Z& i9 ?7 K
if A_induct=1 then clone 1 load to P_pick1, A. t# p; Q; }: i$ ?
else if A_induct=2 then clone 1 load to P_pick2
/ i( ]) Q2 H- I% D else clone 1 load to P_pick3) P' @$ n2 z' {9 S4 I' L5 T
end
) D7 J+ `! z* z p
/ u) A/ p+ W/ s! w( C( r1 jbegin P_pick1 arriving8 f {4 b; c2 ~- D& `
set A_i to 1( e0 m# B2 |. P& @4 l
move into Q_induct1- I8 e9 j/ W/ W% s
move into pickaisle.induct11 ]! I5 J! V9 V4 A) |) D/ T
while A_i<=30 do begin
) `( o0 b( Q) H travel to pickaisle.con(A_i): i6 z# U8 P* c+ P! ^' ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, \8 M j$ K* g2 W* ]1 z else wait for 10 sec1 z) N( X0 u8 [% k( I
if A_i=A_leave then send to die
$ ]$ n. X2 v9 p: c; I else inc A_i by 1; J9 }' S; B* D
end! A- R/ D% F- ^" B( M# s# k0 F
end
. W; E6 Z; R5 n3 d% O2 _9 [- U/ I. ]" g% W$ |
begin P_pick2 arriving' [+ |. q) P- W5 C$ r* Z! ^
set A_i to 11
# K; Y- ^/ }- p S, A, j move into Q_induct2* l( o+ F( _3 y6 a+ [3 a7 l
move into pickaisle.induct2
7 ?) i# ?1 j7 P( r while A_i<=30 do begin. k- J! D! C8 `7 U m* l9 \
travel to pickaisle.con(A_i)* I4 J9 h, f8 v+ T0 a$ i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* Q* n1 s3 Y" U6 m. q0 \
else wait for 10 sec
/ [6 q2 y5 J; O if A_i=A_leave then send to die
! e, ~0 Q: z. u3 j/ y1 I. q, P5 G else inc A_i by 10 G' e2 U& \9 }' D& K) S! J5 }
end& ^ P6 G5 V# {8 m% t$ F
end' ?, }7 B1 H' G
( ` w7 b g9 h8 K; Q: [# Cbegin P_pick3 arriving; ~0 r4 \6 ]& O
set A_i to 21, f" L* v- ]9 H) T$ w+ r
move into Q_induct3
& T j8 f/ N: k* y" X+ H move into pickaisle.induct3% ]/ W \/ @% Q' A# a* I
while A_i<=30 do begin5 Q- G2 |$ L, @& v
travel to pickaisle.con(A_i)
6 W* f0 p y6 Q/ Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& a5 M% t* y& \! k3 w
else wait for 10 sec; \* y. V! k3 V+ U2 L' G4 r
if A_i=A_leave then send to die
5 Z6 r2 h5 f* w' }) [ else inc A_i by 1
! z# c+ E0 @3 V8 D2 P$ u) C7 V" u end
5 r" S. U' ?+ ]' O8 G, n) `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,其它按你的 ...
|