|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- T3 K" \: h" n& H2 ]( ^! z7 [) y; e) f. @0 R
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 B4 G0 k; u! z9 t) t1 q
" r' D) e' |! ^begin P_read arriving& W$ i) x8 e( y2 I* q6 {& a! H
while 1=1 do begin
" A* R1 f! [; ], Q) c1 f read A_tote from "data.txt" with delimiter "\n"
' _. D4 R5 H9 ]( y8 x) a6 T @. R z read A_time from "data.txt" with delimiter "\n": Y- h2 J9 @; X
read A_leave from "data.txt" with delimiter "\n"; W8 d. |4 M0 x
read A_picks from "data.txt" with delimiter "\n") m. w+ O( [- L
set load type to A_tote! e0 Z0 n s+ F+ O; {& L: y7 A9 D' f
if A_tote="tote 1" then set A_induct to 1* e# l9 v3 O* E X9 M) f
else if A_tote="tote 2" then set A_induct to 2' [+ L" [' y0 ^5 ~- D ~- \8 w
else set A_induct to 3 v2 {# V9 Q% n$ \7 }. E, m) Z/ a
set A_i to 0; ?2 S- e! G- r. r0 E+ F
clone 1 load to P_induction! w" i5 ]; v% ~1 [1 j' j. L* E
wait for A_time sec) E5 Z2 i2 u8 D
end; G s5 o2 d$ o" W7 y8 R
end
7 k c0 e/ m" m: w8 ]1 {" P
: p1 c; W2 M! t6 D" rbegin P_induction arriving& x: F2 M3 ~" T- S9 m' H0 R8 l
if A_induct=1 then clone 1 load to P_pick1
8 s6 v' `' I2 X$ p' H else if A_induct=2 then clone 1 load to P_pick2
* g- K# t J" s5 t else clone 1 load to P_pick3
, c; c2 t' k" v. \4 n$ j9 ?end
5 V+ k0 n" ]# L7 V) f
& s$ ?. ~4 C* F) a6 {* Dbegin P_pick1 arriving3 C& ^ r5 S. L. i5 t/ y( z
set A_i to 1
# |( E4 A" m% v( r! Z/ v. l move into Q_induct1( u# o/ H! j( o. x/ i4 O1 J
move into pickaisle.induct1
' e g5 |0 |5 `/ j3 H$ t5 C3 y# g4 B while A_i<=30 do begin u+ x& K1 L6 V( v) |2 G
travel to pickaisle.con(A_i)
6 L U$ u1 p( @8 W# q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# o# P3 b) D% r; N2 y else wait for 10 sec
* [+ [; t1 S9 v if A_i=A_leave then send to die
( o0 ]% G5 N+ `2 m G7 d else inc A_i by 1
5 a6 ~7 _$ O/ i+ T0 y; a' A3 Z end! Q5 G$ I8 [6 W5 C j, V, f' g9 I5 v
end- T/ A6 f2 `9 z
3 ]7 a! U- G0 Z- p g
begin P_pick2 arriving
. n3 H5 a8 U/ ?3 f/ H set A_i to 119 n/ K! P* @1 o7 l6 r
move into Q_induct2
, h/ @( R a" N3 B* K, b) t move into pickaisle.induct2( ~3 ], `' _$ P) P
while A_i<=30 do begin
* Y% b1 m8 _! Q1 B4 e8 Q travel to pickaisle.con(A_i)6 c- Q6 o4 p0 }* s9 S# U% _5 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- x- r) s" A& x$ F+ l else wait for 10 sec
, f, [+ }4 h; E$ Q* P, a if A_i=A_leave then send to die9 G. x% q4 y' ^* v d+ R
else inc A_i by 1
% W+ K. y% R4 q1 X, ^ end. s) g) G. b! o8 z' A
end
) W S! C' |0 C; w3 g" i4 b+ m2 J7 T7 \6 a; N( z
begin P_pick3 arriving7 m, R; A; c1 |4 p4 ?1 w7 u
set A_i to 21
2 I* H# ]! t2 D* W8 t+ T Z move into Q_induct3, {) b7 _$ D; K( M' V* m
move into pickaisle.induct3
* x6 |, \5 t2 [2 t while A_i<=30 do begin
* L% _+ z$ L6 d2 w" O( I travel to pickaisle.con(A_i)
" a7 b$ z& S# D3 ~$ ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 v% [. c, \/ ~4 O/ Y; v else wait for 10 sec, V( N5 r( d+ T& }4 I
if A_i=A_leave then send to die4 _1 z* p8 x) K6 R1 ~5 Q
else inc A_i by 1. E* U. A& m o n$ L' R/ O4 n
end
9 f! g2 [5 `; c. Send |
最佳答案
查看完整内容
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,其它按你的 ...
|