|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' V2 Z3 D$ a: C [ s# C4 o
, \6 D) P9 B# |: J& Q7 M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; J1 }* D* X# y2 J* |. Y
. U) e' A2 _6 V% ~begin P_read arriving3 s) v; d1 C4 b3 _3 G& \/ l
while 1=1 do begin: L% F: K$ T1 M3 v, O: G3 k" D
read A_tote from "data.txt" with delimiter "\n"% n7 |7 k$ s" F9 r
read A_time from "data.txt" with delimiter "\n", Z: a* J1 F6 j/ B) E5 F, o
read A_leave from "data.txt" with delimiter "\n"" w* v7 Q$ U# G, ?
read A_picks from "data.txt" with delimiter "\n"+ K" B4 g& |% `. \2 x
set load type to A_tote$ m! X0 E4 j4 \- R3 k5 B
if A_tote="tote 1" then set A_induct to 11 G, z1 H2 ~1 E
else if A_tote="tote 2" then set A_induct to 2/ W9 d% i6 D7 X7 e8 W
else set A_induct to 3 2 W" S* M( n9 }& ^) [0 {" F
set A_i to 0& ^1 ^4 d( J* k" p( u3 \9 Y
clone 1 load to P_induction
+ n: D0 K2 C& R3 @ wait for A_time sec, \8 f B& O6 s; k
end, {2 s/ d( {. s) V1 W
end
) f8 b6 l# S: Q1 h, r9 M
$ I" }8 X/ ]0 H" l9 R( ~begin P_induction arriving
) D1 y5 P% m6 j" ]' I if A_induct=1 then clone 1 load to P_pick1, t |3 p7 z4 U4 o, \
else if A_induct=2 then clone 1 load to P_pick2: m$ \( T# v3 u2 t) t
else clone 1 load to P_pick3, ?, f- Z; q( G: _2 c$ c, j
end
! F6 f# u, B, ]4 c9 E
4 V( d( s* l1 o! nbegin P_pick1 arriving
3 ~( s# @- i1 ^+ G9 r4 \ set A_i to 1
$ _) |( m& W! U* Z& A move into Q_induct1
# K# H: q- e& Z) e* G5 a- i move into pickaisle.induct1
8 D! B8 Q% a: n while A_i<=30 do begin* O% I; ?) U' I( ?
travel to pickaisle.con(A_i)
: @3 Y+ s7 D5 S8 M8 s* e$ }8 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* }% _' P' p {' i5 o( E
else wait for 10 sec' |1 h( U" P5 M5 n, S
if A_i=A_leave then send to die
" Z- @ q" o+ R: n# t) r7 g else inc A_i by 1
" Y# u1 F* K0 u6 P/ f end
/ R( T0 }# i' a: H% T4 zend
7 {, [. q D% J
. e" N2 S" s# obegin P_pick2 arriving
1 f! [5 x0 j( I* B) m set A_i to 11
* [% p+ w# S3 t% y1 I5 ]1 Y# P, G move into Q_induct2
- |& s" _$ L' w: ]& @/ G move into pickaisle.induct28 _1 X$ B" Y* z0 t
while A_i<=30 do begin( o6 r: U( G9 n; | o
travel to pickaisle.con(A_i)
: C- x( l# I& i9 a1 z P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ p" Y+ Y D+ b. g: B* S else wait for 10 sec
( q+ D" l# S) T if A_i=A_leave then send to die
) s$ E2 Z* A' a else inc A_i by 1
, e1 M# ^6 d) g, X4 v$ }/ ^+ Z& P) n end
- k* n9 Z0 N. j2 t4 s7 ?end6 T# X. O/ C+ G; X" N' s
8 j% d/ Z5 c+ Y+ K8 Jbegin P_pick3 arriving
9 J8 O7 T( w k. v3 \$ [ set A_i to 21' T6 E& S0 U- N% }
move into Q_induct3# M2 m2 C7 `+ {8 A
move into pickaisle.induct3
* E$ Q8 F7 |0 A" T8 o S while A_i<=30 do begin
T1 e4 z) x/ \- b4 D( G travel to pickaisle.con(A_i)& u) j8 [, b1 c1 n4 H$ m. [' k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, E& r2 q6 |. x3 c* s- _; o' J M else wait for 10 sec+ }: e$ I# ^, q3 k
if A_i=A_leave then send to die
3 W3 q) \+ o' M' I9 p6 ^* q% E else inc A_i by 1
5 ^ f# o* k( z4 X end. r6 Y, E# z: M( k& ~1 l
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,其它按你的 ...
|