|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, x" a E) D2 q K9 V% n
, H; \: [+ R* r: x" [, m' V/ X0 l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* V! v) j/ P# F7 Z) _7 g1 `6 J
' Z% Z/ @7 [% R; zbegin P_read arriving
( \! A6 z! Y- Q7 F6 `! R1 a5 ` while 1=1 do begin
, c1 \5 n: P% W& p) r; Y- S read A_tote from "data.txt" with delimiter "\n"
7 u) B$ x6 |* |* D read A_time from "data.txt" with delimiter "\n"# c+ u5 b* W- }# K
read A_leave from "data.txt" with delimiter "\n"
8 f' \5 _! W2 |3 { read A_picks from "data.txt" with delimiter "\n"4 B2 O9 n% N9 F7 ~) K7 a
set load type to A_tote- h" }: V4 u5 I( z' P
if A_tote="tote 1" then set A_induct to 1
0 D7 y& C7 n5 f6 Q. Y! f5 n/ x4 k else if A_tote="tote 2" then set A_induct to 2
/ E# x6 H5 a7 q' a9 S7 G- x else set A_induct to 3
2 P* c( }+ M/ L2 G3 F4 E set A_i to 0
8 |/ F3 |9 j& W. x9 `3 J- { clone 1 load to P_induction
* Q- F2 a2 W$ K0 x# x wait for A_time sec9 ]8 {0 f" k& u/ i e% r. w
end, b7 F! R3 s/ V( F8 _5 {
end% r$ h- j2 @% B! j$ _
' }5 [- C3 M! _- I. N' `- @
begin P_induction arriving
7 }; ^. m6 w* U1 U4 s if A_induct=1 then clone 1 load to P_pick1
m I2 k U2 _6 S& W4 Z else if A_induct=2 then clone 1 load to P_pick2! f" q/ L& v9 d/ J- w
else clone 1 load to P_pick3
$ ~0 {4 v% |# _2 g, H! ]: q+ ^) \end
$ {' i4 o U$ L$ u d( d; R# a7 v: U* P2 a- @/ W+ R7 D* J
begin P_pick1 arriving
2 N8 n, `3 W0 W set A_i to 1
/ d# v. |" p+ k! I7 n) e. F move into Q_induct1
+ |/ g8 |( \' H$ p0 m4 p move into pickaisle.induct1
9 U3 M4 P" c( D2 R5 B7 P! W while A_i<=30 do begin
2 x/ d/ V' x& P. N% T+ w$ w% S& ? travel to pickaisle.con(A_i)/ Y' B& D9 x; h. T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% k3 [- p+ p/ A% t6 k2 |5 I3 ?( ? else wait for 10 sec
0 A, H" ?% s+ U( }9 Y* { if A_i=A_leave then send to die
, u" E/ u9 \# w* r! b f$ ^8 z4 v else inc A_i by 15 c) f) j# [/ e. h, b" k4 k. h
end
2 Q' e; n3 u# J# G8 N9 Nend1 C. {8 D8 v# v# j- |9 t
6 v0 D C. d# `+ d" _; U0 `# ~
begin P_pick2 arriving
, N7 X* ]; d @4 ^ set A_i to 113 Q6 R. X) @5 B; x8 H
move into Q_induct2- k; c3 J4 m" |+ ^" |
move into pickaisle.induct2
3 M$ E* V* W2 ?/ c! M while A_i<=30 do begin( T" t4 f$ \6 w8 w J" C0 l* C
travel to pickaisle.con(A_i)
2 \4 u1 U) f4 s% A/ i- ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 M# u; r2 H% t. _# |8 ^0 R e) Y1 Z
else wait for 10 sec
3 ^/ R) m( G! p if A_i=A_leave then send to die
. ^- b3 L) d) b) S5 `; W else inc A_i by 18 I' ^9 w' l7 z2 \
end
/ {1 l/ Z, q& kend" P0 y; ?( g z9 {
/ X7 ^0 O- {% D
begin P_pick3 arriving4 B' L6 P% t/ h
set A_i to 21' I% X# e- y: w
move into Q_induct38 h$ `# }3 A' B3 T1 i% H6 c
move into pickaisle.induct3, ]2 o, ^0 R' \ y6 N7 |
while A_i<=30 do begin I) E3 ^0 X- X, v0 X
travel to pickaisle.con(A_i)
3 u: l3 |/ L9 i* W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" D8 j; }5 q- O/ W$ {1 z. u+ Z else wait for 10 sec
! y7 r$ }- q( S# D% g if A_i=A_leave then send to die
% e% ?) q, s3 x* M5 U else inc A_i by 12 P: v( f* l# {+ y
end
+ a; f1 P! B3 H7 Y: x! A' Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|