|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, A# {1 @( Y% H. _) o
0 {4 B/ ] ]7 Z3 h" i: V我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) m- q6 M) D i8 E9 c
5 `9 [) L c q* R9 p0 ~4 Gbegin P_read arriving
0 e( a% R; ]5 B5 ~# p while 1=1 do begin" Z1 ]% b3 M! j3 O( b5 D5 Y' W
read A_tote from "data.txt" with delimiter "\n"
% i' t5 b0 J0 a# G. [ read A_time from "data.txt" with delimiter "\n"
" A1 L3 m+ m9 F. T8 x read A_leave from "data.txt" with delimiter "\n": ^. b. I5 P% O1 z8 }7 C
read A_picks from "data.txt" with delimiter "\n"
4 A% ~% O4 Q. p( t0 s! q) M. J set load type to A_tote' }+ v) W b$ n6 l
if A_tote="tote 1" then set A_induct to 1
& M/ F! T% } R( |8 U2 k else if A_tote="tote 2" then set A_induct to 2
, ~& ~( B5 i% ` _5 g0 F1 D else set A_induct to 3
! [& I' z- X2 D set A_i to 0
6 }" g0 x% B/ P1 g1 P3 _1 m" s clone 1 load to P_induction
. g S8 } q# ~+ U wait for A_time sec
4 P, a" u3 T" |7 W" u end$ i, _, l2 G. n, V$ H* H
end
0 Y; Y* L( Y7 d9 L
- C# {9 n: Q' K! H/ Wbegin P_induction arriving
5 g" V4 R6 N% T3 z if A_induct=1 then clone 1 load to P_pick17 }/ M) K# p% |( j# w# E: a- |
else if A_induct=2 then clone 1 load to P_pick2
! E. y3 W9 Z' ~4 _" { P X) w% {/ V else clone 1 load to P_pick3
2 G; H/ I$ ]- \' a' f. B/ W; i1 p' E8 Tend
5 e7 b/ g( E; W4 z9 g; f* H# v# q& E# U4 H7 x! A+ x! Y
begin P_pick1 arriving& `. W& b z# k3 h7 h/ ]
set A_i to 1
" J% C# [1 ~8 k. C7 Y9 I# k- P$ h move into Q_induct1
1 j; p5 f# u' H z1 C- s8 R move into pickaisle.induct1
2 P$ B% f3 D$ d' D2 u; S while A_i<=30 do begin
$ W) G; O5 b! s travel to pickaisle.con(A_i)
6 E* X' b; _$ E9 r! N& j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# c! J, P5 e* o' m else wait for 10 sec3 O; v6 x$ e G0 E1 S9 l
if A_i=A_leave then send to die1 |( x1 h7 H Y _9 s
else inc A_i by 1
( T* m" z5 B+ }/ X; j) s end" W. t, A5 D/ b5 O! i8 L/ Y" _
end6 B7 S1 f2 u+ u* G* H D6 i
! G) m' A2 E6 n6 S/ o
begin P_pick2 arriving& \. P% T2 b# R. P6 k
set A_i to 11% W) H* A& t# K0 o3 G
move into Q_induct2
7 p! d! e/ h- }; q move into pickaisle.induct2
" f5 I6 t9 ^0 ], l while A_i<=30 do begin
2 m/ s7 ]" ~3 r, |! M. T: } travel to pickaisle.con(A_i)( p: ^' Z n+ V8 K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 y- n, M; I/ b# T( ?
else wait for 10 sec1 D9 y! R8 @/ `# f
if A_i=A_leave then send to die
+ c; L u0 @& n( u" m else inc A_i by 1; e! w# V! S, j
end: k: ~" L: |' u. b0 ]: n7 b
end2 U- `+ K: [: g0 b
5 {! h. M. f$ F+ U( u! p8 {/ wbegin P_pick3 arriving- f+ u4 e& N. C) [
set A_i to 21
% P' `% M' S) e y: M move into Q_induct3( d& z6 X; S4 d* O2 z$ h
move into pickaisle.induct3
' d9 F! E- O2 h" [! _( G while A_i<=30 do begin9 i4 b$ r: K3 R' h1 x- H$ {
travel to pickaisle.con(A_i)
( u0 J& z! Z. x! u7 B9 f, } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec v, O: _; m' h9 _8 i: V# i
else wait for 10 sec
" y# k, w0 S3 g if A_i=A_leave then send to die2 n6 ]4 _& J# {' y
else inc A_i by 1
/ G; x" \: [7 t! K end
( b! e" j0 k6 r9 p6 Lend |
最佳答案
查看完整内容
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,其它按你的 ...
|