|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 \( `) O+ E- t
2 @0 r0 x- X) ? J. W" ^6 `( 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中的数值,不知道会不会有什么不妥。1 s. F/ u; ^) j2 X1 w+ F, {
1 }: r$ M G8 f$ c8 H. I5 P1 v
begin P_read arriving
1 F4 q' ~1 s; e0 a, C* F while 1=1 do begin
F6 [4 q. E0 N' g% D# Q& i read A_tote from "data.txt" with delimiter "\n"
) Q# w0 X4 c O0 W/ t2 N% Z* D read A_time from "data.txt" with delimiter "\n"- [; ^! A, [3 e. O6 t4 C
read A_leave from "data.txt" with delimiter "\n"3 h& O& \4 N3 ~( a
read A_picks from "data.txt" with delimiter "\n"5 {* Y# y# N6 y) S, W5 S6 \
set load type to A_tote
& L7 ?0 S) N# @0 p/ \ if A_tote="tote 1" then set A_induct to 1
" O6 E$ C7 L9 [$ X. u else if A_tote="tote 2" then set A_induct to 2
) P% ?* f# ^6 z, Z# R% N8 @& l else set A_induct to 3
9 U. x4 j. r. d2 Y! t; C set A_i to 0
2 O' b, U' q8 r+ R5 |/ S clone 1 load to P_induction
5 G! D2 D3 B8 n* O- h: ` wait for A_time sec# b9 A4 a, m; `9 u
end1 I! j$ t* u. j: N$ O/ S
end
/ Q3 x; C' L9 n& i
9 ~ a2 k0 p* f! `begin P_induction arriving
6 y) y- r* ?5 `1 E. l) V+ F5 t0 I if A_induct=1 then clone 1 load to P_pick16 {6 t3 K/ u, C3 m: d. j$ H8 Y
else if A_induct=2 then clone 1 load to P_pick2
+ y3 }$ G; L* U6 D; H else clone 1 load to P_pick3
# `2 ^3 o6 E9 I, kend# y7 K1 R- c; _' Z2 ~
5 t- L2 {& B2 J$ Abegin P_pick1 arriving
6 D4 Y: Y. @4 r" A2 q; H set A_i to 1
0 r- t' b/ O4 J, w) P0 g+ o move into Q_induct1- q! d" q; V) x
move into pickaisle.induct1
, a) y9 C9 a& o while A_i<=30 do begin
( u- ?4 C @" B, U travel to pickaisle.con(A_i) V5 Q9 _1 I* F) |7 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Q8 S+ e; G) x1 n& T
else wait for 10 sec
9 [! `" a/ p3 k8 g0 M% X6 Z0 A9 G if A_i=A_leave then send to die
; W) Z+ N6 M8 `. z! B# |, { else inc A_i by 11 C8 Q' \& e" d
end
/ e) m4 [1 Y. h ]end& V$ j8 w$ J3 a
; |3 `$ K( t F' y7 h- d2 {begin P_pick2 arriving
& B5 |: O9 U, @0 d set A_i to 11
4 i6 R( \/ r; ~% a5 y9 e move into Q_induct2+ x1 w6 D% C8 v. m) s* f& x5 W$ E
move into pickaisle.induct28 H( ^5 A1 d0 P1 W: s5 `" x, |
while A_i<=30 do begin
6 a& e0 o. g F travel to pickaisle.con(A_i)/ z1 y' F w$ x6 S6 p8 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z( u: `3 |2 J( a: y# d
else wait for 10 sec: ^9 K4 L) U5 @3 a+ @0 j2 R
if A_i=A_leave then send to die
* B) \/ U) V0 K3 x0 J$ C. R- O else inc A_i by 16 ]& g9 U/ o. ?: X
end
" r+ O) Z5 q" _% oend
9 b$ ^! Z3 W. @- z% r$ Q% j) \! W* T2 p
begin P_pick3 arriving7 ~, r4 U( ~$ i2 m f
set A_i to 21
1 A0 [+ j. W+ J. T- t move into Q_induct3
7 Y/ c! H) V" b8 @# Y move into pickaisle.induct39 d0 f6 ~' Y6 p$ Y1 H6 M6 _7 b* a1 X
while A_i<=30 do begin
+ D# x$ x. t& D2 E travel to pickaisle.con(A_i); ~$ ^9 g0 b; y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' w! |9 ?8 F0 X; N2 W5 L else wait for 10 sec
4 B$ z# ?/ M* [+ U2 o. F0 C if A_i=A_leave then send to die$ c$ e& d i* Y/ ]4 O/ n6 a0 \
else inc A_i by 1
$ P/ ~- Z2 a8 r: G9 W end
/ x/ A! J6 [+ S, i4 n# Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|