|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% J, r9 D2 y: O! S% O" A2 W
' s0 [) ]6 C; 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中的数值,不知道会不会有什么不妥。4 F% X, h: Q+ f% V( N9 R' H
4 q/ s/ @% S& q1 [
begin P_read arriving" J0 a3 |5 I. R
while 1=1 do begin% x n" @) j3 L/ V
read A_tote from "data.txt" with delimiter "\n"9 K$ u4 r7 C9 e$ C* |3 W
read A_time from "data.txt" with delimiter "\n"
0 g$ _& p; [$ a( r& ^+ [: k read A_leave from "data.txt" with delimiter "\n"
* p" ~# `' Y, s" T. x7 I read A_picks from "data.txt" with delimiter "\n"
" o" B4 m% J8 f, j+ y set load type to A_tote
B4 m4 N9 f' A2 i1 j if A_tote="tote 1" then set A_induct to 1 G) [' S0 Y& `8 y6 N
else if A_tote="tote 2" then set A_induct to 2
* O+ K. J; E: w, f; l else set A_induct to 3 4 h$ W: h/ G- K: D0 S: P6 f% I% q
set A_i to 0& S) d& i" o$ ^' e
clone 1 load to P_induction
) |' h' a5 R+ t. s wait for A_time sec
) J4 ?8 ^6 ^* T' J# D end0 ?* E: D+ R; k( a8 f/ `% C
end- j8 \/ t. @$ g) @5 z
+ K+ @: d' Y3 g) C; @; ~! T6 ~: mbegin P_induction arriving8 m3 |' O( x7 Y% \( n: N
if A_induct=1 then clone 1 load to P_pick19 t( ]$ w) E4 I0 b4 C
else if A_induct=2 then clone 1 load to P_pick2/ G; T5 ?2 Z7 E8 {' k5 P) {+ @; S
else clone 1 load to P_pick3
1 [% |4 \- ]5 H# ~end/ I, G- J/ H; ]: |5 t3 P
+ w: ^% r8 ]) _. O2 q/ x& U
begin P_pick1 arriving0 u: U7 F) L+ d! X% }
set A_i to 1
! x. Q, c; |/ ^* D# J. R# L move into Q_induct1
8 U9 p( @) j. J4 P) q) Z/ O9 @* W move into pickaisle.induct1 ?7 z9 J4 g! I" r1 D+ D
while A_i<=30 do begin
( B/ W/ d( z- J travel to pickaisle.con(A_i)4 l1 k# k. s9 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' S# x1 v6 H4 V- [- `1 T
else wait for 10 sec5 B! Q4 ?5 x- c
if A_i=A_leave then send to die! R) P% K1 G9 h' C' m! d. k3 ]
else inc A_i by 1
% o5 v! h; X/ H$ g5 ^0 o end4 f7 E6 w9 s/ Z0 C0 W
end6 k, ~3 w- F7 ]8 h4 D
( B) x$ R/ ^+ R- y8 d, B7 }
begin P_pick2 arriving
; T) x4 E/ o' X& b2 J set A_i to 11! J4 p8 J' g) c+ n) v j) T
move into Q_induct23 s% _3 M* c [9 Z. ]. x
move into pickaisle.induct2% Z5 B( H- X, W5 Y
while A_i<=30 do begin# W5 j. {( D0 _* W }
travel to pickaisle.con(A_i)* g! R: ]! V. b0 x$ Y0 M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, i5 k3 e9 R3 f2 Y
else wait for 10 sec
7 I* f6 G" ]" H% O* J ]/ \# f if A_i=A_leave then send to die0 m( }& X* ~' {; m' P5 C/ Q
else inc A_i by 1, g3 ~1 d7 R' x$ t& e- Q% A( w
end- U: V8 G* u! u2 {; }/ j3 Z
end! n% W+ m" B. P! `1 p. L3 {
5 @3 t% ^6 t* @2 |# S8 {begin P_pick3 arriving1 ^7 p( M9 w& J3 I
set A_i to 21. T( p: m- x" k: N- S- N
move into Q_induct3
& J) f, [8 ?6 X& ~6 \% D3 _( ^" s move into pickaisle.induct3
+ s& ?; ?: l& h# Y. | while A_i<=30 do begin( G9 F2 Z* \9 D6 l% o' I1 k
travel to pickaisle.con(A_i)) l7 C/ U( x# o8 ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! N: h j! e2 W8 m: L
else wait for 10 sec# s6 p; z7 q5 @2 U. @5 y0 G4 l
if A_i=A_leave then send to die
$ z- \# ~ z! i/ h6 t$ b else inc A_i by 1
. i' l7 h* ?" f% C end
4 J q$ z3 h0 }" Y$ zend |
最佳答案
查看完整内容
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,其它按你的 ...
|