|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& c; M% k6 K2 I; C9 p- j# D
8 s! L/ h, Q5 e1 b# ?我的问题是,在每个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 i4 U1 ^5 Z6 d/ O" E' X* Q
+ D7 m' e( i: m1 L" }; v' `' A
begin P_read arriving G( x+ k) b. k7 h6 V* `
while 1=1 do begin
* g* U% d' L9 Z) Z* p read A_tote from "data.txt" with delimiter "\n"; a# {# K; [6 O! f; [8 I
read A_time from "data.txt" with delimiter "\n"
3 F9 z7 E7 ?. w' [( \* \/ g: \* b read A_leave from "data.txt" with delimiter "\n"% s" i$ C: S& z" i" |1 O
read A_picks from "data.txt" with delimiter "\n"7 u. S) n6 I# O: o. m1 f
set load type to A_tote6 M, n. _. U; _+ }) B8 Q# w5 Q$ V& @( @
if A_tote="tote 1" then set A_induct to 1) L R) ~' e: O: u, F/ J/ Q
else if A_tote="tote 2" then set A_induct to 2& q/ s' A" M0 {: ?: W0 u
else set A_induct to 3
: x& V5 p: r/ I! [ set A_i to 0
# |: q) Z6 r! O T1 ]/ R" R clone 1 load to P_induction) X1 m" a3 v B# e9 m
wait for A_time sec4 \6 N, p7 P9 Y8 M4 P
end* v; o4 e+ G( b D# [ @; P
end
. ~2 J- j1 I* J
! a! ]. e+ S* Vbegin P_induction arriving
" C6 ~% r& J B if A_induct=1 then clone 1 load to P_pick1* k# W) J2 U* J6 [" f
else if A_induct=2 then clone 1 load to P_pick2 M/ R# V; n# }* Z) ^
else clone 1 load to P_pick30 A9 |; m. B0 N7 _) o
end$ `4 H% F) r1 C. T% j3 W$ o
/ E& t/ W$ b+ }4 q- c6 ^* s
begin P_pick1 arriving. C t3 L$ e* _: z& A, v
set A_i to 1
$ F2 f7 G; }1 z* ?( o move into Q_induct1
! C; Y& o5 g: U# ~" r move into pickaisle.induct19 w1 [! Y8 Q. p- y
while A_i<=30 do begin
; G/ b7 j3 x, H* L3 O9 t7 g" p travel to pickaisle.con(A_i)2 @" Z2 ?" J3 i5 s4 I) t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 n8 @' X1 ? U
else wait for 10 sec
5 S: V" `2 S7 B9 J1 j9 | if A_i=A_leave then send to die
3 ~) u! y, J. n4 w4 @" P else inc A_i by 1, v9 Z* B( Z% D$ V# N) N
end6 g g" w9 E! {( n4 _
end
5 p3 Z* g$ E1 V
& @- u/ R9 e3 e2 Q. G0 k; y/ A* @8 [begin P_pick2 arriving
; ^0 y' s. T* h7 ?, q set A_i to 11
" K& D# t- U4 C move into Q_induct2
* v0 c& z) I; \ move into pickaisle.induct2! m" [1 Y5 L: X& z% y( |0 A8 e; Y9 `
while A_i<=30 do begin/ `4 U$ Z8 E6 j) K- P
travel to pickaisle.con(A_i)4 b) M; d& ]# D* E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% t$ K' P$ r4 i7 ]2 r# d2 n
else wait for 10 sec
% _7 { |# U6 f/ E3 a5 I: ] if A_i=A_leave then send to die5 m8 r$ R N4 t+ [. m( a( Q6 l S. o
else inc A_i by 1
/ w, B1 H+ X) e* Z) W end- E) w% W! p* ^6 h
end: J5 Y* D, p! W& W+ y7 c
2 C) x3 |- u: w6 h
begin P_pick3 arriving
2 B" T/ R1 x/ T c( _4 n' ^1 L @ set A_i to 21
@ c' j) I7 ]' M move into Q_induct3
. l3 ?2 L: o" ]' } } move into pickaisle.induct3
5 v9 ]9 F& w7 Z* q$ r0 i* x, N while A_i<=30 do begin5 U7 H$ o2 s9 f# L
travel to pickaisle.con(A_i)
; j% s; A# n+ K8 K; S4 p1 I& z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" G5 \" V B) z else wait for 10 sec
$ K! t5 J: ?0 B5 e if A_i=A_leave then send to die0 E2 O3 z9 \1 F3 W: o
else inc A_i by 1. ]( U5 U" B( z) O$ Q: g
end m! x) T! H3 y" [- W
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,其它按你的 ...
|