|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- W! O2 @. [5 Z, n+ @* p; Q8 ]3 G+ H
1 E- n& _7 c& ~" C# W4 }& V/ B! x# x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 b8 R* O* C" s8 l+ }' @" o g
6 Z+ O, ]! n' N' H: V9 `begin P_read arriving
2 u5 q7 Z$ Y3 a4 |2 F while 1=1 do begin$ |1 h7 e$ V0 z) P" h, W2 V& E
read A_tote from "data.txt" with delimiter "\n"2 q5 o1 u+ C3 e% M0 c
read A_time from "data.txt" with delimiter "\n"3 d+ @9 E2 U# s! P+ e# q
read A_leave from "data.txt" with delimiter "\n"! d0 j4 ?7 P9 k: p
read A_picks from "data.txt" with delimiter "\n") r0 L# F! e* Z, N# ]6 a; t
set load type to A_tote0 a/ a0 g: r" g" ^
if A_tote="tote 1" then set A_induct to 1
: J% }/ @! Q/ I3 R- T7 Z s0 c$ J else if A_tote="tote 2" then set A_induct to 2
u9 z7 W, ^" K9 h0 h else set A_induct to 3
3 R! z2 K( _8 y set A_i to 0
% o0 r( ]7 H1 C4 ?1 P z clone 1 load to P_induction! [+ q3 v: @% d; {3 h/ I
wait for A_time sec, P: d; H' ^ G7 W
end
! X/ {, L+ O. {7 p; r6 B+ G% Cend
2 j3 W: c- t* e2 z+ [; ?3 B9 G
! Z5 `' f( x# a3 H/ s: A' \; e) hbegin P_induction arriving5 E3 E" x$ \4 S
if A_induct=1 then clone 1 load to P_pick1
; z5 }& a- w0 E else if A_induct=2 then clone 1 load to P_pick2" i6 |; J6 N2 d$ I& o8 ?3 T/ o# ?5 [
else clone 1 load to P_pick3 [& d3 O# O4 s6 K/ b' @
end
" G# Y+ D6 V0 R' P) w7 m" s% _; S0 L
; w$ b! ?5 u5 c: [( Q/ Y4 Q6 _begin P_pick1 arriving
% P, \" B& d. s. @ set A_i to 18 f7 |) r2 U( h3 ]4 ?
move into Q_induct1: O5 o$ Q0 d3 q( B( G
move into pickaisle.induct1: l2 g+ l7 X' }+ S2 e
while A_i<=30 do begin
7 y2 Q. V% I$ P% u, l% ?/ W travel to pickaisle.con(A_i)
5 F/ L6 P) W8 Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! k, N# N9 Z& f% k# P7 K else wait for 10 sec
3 c4 R0 b" a4 O2 |, Z5 i1 p if A_i=A_leave then send to die
( {- d4 D& E( W else inc A_i by 12 R8 I, c; {. M, n
end
6 R; W/ l& {7 ~0 Iend: s0 v9 R% X# v- K, k) }, |
5 g5 X; `) P+ Z* ]5 [- p; W) H
begin P_pick2 arriving
, Y$ ?' w; N) ^ O' X/ R5 X set A_i to 11
1 t. }) ]5 q7 M5 d v move into Q_induct2
9 w" D) w8 J x# q move into pickaisle.induct2) I) N9 _; j8 Y5 y. W) i
while A_i<=30 do begin
! l& Y1 e3 r, |( Y1 ~* v travel to pickaisle.con(A_i)/ n0 j- B4 ], g0 Y" }8 U6 ^& T* z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* s6 M& r! ~9 ^; m) X; @- P/ R- t else wait for 10 sec+ l1 q; m5 H, g
if A_i=A_leave then send to die
% l- f7 |3 c! `6 Q5 `7 t9 y else inc A_i by 1
7 N( d% f* r! P: n end
: r. {6 U1 N* `% xend4 ~7 b+ f4 u; w) T
) [/ W8 v/ E, X3 q- g
begin P_pick3 arriving$ v& ?6 L/ m V5 W3 z
set A_i to 21
0 P5 _, |6 _0 }( ^# x( J6 M move into Q_induct3' w4 c$ A% s" w
move into pickaisle.induct3
: [2 Z0 [9 j6 P; O3 _ while A_i<=30 do begin
9 }9 O7 N' Z k( l: M/ i! u, l! W travel to pickaisle.con(A_i)+ M' e) h* k% t# J$ Q: w7 z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ C+ J( p/ C5 y3 Y else wait for 10 sec
$ z6 u3 T4 V/ l* E! ]- E if A_i=A_leave then send to die
8 e! L# _4 \. H% s% t else inc A_i by 1
/ U# m7 s% N# B; q end
% [1 e5 C/ b" _) Y5 Yend |
最佳答案
查看完整内容
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,其它按你的 ...
|