|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) v o' F0 C$ o7 V* u1 S* d: f4 q/ d0 j+ J2 s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 N( _7 L6 c8 h
5 ?; W* r* k# Y1 w1 K4 B) `begin P_read arriving7 x2 K9 @7 D. \: F
while 1=1 do begin6 L8 ~& J) Z9 @* j" l
read A_tote from "data.txt" with delimiter "\n". b( i$ q3 i$ b/ @- K/ H; q. d
read A_time from "data.txt" with delimiter "\n"
( y& @6 r: d a) {1 d1 R: z+ @ read A_leave from "data.txt" with delimiter "\n"0 v1 S- B' [' [( s
read A_picks from "data.txt" with delimiter "\n"
3 P5 s5 ]' Q0 J" B3 l+ `4 q set load type to A_tote
! V/ N. A5 N5 ~: t if A_tote="tote 1" then set A_induct to 11 _; W" Q( A1 o2 n
else if A_tote="tote 2" then set A_induct to 29 i5 K. Z- L9 r+ v. l- o
else set A_induct to 3 ! j* z" v( s/ V' u P
set A_i to 02 h4 ?3 m: V, c+ R( g8 M7 x1 q7 `
clone 1 load to P_induction) v5 r8 F {+ @6 @/ K9 j
wait for A_time sec; m& u' ?7 r) j; y
end0 a* j/ q) J0 E1 z! O8 ?2 W
end
# x! H7 _/ ?- y& I; W( p; ` {* c( K I( q
begin P_induction arriving
$ H# w4 @: m8 o; e9 o if A_induct=1 then clone 1 load to P_pick12 v D; g8 Q5 l+ {
else if A_induct=2 then clone 1 load to P_pick2" C! O2 {- @& T+ h; P
else clone 1 load to P_pick3
- F+ x" n, t. ~+ V! [+ [; Lend7 N! S" H! ]% I3 X
5 }4 B) L* b. f) K
begin P_pick1 arriving m- L1 K6 \( I
set A_i to 1
! I# I9 l& o5 ?2 I- c+ a move into Q_induct18 B1 R7 O- {: ?4 @& S
move into pickaisle.induct1' ]! L# W6 V3 G
while A_i<=30 do begin
3 x" k( [* u; T$ y9 d travel to pickaisle.con(A_i)9 e0 `/ ?2 g* r$ @* d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 |9 h t) p) c! R5 ^$ b: J0 U else wait for 10 sec+ r) S ?1 ?" l% r% y, G* D! E7 h
if A_i=A_leave then send to die3 Q# [, T( z }. d
else inc A_i by 19 i5 _6 i; R) o% Y+ Y0 h2 N
end7 M7 J) Y/ u& n, r& D: W; S
end4 F" D3 m3 h6 d0 P: ?2 s) H$ t
4 X1 U% q( u$ G1 l# Sbegin P_pick2 arriving
/ F: l0 b% G) \( y$ s3 t- z' ^ set A_i to 111 C( E8 z; J( U/ p2 ~- _; {
move into Q_induct2+ o, t' v# D- `3 t: \! I
move into pickaisle.induct2" C. O0 x# C$ ]8 b! X/ k/ Y
while A_i<=30 do begin L/ @' g2 D9 Y: x5 b
travel to pickaisle.con(A_i)5 c6 Q C3 y# a6 k" W# g0 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! a( ~- k' T8 o
else wait for 10 sec
' `6 |. g- X6 x7 e! T1 k1 E& x y+ w if A_i=A_leave then send to die
! [5 d L5 p3 ~) R" ~ else inc A_i by 1
. ^. c9 m) Q7 K+ n0 |8 [7 ?3 w end
7 W7 f2 {3 a& p1 T! fend! d; z( r9 I8 e. [% g
$ @6 j# p& c) Z5 Y U
begin P_pick3 arriving7 e1 Y5 s; L6 \* O6 M
set A_i to 21/ o, F/ _4 E7 \3 @8 @+ C6 X3 C
move into Q_induct35 l) U& t! m' u z4 H/ L, V; R: N0 A
move into pickaisle.induct3
8 s$ v8 `$ @7 ]2 d" g) _7 c while A_i<=30 do begin
: z4 `! t: m3 @. o& {' h% S+ k5 [ travel to pickaisle.con(A_i)' ?2 R1 f5 m" F8 X, H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _5 u( ?8 _* e B
else wait for 10 sec8 w D- j" g3 m: @' ^
if A_i=A_leave then send to die5 k; b2 \4 U4 V% t* T
else inc A_i by 1
# f$ e- y# ^4 m! L9 } end: Z/ T" h/ \! \% _: ^
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,其它按你的 ...
|