|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, X$ L4 r5 l6 s) K1 F$ q8 V/ {; J5 S+ E& y/ J# w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ w' ?, I7 C! y# W
0 ?4 }& X* D$ d g* Tbegin P_read arriving
+ f S. W6 @/ ^2 i* e o; @ while 1=1 do begin3 p9 E9 Q' a% H1 j8 X6 q
read A_tote from "data.txt" with delimiter "\n"5 A/ p. r& h$ a' }' R+ N% Z; G( }
read A_time from "data.txt" with delimiter "\n"; R" C; e! ]. j& f: ? J# h& C
read A_leave from "data.txt" with delimiter "\n"4 |9 J' ~, l' r* H
read A_picks from "data.txt" with delimiter "\n"
- @+ z0 w6 t- F set load type to A_tote
& _+ c; u1 |5 Z z4 [# _" S if A_tote="tote 1" then set A_induct to 1% Z1 e0 v, b, d* u9 _
else if A_tote="tote 2" then set A_induct to 2
, F# `& g. q- ?+ Q) b3 b else set A_induct to 3 % K2 O, ?, D8 t7 e8 T ~/ H
set A_i to 0" h5 b- x8 f3 K# z: w3 E1 _/ D
clone 1 load to P_induction
7 S0 `, p. f6 G! N2 s* B* w: D wait for A_time sec4 k, a* i, \& f' w$ H1 L
end
" t! g, N' Z9 v/ e3 Fend
- o# M' i0 c) A6 ~5 w
5 s) ~4 c$ T, I1 e% G$ }begin P_induction arriving
! q. ^, N+ s1 m: a if A_induct=1 then clone 1 load to P_pick19 b6 w; P6 U5 A) ]8 F, ^
else if A_induct=2 then clone 1 load to P_pick2& q* D4 e0 k$ b5 q5 i
else clone 1 load to P_pick3
; o$ n* O# ^1 Z0 L/ ~8 x- K3 ~end
; ]9 E! ?0 P) q5 h- j4 U9 ?/ \/ I, t' f
begin P_pick1 arriving
6 ?9 l( s" b4 G( f2 Z9 b+ K [ set A_i to 1
' s2 H- h3 N; d1 ~4 j, n move into Q_induct1# i7 d* D! j" o+ k. d: W# |
move into pickaisle.induct1
0 z- p+ b$ e/ W; u+ t! Z" {6 M; h4 I& I7 \ while A_i<=30 do begin
s# g. y$ L& a. a( Q6 T travel to pickaisle.con(A_i)8 B8 |: t- g: ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 t/ ~! G7 A! x1 [! K* Z4 N, S& A9 m8 n6 ~ else wait for 10 sec! Q; y, E* w8 D: q6 Z# M1 A
if A_i=A_leave then send to die
6 W9 | I: ?1 P5 w0 ~' ~' o else inc A_i by 1
: m6 S8 S6 D' Z f& C b3 \: F end% j( r% u% Z' ~! p. \4 q
end
i6 T2 H* B' Y0 V, Q* e/ @1 }8 h# h1 o9 c* A0 N
begin P_pick2 arriving
$ I! O% h/ @/ d X" ^& C set A_i to 11
7 c8 \. K9 J) C2 ~; e7 P4 F move into Q_induct22 W$ M+ ]: t+ c
move into pickaisle.induct2) I) A! b$ G. Y
while A_i<=30 do begin6 d1 l2 N" E1 R: H/ h
travel to pickaisle.con(A_i)+ j) y- V& o8 j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% _, U" ]. {/ U9 L
else wait for 10 sec2 `. V$ f j3 m9 w6 Y; w0 V
if A_i=A_leave then send to die
: g" u" b/ o9 W6 \* a O1 u else inc A_i by 17 o: `; h% o6 k0 s% g$ k) O7 Q
end# O$ n' V9 R4 U5 k$ ~& @! a
end: ]0 K& r' {* q% B7 P& C4 w
0 N O8 K% S# _9 y; T0 ^* ^begin P_pick3 arriving
" d$ P- E; F- N( h4 x$ i; r. D set A_i to 21
' q, ]; {7 M9 O7 A/ ], n8 R, t; s move into Q_induct3
+ G' U: E' w2 K move into pickaisle.induct3$ d# L s! D7 P& y: Y' d; T
while A_i<=30 do begin
' a+ O% N6 O/ d. Q3 X0 F! \ travel to pickaisle.con(A_i)0 m& a9 X) a" y/ A9 m1 S: Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 e$ n0 w' V/ `; G! ~- f# s& m
else wait for 10 sec+ M( ?+ L& l1 r' c
if A_i=A_leave then send to die# @' `& N( U1 o: a+ \
else inc A_i by 15 }+ _7 W5 \' L4 a/ |$ R
end: f5 u( _. _4 @5 {8 N! v
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,其它按你的 ...
|