|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
_' W% N/ |* o( G; O3 Y
/ h' v6 \8 ~, d1 M3 D W/ L我的问题是,在每个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中的数值,不知道会不会有什么不妥。. |: F X! m1 s0 t
: R. d7 A. E+ m5 N* t+ z
begin P_read arriving6 A \0 h c9 j6 \! l
while 1=1 do begin
$ r% B( V1 _* i) r* ? read A_tote from "data.txt" with delimiter "\n") r* ]# `4 E3 N% \
read A_time from "data.txt" with delimiter "\n"6 U* ~+ p3 M$ Z6 a; F* p1 l4 u
read A_leave from "data.txt" with delimiter "\n"4 m; W/ c- Z2 _3 s- J
read A_picks from "data.txt" with delimiter "\n") M* I8 V5 u4 |8 L% g
set load type to A_tote
9 [0 P( F" {! n: I5 \ if A_tote="tote 1" then set A_induct to 1+ F1 ?) o* R6 R! }% @ r! k2 v
else if A_tote="tote 2" then set A_induct to 25 o9 c- d- ^3 r: Y+ u# p
else set A_induct to 3 7 {7 {1 K8 U9 D) z. _: N' ?, i
set A_i to 0# k1 @) Y) ?) r: C
clone 1 load to P_induction9 }4 y8 F( }! B& @+ L: O$ M6 p
wait for A_time sec
% R) C k! v( l4 u$ O8 _ end2 ^' j8 @) N& w2 j& \5 R" l; D
end/ `9 e6 T9 \. X7 H
+ H! |6 _8 X' R4 H; z
begin P_induction arriving
; O5 t" F3 f0 }, e' S if A_induct=1 then clone 1 load to P_pick1
2 I( [9 n, I2 [$ p3 _ else if A_induct=2 then clone 1 load to P_pick2
" \7 {* }8 ]: ]$ ^. U \ d else clone 1 load to P_pick3, H; H @* V d) D; v6 K
end8 ?1 T0 J, u$ Z I
( Y, }, j0 e7 {# s, xbegin P_pick1 arriving- s5 G0 h4 C6 M% ~
set A_i to 1. d5 Z; V4 Z1 \# M) q
move into Q_induct1
5 Y: v$ K* k/ i: K/ J move into pickaisle.induct1
' ]: F6 q2 x Z( u: s4 T while A_i<=30 do begin
! g& e; K8 v: D6 q Q! O& g travel to pickaisle.con(A_i)
2 c) F. w# w7 O! K# A8 g! K, \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: S9 B7 d2 _: z0 B, R H6 m
else wait for 10 sec
( l8 k& k& ]+ X" R$ o: w if A_i=A_leave then send to die
5 P; k1 r9 @/ V. U6 t else inc A_i by 19 D6 Y; T& W( L/ Q1 ?% X, C
end- d# y/ K, _2 o/ I
end" w( F ]: Y* S$ O, p1 q
- B0 k" S' u/ ubegin P_pick2 arriving7 s) B D' Q' d! }5 m( D
set A_i to 11- w6 F4 b) k1 E1 h" H
move into Q_induct2( M% [; b, ?0 T; h X+ R- ]6 v
move into pickaisle.induct2) Z; r2 d/ v% {3 T1 e" z4 d/ x4 v: c
while A_i<=30 do begin
. m3 j6 t# j4 r2 Q% K0 | travel to pickaisle.con(A_i)
- `7 p' I* @! h; l/ X; ~1 m% Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' d' {* r9 K. y else wait for 10 sec$ h% L" l" W- ^$ z( a& v
if A_i=A_leave then send to die* l4 f/ c! t/ J# |! R6 S+ v
else inc A_i by 1
& ]* T# O" x9 X/ M8 E: z end
5 f' c- ?! l* Gend
9 {+ g+ w1 f0 } l P5 V' v% E; E- [
begin P_pick3 arriving6 }, C/ c. Y% u
set A_i to 21
3 h) Z: m7 g# X$ N. C move into Q_induct38 ]9 Z. Q; w- R* \
move into pickaisle.induct3
0 ], {0 @4 \' \4 l while A_i<=30 do begin, p- P) d' V1 ?* y6 ^- }. z! Z$ ^
travel to pickaisle.con(A_i)5 n$ e1 W/ e: l! ~5 R. L) \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( m3 {( s1 ~3 U; {- o# T
else wait for 10 sec/ n& x* J9 M0 s; s" F
if A_i=A_leave then send to die
) n+ H$ M0 K# d+ }; s! H else inc A_i by 13 B- G2 C' d$ S
end5 i7 F" c7 I# P7 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,其它按你的 ...
|