|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" u6 _( P4 o# ^+ g& x1 }# n: R: f Y; E" [3 b+ v& D ~, z* E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ k4 g2 a/ ~2 j, }: T3 d" A6 a5 ~) t$ l& g
begin P_read arriving
3 V7 y7 L8 x& k3 p$ S while 1=1 do begin
% ^, _' U% W0 R( q6 k7 C6 U1 g( J read A_tote from "data.txt" with delimiter "\n"
5 j$ g/ P9 u4 Z% t. @ read A_time from "data.txt" with delimiter "\n"
# t! P( q: F' V z4 T% w8 ~/ ? read A_leave from "data.txt" with delimiter "\n"
( w# f. U% e! x0 n: W& X read A_picks from "data.txt" with delimiter "\n". D; C1 C$ n6 X' G6 o% K1 S9 s
set load type to A_tote
: s+ G1 ?, F* O, M if A_tote="tote 1" then set A_induct to 1
9 p, L8 f2 S" J" a* g# @4 m else if A_tote="tote 2" then set A_induct to 24 T @1 }" \( K
else set A_induct to 3
2 Y) E4 L4 j( G l6 u+ a set A_i to 0
( B6 H6 A* c T2 g( D1 w9 Q clone 1 load to P_induction
8 e: o; [) U% p9 X wait for A_time sec
0 J G% F5 w7 M5 s- F: z7 \6 H3 u end
$ l, L3 U! C! K8 Send3 j) L" }( c; J$ I+ L8 [
6 O1 l( y8 @ Ebegin P_induction arriving
% O* n' e+ f4 }) Y0 ?2 P& { if A_induct=1 then clone 1 load to P_pick1* }2 H& D& }# u
else if A_induct=2 then clone 1 load to P_pick2% u' e1 x' Y1 j1 B6 S
else clone 1 load to P_pick3
+ j; F( V' |' E1 r N8 }$ Wend
: ~. a0 M3 ]* i1 N0 I; g4 D. o6 o7 Q- l
. y9 `2 S0 Y% u7 O( \- `begin P_pick1 arriving
# w" i9 n* y8 n9 N set A_i to 12 z8 m; \, {9 d& O0 L2 U
move into Q_induct16 u0 T6 F; I2 ^ w. I; @
move into pickaisle.induct15 P7 X% S" I; P* X R
while A_i<=30 do begin1 e* U& L, [3 m* O; A3 h
travel to pickaisle.con(A_i)
1 e w9 y! \5 L/ E9 X$ ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: l0 G- b+ |% y7 i& o) G$ s3 y5 H5 B else wait for 10 sec
1 O$ [4 s1 c: X7 c5 n# X5 b& ^3 v' ] if A_i=A_leave then send to die
% {( W( H& M' ^1 P _ else inc A_i by 1) ]: W6 J& ?: U% `
end
# Q9 H+ h8 ]4 f7 I9 W5 l5 c! {, dend
( l& u; p X/ Y" f+ Y0 O+ a8 f) a4 O! S+ h& M
begin P_pick2 arriving
6 Y/ M& p J" A- j4 n5 U* { set A_i to 11
W0 T _) I* ^$ x/ Y' w move into Q_induct2" }% _7 f2 ^+ T, C
move into pickaisle.induct2
: F( w4 C" y! L while A_i<=30 do begin$ h% r- l7 ]* z
travel to pickaisle.con(A_i)
1 _# s2 q l! E5 L6 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 w/ P3 v5 k& C' w9 Q' m! ~+ Y else wait for 10 sec
* ^9 N) k. Z, ?4 O0 W7 V$ g if A_i=A_leave then send to die
: Q) T& X8 F+ }& h1 c4 A: Q& O else inc A_i by 1, b" r; y' p, p7 s) W
end2 D$ N x) C% q- p v# Y; b% l9 Y
end9 G6 _( n8 r ~1 ]( E @ h
' q' m* [4 l, t mbegin P_pick3 arriving
/ U) ]& K1 c8 y- ? set A_i to 21
0 ^- ~8 I |% a- { move into Q_induct3; z; B7 x3 K- }) z- y
move into pickaisle.induct3
0 S- r8 X) {8 [1 \6 a4 M while A_i<=30 do begin, t U* ~( W9 m0 D: X# t
travel to pickaisle.con(A_i)
& b! T, Y ^" |$ Z3 Q9 N$ f7 [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" }1 B; Z9 o C8 x% o
else wait for 10 sec
, e4 ?( o5 p7 D# N6 J1 C if A_i=A_leave then send to die; t/ B E, q* K& Y+ {1 F r. ~" T7 L! a
else inc A_i by 16 w6 G+ ~) {) G+ I7 ~
end
9 h9 e' S& @4 q0 wend |
最佳答案
查看完整内容
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,其它按你的 ...
|