|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 r- m& J W9 U* H$ Z
, Q$ k# Y i5 y9 d( i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' b8 Q. j, }8 K( b% `- B) k: c. O; @# Z. E0 M
begin P_read arriving
1 y6 @( F. v8 x& u while 1=1 do begin
( h, e6 \6 A5 |: h# o0 Y. `9 I' Q read A_tote from "data.txt" with delimiter "\n"
3 ^; U) P1 Z0 W6 R5 A& F7 M read A_time from "data.txt" with delimiter "\n"
/ f* P* Y" ?* z$ @ read A_leave from "data.txt" with delimiter "\n"
( J0 ~) X& E: Z7 u9 l0 } read A_picks from "data.txt" with delimiter "\n"
& R: Q, q1 Y0 o1 B" H set load type to A_tote, C1 O* d3 C- |2 c5 Y) k: e
if A_tote="tote 1" then set A_induct to 1/ N! u+ a, [5 b! D
else if A_tote="tote 2" then set A_induct to 2 t1 z0 U% Y' d( q) X% p
else set A_induct to 3
1 E; \1 u: Q* A( r set A_i to 0" w4 D- x4 N$ i }* p$ h( Z; i/ ~
clone 1 load to P_induction0 v- g- v' o+ L6 h
wait for A_time sec
, G* k3 y+ i4 d" K7 @ end
! ]# A' y1 f. L. Jend
% Y0 c: V8 v z" ]5 }9 a# C) p w- T8 ~+ V) W
begin P_induction arriving5 k- Q: J! y( A$ D P
if A_induct=1 then clone 1 load to P_pick1
+ t0 Z8 R3 N$ o2 A+ C: v else if A_induct=2 then clone 1 load to P_pick21 ]" {3 Y; I3 l4 ]
else clone 1 load to P_pick3; f/ r: @) B$ q5 L- ?" `; P
end
: x2 [" L. j+ l! C( m9 k
8 W5 j5 B) `; [% l1 P7 kbegin P_pick1 arriving( o1 M4 ~4 O$ J6 z
set A_i to 1
& g& G" H+ q3 r4 W1 E( O7 B" d move into Q_induct1
- _2 o4 \$ M7 q move into pickaisle.induct1, }% M( L& u) o! O8 e4 }
while A_i<=30 do begin
2 h: y& \' q1 x travel to pickaisle.con(A_i)7 M: R5 b, X' z( ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; n0 o# ^- E8 S+ v else wait for 10 sec
W& k5 J1 {& o' M" G" Y if A_i=A_leave then send to die" ?+ J3 I5 B4 ]5 i/ x; m( o9 Q
else inc A_i by 1
: `4 w2 K# n' Y end
7 ?+ B/ L% _/ C4 I( c; fend* f0 w- g9 y1 I% [3 U
3 u9 b. z: Z, x" obegin P_pick2 arriving
( W, V- w( |% ~1 R set A_i to 11( _8 B* H, N' Z$ ~. x8 J8 P
move into Q_induct2
, f, T, a$ @' D# ] B2 t move into pickaisle.induct2, T; E; D+ S" X4 w# R) z, _7 u1 [* s
while A_i<=30 do begin1 |1 Z- A6 Q3 w6 d# @8 b5 v6 j
travel to pickaisle.con(A_i)
+ ~; O- z3 a! C9 e1 y4 | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ]6 v! h6 O. h# |& _
else wait for 10 sec! ?1 g$ ?4 j# `: w& l7 D2 S9 [6 }
if A_i=A_leave then send to die9 h8 h# `; O1 O7 B4 l% _
else inc A_i by 19 l) E6 {7 O. m4 J4 {# Y. x" l6 a6 D$ f1 y
end
) n* Z5 o; Z+ g; I3 }end
6 a0 X* L+ ]3 y$ d: b9 O1 c1 r/ J6 S+ }8 h6 O% L3 d' u" k
begin P_pick3 arriving2 N% c' e' r. F. {1 D
set A_i to 21
5 \4 b! W. S6 g5 Q- e move into Q_induct3. x: m L* [! }+ d
move into pickaisle.induct3
C; D. U+ _1 D" x4 K! E" g while A_i<=30 do begin& b _0 K0 c+ W( W: u+ S1 Q
travel to pickaisle.con(A_i)+ J; b A1 k \: l p1 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V0 g6 V0 V" b) {" B else wait for 10 sec
2 y' F; U z# S" t! C if A_i=A_leave then send to die" P4 L' h% a# ?% i3 [4 m8 R
else inc A_i by 1! c4 x2 [" a2 k s t
end$ J4 r, g* m3 Q3 G
end |
最佳答案
查看完整内容
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,其它按你的 ...
|