|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- {9 c) D: Q$ T
/ B7 L; b/ g7 X# \8 X5 R6 p我的问题是,在每个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中的数值,不知道会不会有什么不妥。! t5 _$ i# S+ y! w& K
. p" C: B$ k4 `' I/ P( D
begin P_read arriving
& t- p/ f* s* ^) W5 ~! B while 1=1 do begin
% r1 \; M% |& u7 ] read A_tote from "data.txt" with delimiter "\n"
2 X8 ]8 x( M0 J/ R; Q- N read A_time from "data.txt" with delimiter "\n"6 S( ~3 h# m) R) u" ^! [6 _
read A_leave from "data.txt" with delimiter "\n") C( x' m* b5 X
read A_picks from "data.txt" with delimiter "\n"1 p' A% o; X0 {8 m g; N
set load type to A_tote. R. g2 t- k9 s0 C) ~* @
if A_tote="tote 1" then set A_induct to 1# W: ~8 e) `: f( S! T7 Q5 p
else if A_tote="tote 2" then set A_induct to 2, ] ?1 ~6 ?6 E! A
else set A_induct to 3
9 F# L9 I) w8 n) B7 V- { I. i1 p set A_i to 01 u: C# r7 {( l
clone 1 load to P_induction
2 {' L' I5 l# |- x- K' d wait for A_time sec
! Z& q& V' _ L2 Z% j9 U end" N1 N8 ^- |4 d2 [5 u
end
) i' f7 D X; y% u; R
8 F$ z, J! ~7 Z: N- C: Vbegin P_induction arriving0 ^. ]5 K r8 ^6 v6 I3 G
if A_induct=1 then clone 1 load to P_pick1# K ]/ N" \1 |) W$ T6 b5 h$ O8 {) I
else if A_induct=2 then clone 1 load to P_pick2, O2 N! v8 O4 ]8 {0 n
else clone 1 load to P_pick3
* A* \! R9 _4 q( p% k, Qend
" y }7 v2 _4 e* \
. [, L. l: y1 O& {. Bbegin P_pick1 arriving h4 N( ~$ J" q0 T* @
set A_i to 1
( r) H1 ^+ s! c' E6 ^ move into Q_induct15 r; Z& d" Z2 P3 H4 Z
move into pickaisle.induct15 ?8 N# V) l9 a0 ^2 f/ K( Z# K
while A_i<=30 do begin8 W! c8 P8 a& R" \" ^
travel to pickaisle.con(A_i)- b( u2 A" Q/ r7 F! @# f; @4 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, L+ h" k$ y2 G( i# l else wait for 10 sec# |/ p; `9 Y* H0 R! s
if A_i=A_leave then send to die& N5 z: z! k8 p# Y8 ~% F, u
else inc A_i by 1
9 ]7 M) j( {! Q end
$ J# i* j! w9 F1 i+ ?1 X6 A" Zend$ X/ P9 {* n5 k) a! `
+ H0 }. s! Y% D: z
begin P_pick2 arriving
0 u6 C$ N5 S6 B. A: u) G set A_i to 11: w7 b( W- k2 u& ?: F- z$ x
move into Q_induct2 `% \; p; o5 J& k' a
move into pickaisle.induct2
: z$ [# S! q7 J f" d while A_i<=30 do begin
+ ~3 x- m5 j( j travel to pickaisle.con(A_i)7 s1 D4 ?% y4 N) J V$ n, F( [: t8 y/ k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 w$ W- `+ C2 a7 n( ?; ? else wait for 10 sec5 X( M& ]6 u+ Y. b* c. A, w9 ^1 g
if A_i=A_leave then send to die( \5 c' W1 A2 ]0 J% B# D
else inc A_i by 1
& |% a, f3 a9 s: ^ end, r) I R3 U* [
end3 J6 Q* T9 R2 o/ e) R' ?( ]
; m7 J* G5 m0 }
begin P_pick3 arriving i4 t" F2 b1 r8 H1 L
set A_i to 21
' e1 a0 g) Y. ?: { move into Q_induct3
! s2 x2 {7 {3 X5 Y3 ^ z6 j move into pickaisle.induct3" a: p/ g9 y1 {- D1 p
while A_i<=30 do begin
6 H( c' g$ Y3 |- l) W" b0 F* `, q* V travel to pickaisle.con(A_i)
5 q5 K& v6 G# m- J& @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ d) u7 g8 A v: E else wait for 10 sec/ Q( g5 k; w+ n9 T
if A_i=A_leave then send to die2 T) G0 u3 V2 a) m+ J; R
else inc A_i by 1* e& N& N/ n& |8 P, p3 G q
end/ g. K: e* k% ^7 b8 a' @$ c
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,其它按你的 ...
|