|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 N. A/ h; z& b% c7 p$ f, S5 o
1 ?' ?! ^2 _' r5 |5 N% L2 y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% R* M4 s- L* I4 i+ R5 A
- z4 {8 g+ h! m) [* T7 m9 rbegin P_read arriving
" ~& }1 V: |8 a2 B. r4 d G while 1=1 do begin7 F7 z: ~/ u0 r7 f1 r8 ^# }# b
read A_tote from "data.txt" with delimiter "\n"
2 E3 P8 |6 \9 s: U3 v, O: ] read A_time from "data.txt" with delimiter "\n"" m5 s4 c% J1 P' F* b$ e
read A_leave from "data.txt" with delimiter "\n"
B) T9 |2 B1 i% `! \% j* ^ read A_picks from "data.txt" with delimiter "\n"" K0 L. _* A- J8 V% F
set load type to A_tote5 l, k! `/ q$ l' a7 {- |( t! F/ R
if A_tote="tote 1" then set A_induct to 1
3 t8 t ?4 H1 s/ K2 N2 J; V- N else if A_tote="tote 2" then set A_induct to 28 ^/ s( C" B- N3 P8 ? I" m3 L7 w
else set A_induct to 3 6 {5 \. `; U2 {' c* J! G7 e* G1 [, z
set A_i to 0
. Y+ X& {! @, q- N) B" N clone 1 load to P_induction- V, I% `, p0 N
wait for A_time sec
; b5 D( { O6 n z7 F end" i2 t% d; `$ k" |
end
$ k6 @- b5 N& l8 ?6 p
2 o: Y3 ?8 w: X$ Vbegin P_induction arriving
# N1 L$ O* J' u, |; ~0 c9 W if A_induct=1 then clone 1 load to P_pick1
% ]1 g+ F! [% @4 U else if A_induct=2 then clone 1 load to P_pick26 k; w d3 P8 h5 t+ F8 K) Y: R
else clone 1 load to P_pick3* q, f; {. |0 Q }( G# G0 d
end
* z6 A2 U: o3 X2 X* a* {
7 ^% I& F, M* nbegin P_pick1 arriving
8 s, Y: y; `8 R+ \. o( p set A_i to 1- G- G- o8 h7 J+ t
move into Q_induct16 ?$ d' U8 ~; c
move into pickaisle.induct1
: z$ J1 Z( L1 e! T J while A_i<=30 do begin
2 _0 c4 n& B& }, a8 k' G travel to pickaisle.con(A_i)" j* U; D9 s( M+ _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 y% }( v/ ~* h9 z; ? else wait for 10 sec
6 N& ~% Y& |0 s; @( \- ` if A_i=A_leave then send to die8 w: C2 _8 g9 ^9 d2 K* r! r
else inc A_i by 1% N' ~) A) I$ ^1 v$ ?
end
0 ?& ^- [) {8 @* ?; a( Fend
5 I, [& L: B4 d6 ]9 ^4 w
9 [: f% ]" _, b9 qbegin P_pick2 arriving
3 b/ E1 |3 q/ n+ d; P6 w: j set A_i to 118 H5 k. d" q( u1 [8 b
move into Q_induct2
* U+ d4 l7 o2 p4 Y' d4 T move into pickaisle.induct2
; c8 s( Q& V" c# `! Z2 { while A_i<=30 do begin7 @) s1 @1 P. u+ n( Q
travel to pickaisle.con(A_i)
* N9 h5 y5 I: i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec o( v9 {1 Q# O9 ]7 d$ t7 r5 F
else wait for 10 sec
6 r; s& k0 [. a if A_i=A_leave then send to die
$ G1 l; H4 s4 n else inc A_i by 1
7 k! O0 F/ L/ T* b |6 U, K end1 w& x9 B! D0 } f' t
end
) Q4 K2 t, O7 C& b! l5 z, c
, ?& }7 {3 O$ ]# [begin P_pick3 arriving. w' e- \( |! W& `
set A_i to 21
% c% D/ u% u- ]2 n' Y1 Z+ u5 B move into Q_induct3* g" E9 B9 p& M% R4 G5 p
move into pickaisle.induct3+ o' T) r3 N- ?: W
while A_i<=30 do begin) J" j! K# ^% H
travel to pickaisle.con(A_i)
& G0 |' `! t1 |( R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 V$ C! c. N3 m f+ t else wait for 10 sec f }' l: n$ u. B" `
if A_i=A_leave then send to die
1 b" ~3 a6 U1 Z! W else inc A_i by 1; x) r9 i- [5 w8 B# i
end
" R$ h* W% u0 d" R- t& n1 tend |
最佳答案
查看完整内容
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,其它按你的 ...
|