|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ e' o# |9 o0 B, O. m- S1 r+ H, m" s9 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; ?3 g5 U# J5 z$ D# C u4 h4 F$ w* p
begin P_read arriving
/ M$ C2 k4 ~- T* l. ? ?0 A Y while 1=1 do begin
8 L5 k0 O2 M7 T) w* a) p7 Y read A_tote from "data.txt" with delimiter "\n"
9 c# u" o- z4 z5 ]- _& p7 y read A_time from "data.txt" with delimiter "\n"% x4 l, A- W6 v+ P: {- C0 ?+ k
read A_leave from "data.txt" with delimiter "\n"
# `0 s* ^, D7 q& q5 y, Y( S) ^, J read A_picks from "data.txt" with delimiter "\n"9 A/ X5 n* s% d" r& |
set load type to A_tote- q( h7 \: M& M L" I/ C2 | S
if A_tote="tote 1" then set A_induct to 1
0 m( u ]: M5 z9 b else if A_tote="tote 2" then set A_induct to 2
5 n! Q/ n1 y3 T: T! \ else set A_induct to 3
5 A$ ^% O) q3 g J! L. W set A_i to 0* c& U; Q0 e/ f4 h d
clone 1 load to P_induction
; v- V& J& Y9 M# ~" G( O+ W+ z wait for A_time sec
2 P) Q6 l5 m( K/ d( q end
- M. J$ [2 k- g! @& ^end
5 h+ j% I6 c4 Y; H
5 t$ O( T1 W G" nbegin P_induction arriving
, B4 D- A+ R& o. ^" N, ^, ~/ t if A_induct=1 then clone 1 load to P_pick1
( Y+ a# W+ i7 ?3 O else if A_induct=2 then clone 1 load to P_pick2% H5 B; D8 _" H/ q2 m3 v9 O; _
else clone 1 load to P_pick36 O% o; O! o J4 x% a7 I
end, P# e9 }4 s, A8 F5 } d
* v5 [3 A' Y7 \. ^7 j3 z2 Z
begin P_pick1 arriving3 \2 L# h, p% {% d3 N, D" v6 r; b
set A_i to 1
k! v) `1 k: o( E: ?" e move into Q_induct14 M3 H4 G4 U) S; i. a! |
move into pickaisle.induct1; \# K# O! `6 ^" W& M0 e4 l. J
while A_i<=30 do begin
7 Q) y0 u* J& F! Y% |( J$ O9 k travel to pickaisle.con(A_i)
; B5 Q5 o( a7 v* i: t) ?& O1 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: g7 s t' q0 |3 z' L" m else wait for 10 sec! Y6 N. e4 \" P" N1 T! a
if A_i=A_leave then send to die6 |! C- a8 i. f: s) u: }' G
else inc A_i by 1
& S% C8 {) J' ^! r+ H' ` end
. Y: Q' s: ?1 fend$ V# n" U' j! T! b6 H" a
# q, S5 q0 \) E {6 R$ ~
begin P_pick2 arriving
+ s" D0 ]! N Z+ Q, v set A_i to 11
; q. p( l8 F% g) f2 l! r% t move into Q_induct2
, ~5 ]1 ]5 x8 W) I! l) i move into pickaisle.induct2
( `7 O: f( q r/ e$ C8 s while A_i<=30 do begin; O7 {% o, d& h$ }3 K4 U9 P
travel to pickaisle.con(A_i)2 |9 V) J& L$ D! ?/ H( ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X& @+ \/ k$ m( |5 ~& H& @" n8 d
else wait for 10 sec
& p) O! O3 |: w L6 f! G if A_i=A_leave then send to die' r/ o" @% M' r, r
else inc A_i by 1. L; M& S& ~4 q: d
end' t0 ~- N/ R3 z
end
) w" \$ S( l& |1 P. j, M
# o5 I# B5 S* k! Q- }9 ~begin P_pick3 arriving
$ ?$ u _. B! b7 v5 K! ~% f4 s set A_i to 21$ t9 v2 Q7 U: p- p. i
move into Q_induct3
7 Y6 N2 s, T' `9 E5 Z- | move into pickaisle.induct3$ X: y; \. E! l- F! C
while A_i<=30 do begin& h5 ^* R. q9 q7 `' n7 g% o% r" Y% o
travel to pickaisle.con(A_i). l* o, _: v3 F' C! r& w; ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: M& D' P1 T" b9 g, C) C! L else wait for 10 sec8 k) H/ T& I$ ~7 E: \% I
if A_i=A_leave then send to die
3 [2 S5 D) |/ s) d9 o. e( z: Q+ L else inc A_i by 1
, h. f; h; v7 k end) K, b) `8 X8 }
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,其它按你的 ...
|