|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 o7 h: p% @* \5 p
" Q( v( q ^/ s5 b! e; C' c# e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! t, w$ ], T+ b! l6 N8 B/ a! f8 p3 e: m1 w1 Y5 e
begin P_read arriving: ^1 j" n! P5 ~% ]( x* |% D
while 1=1 do begin
9 z- f* F0 s* a7 u" }) } read A_tote from "data.txt" with delimiter "\n"" L9 L/ Y% i9 h4 X6 a0 F" }* l# X
read A_time from "data.txt" with delimiter "\n"3 O. v6 H; N, @# V- c5 Y
read A_leave from "data.txt" with delimiter "\n"
4 u1 b) \; x( N$ M. h; z read A_picks from "data.txt" with delimiter "\n"
, u/ D! N+ X) |: I" v# E6 h set load type to A_tote
7 z9 x! Q4 M+ i* f if A_tote="tote 1" then set A_induct to 1
4 Z) P/ Z! D. k* f' v( P# B- ` else if A_tote="tote 2" then set A_induct to 2
7 ?2 e9 L( V) B7 b+ n; j/ } else set A_induct to 3 e+ { f- b7 l) w
set A_i to 0
% @2 G1 r( u2 ^0 L( m$ w J clone 1 load to P_induction3 M) f3 P! c$ e/ v2 s
wait for A_time sec- i3 [3 u) y% m( ?4 \8 t
end& O6 |# a# A' ]: o" @; S+ y
end4 E l, k2 b9 u; S; m, G+ J& V
7 \ a# s+ H1 y* M; X( o
begin P_induction arriving4 l3 o. c1 Y: h* {
if A_induct=1 then clone 1 load to P_pick1 [4 w# \9 z* O- y* K- U8 }
else if A_induct=2 then clone 1 load to P_pick2
( g8 Y7 q% o r/ l6 G7 c# ^ else clone 1 load to P_pick3) r$ B, n% _- C+ e6 l" ?9 \
end
, V4 o$ ]1 o" R3 C0 y* ~0 l. w+ \! C0 p7 y: d6 N8 O
begin P_pick1 arriving# e+ a, k1 x1 ~
set A_i to 1& W4 w8 v$ W8 M5 v1 c3 F+ |
move into Q_induct1* _! U! ^1 ^# I% I2 E" a" W& w! A
move into pickaisle.induct1
5 [( b4 ^- `: C2 X$ t while A_i<=30 do begin) m) v& h" v1 W
travel to pickaisle.con(A_i)% C4 O6 O+ H; c( N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 ^$ @$ @2 E6 J- U! o2 E. J- \! s else wait for 10 sec
# Y5 j2 p# W' E if A_i=A_leave then send to die' D D- V4 ]3 q1 h) v
else inc A_i by 1# {" n* f, t& W* G$ K2 z
end# T( a7 a7 m1 f- d Q
end
, M: P) D! B- U7 e7 S L. }
1 X4 U$ p- o4 D. d/ [5 h+ | E. Jbegin P_pick2 arriving
4 h- E0 M0 p: P w3 { set A_i to 11
( ~. G$ Z/ X: d f3 D8 f+ L& o& u! a9 u move into Q_induct2
3 d9 l+ v- n/ d, i move into pickaisle.induct2& m7 D- k4 O9 \
while A_i<=30 do begin3 V3 B& g% W( h
travel to pickaisle.con(A_i)
/ a9 A8 G: J1 r, P9 |* F( X$ E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# `5 u9 {6 s3 `/ k- d else wait for 10 sec1 ?/ M- S/ Q9 s
if A_i=A_leave then send to die- v. g1 ^0 Y: _: Z- q$ u P
else inc A_i by 1
! ?3 M+ Q& b1 r- R }; G8 x end
# R2 o( m4 Y6 s$ H# Z8 ?end
: C. l& R E6 C/ F0 p* c4 g# ~% h* F5 w5 p# ]
begin P_pick3 arriving; E) Y1 k" B1 B' Q' M) `( J2 E
set A_i to 216 V9 U) E4 I$ z5 ? K. T% M
move into Q_induct3
" Z/ z/ t/ W% g3 J' P9 l move into pickaisle.induct3
6 S& M, `4 S9 M" n while A_i<=30 do begin' P; ^7 a0 P9 [: j# g& P
travel to pickaisle.con(A_i)
/ l/ X$ w9 }' I# Q4 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! I" |$ S+ D( M6 s# A5 K* C
else wait for 10 sec
$ K( u# L P# r# L5 |9 R if A_i=A_leave then send to die
* V# q# R7 V7 F' ]/ G/ u) [ else inc A_i by 13 g2 i7 X' g- o! ?" I: |! n
end
7 _4 |8 P( N* I' J& x$ z) [9 O9 t {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,其它按你的 ...
|