|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 H" P! i( I6 b, G7 z. A( }' [( V0 N
5 S( s x1 l* ` W我的问题是,在每个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中的数值,不知道会不会有什么不妥。 C" V( F: b7 n' U c# G8 m
. }1 L0 `+ `; k+ ^begin P_read arriving
2 m* E5 y+ `# ~% q, z. {8 L# d, M) i while 1=1 do begin6 K) r2 q& k/ a0 J6 Y
read A_tote from "data.txt" with delimiter "\n"
4 [3 D- U4 ?/ y& d9 P read A_time from "data.txt" with delimiter "\n"
) y8 ]& B! u( V% K read A_leave from "data.txt" with delimiter "\n"
! ]+ ?. v3 v \0 I. V4 f! l T, Q read A_picks from "data.txt" with delimiter "\n"
$ f+ @, w5 `, E' j8 D% ^- ]8 f set load type to A_tote
# u3 K( S4 G! f) d if A_tote="tote 1" then set A_induct to 1, \$ h9 z: H0 r% w6 v; q( E; U7 [
else if A_tote="tote 2" then set A_induct to 2
: E& Q* Z+ K8 [ else set A_induct to 3
: g/ E% W& i, B; W* T set A_i to 0$ O/ [) v& v0 ^7 f4 _. E1 [- f
clone 1 load to P_induction
9 v/ w5 L5 K9 O, d+ ~ wait for A_time sec: p4 e1 ^- [" V& _) c! \, V
end
8 j; U4 [2 X3 o2 [8 Cend' ]7 M; U6 ^( Z1 a
' Q# X" L+ M8 \/ m4 o/ c) |& A) C' c# Tbegin P_induction arriving/ X- Q$ c, F" D7 W. m0 u$ w% |
if A_induct=1 then clone 1 load to P_pick1
' g2 b, H9 F: r) ^ else if A_induct=2 then clone 1 load to P_pick2
B' D' U: `% h, I else clone 1 load to P_pick3
8 u( v- w; m5 i' lend- J$ h- |. Z' }. K. W
, r" U8 V5 ^, V! D7 Q0 o+ d) f
begin P_pick1 arriving
2 L* r6 J/ S1 W6 g5 k set A_i to 1
! ?( c& K$ \( a2 D move into Q_induct1( @( m. I4 O1 f8 g" K0 A% c
move into pickaisle.induct16 s6 ~* d) N+ X
while A_i<=30 do begin
& x0 p4 v- B' }0 z6 R, S travel to pickaisle.con(A_i)
- ^4 p: ^8 R4 V& n$ _+ G( H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, Y- b8 r7 u8 u0 x; P
else wait for 10 sec
" p# k3 }6 e* { if A_i=A_leave then send to die0 R* `6 l/ ^7 I
else inc A_i by 1 o8 O& W) B5 Y1 F% g" N' D( k
end
. s5 r9 {9 m* V: w0 e0 z4 Rend
" V# r( U6 H' x+ V, N/ ` @$ n9 y/ p; M5 t0 T" p3 i; N( S) @
begin P_pick2 arriving5 |. q6 P3 [/ L# E
set A_i to 11! q$ j" q+ v3 N4 m$ K
move into Q_induct2; R, P4 q5 ~1 K
move into pickaisle.induct2
F z: N: O' r while A_i<=30 do begin3 x0 C2 e8 ]% M3 `" n! `
travel to pickaisle.con(A_i)
) x+ j3 T) A7 }0 h6 V: B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ?" O6 i5 W# k, o3 [
else wait for 10 sec, G4 |1 k- B+ I! L
if A_i=A_leave then send to die8 I& x2 D( L' ^0 |) P. j
else inc A_i by 1
% g' o6 u# w# _; ?' E8 V end/ @' |: |$ E5 j
end
# Q4 @) @" U( _1 N# M) L% i
4 M5 i/ S9 }$ ^begin P_pick3 arriving7 e7 `* c! V) {, a' _2 ?
set A_i to 218 b4 R; s' U5 f
move into Q_induct3
3 q+ L' }+ |, \9 P: H move into pickaisle.induct3
+ \+ l$ K# m+ j) W q" y) y while A_i<=30 do begin0 K4 y/ l) f- o% o3 A
travel to pickaisle.con(A_i)
8 q' P3 J: L2 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 n! u7 E3 Q- Q5 m
else wait for 10 sec
- a V0 c; D/ b. j$ U5 E. s if A_i=A_leave then send to die
8 [% s8 m- |9 ~$ l! q else inc A_i by 1
/ d! k: @! l. c end; ?2 }. b# Y$ M; l+ X
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,其它按你的 ...
|