|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! U0 C8 [5 X E1 t
' e- g7 C9 O0 k1 B% U. j S' Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
b6 F% k, k- }4 L! B
% z+ x$ w- P, O/ S, _8 b, Pbegin P_read arriving
$ q. N9 {) B% E% o8 [/ x while 1=1 do begin, \; L/ O F0 w' U
read A_tote from "data.txt" with delimiter "\n"5 V+ B. p$ u, W
read A_time from "data.txt" with delimiter "\n"3 _7 Z$ ^: Q0 a$ S! f* v
read A_leave from "data.txt" with delimiter "\n"
0 B0 {$ y9 [9 H+ m/ `( }1 A$ L; g1 G read A_picks from "data.txt" with delimiter "\n"+ m* {) j# M8 g+ i) M9 T5 f9 X
set load type to A_tote. q8 l; ?4 R) o( w
if A_tote="tote 1" then set A_induct to 1; y" a+ ], y0 t. Q
else if A_tote="tote 2" then set A_induct to 2
8 {# ^3 X' m% X! o1 Z* @5 ^ else set A_induct to 3
/ U7 H: `4 ^" o7 q/ u2 o3 ~ set A_i to 0, Z8 ~- x, U! N. g
clone 1 load to P_induction
; ~& ?2 d2 v& `5 F& T wait for A_time sec
0 X+ I$ }& J; _0 C, ? end! |, X/ O0 t3 K! e$ q% ~, @7 q
end
9 }7 b/ j3 w! P$ G9 K) X" F% L. p2 V; Y6 x5 g( ]3 a+ }- H
begin P_induction arriving
! ]& @' B* t. P' \& Y if A_induct=1 then clone 1 load to P_pick1% `# i/ a8 ^+ z- s9 R' S5 L p
else if A_induct=2 then clone 1 load to P_pick2
5 Y2 z( t. y8 A, x ~6 G# G else clone 1 load to P_pick3
; K% L. [$ {0 d$ G# N. \end
* s" @$ p4 e' i" @! ? P
3 m. W( ?. k, L4 [) ^begin P_pick1 arriving8 H2 }/ U2 h" V1 T, F9 b4 [
set A_i to 1
4 \8 U H- R% Z1 @# m( V/ t8 _2 [ move into Q_induct1( g& ^$ R% R B; G9 z4 _: `5 i6 M0 Z) x
move into pickaisle.induct1
( ^' i/ B: ~9 c8 Z while A_i<=30 do begin5 M# _; D, }0 `) i8 |
travel to pickaisle.con(A_i)6 W6 ?% X" j" F3 H/ A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 f0 D3 |& _% M, u$ H/ s, r4 W1 A else wait for 10 sec0 w' D4 b% X4 K$ c8 h9 j3 I
if A_i=A_leave then send to die3 s- q1 ^* d, F( |6 c, l
else inc A_i by 1
- Q! ]8 ?4 h8 g5 o. b+ g; D+ B end
3 x o* q! G5 s9 J- Z5 V9 t4 Fend
9 o5 {( @& y8 R; P% T) L% X+ V8 f' c, P+ V$ a1 ?" o
begin P_pick2 arriving" W6 [3 {+ `; x4 I+ }2 x$ K& g
set A_i to 110 d1 i1 G! a5 {' |6 T
move into Q_induct29 r( S6 p% Q0 z+ P* q. X
move into pickaisle.induct2
8 T# \2 x+ `, ?% |' ^$ m while A_i<=30 do begin
* _( s, l+ n, m& | travel to pickaisle.con(A_i), ?5 K2 c6 ]* u+ m+ u3 C9 |4 f3 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; H+ E( ?5 R7 V3 y& k+ [ else wait for 10 sec
( j( l. z8 ~: w( w4 G if A_i=A_leave then send to die. o9 e; N3 Q1 T! N/ h4 A4 f1 B5 q
else inc A_i by 1
' m' b; R7 w+ x0 q end
; H- h @( [$ A" R( ^5 y+ Dend" z/ J9 i7 ?3 }5 C* ]& c2 }% O
: h( Q" J* y# r3 u6 q) \
begin P_pick3 arriving
$ k5 E4 J5 s3 w* b8 R. l4 V7 ^ set A_i to 21( k0 [% X$ R% |1 v ]8 r7 M! ~
move into Q_induct38 o" Z" c( Y, C! c
move into pickaisle.induct34 p! M2 R% ?: h+ |
while A_i<=30 do begin
7 R6 ~0 D% K! L1 r: ]2 j travel to pickaisle.con(A_i)
2 E. i( H# Z" e4 m! b9 N2 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 [+ g3 Y# c# ]5 x else wait for 10 sec0 o7 @0 S, P% W8 l7 J
if A_i=A_leave then send to die# X5 g( E, ^4 `7 b
else inc A_i by 1
1 ?; w2 U1 d, {9 \3 o end
$ ]0 V P7 B: a% F( Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|