|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% t+ q' B' I* u) ]
. p( @$ |$ G7 D( _# V9 r. F X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! J& ?' z. g5 O
; n- P( `* H' A$ r+ Fbegin P_read arriving
9 h" x& K) N& m- u while 1=1 do begin" h+ N- f1 T; f% }& b2 k
read A_tote from "data.txt" with delimiter "\n": _% @4 A. ]1 h( u+ F, t" i
read A_time from "data.txt" with delimiter "\n"/ ?8 t _9 N: V3 u
read A_leave from "data.txt" with delimiter "\n"
0 p+ m# @0 P9 k; v9 j. ^ read A_picks from "data.txt" with delimiter "\n"
$ O5 {" ~: r, s: d set load type to A_tote8 c; h8 Q! x( ]3 ]5 ]1 v0 ~
if A_tote="tote 1" then set A_induct to 1
$ v/ P3 a4 D& l' c+ K else if A_tote="tote 2" then set A_induct to 2* C/ \6 `: j- ^" k
else set A_induct to 3
/ W! }# x/ r* R set A_i to 0
- E! P. A% |1 b( d1 [$ ~( f clone 1 load to P_induction- U$ f; [# {) M9 _* ]; K# S
wait for A_time sec
( Z4 V2 I) p; @' z4 s, T; J end. w; X: k0 Z. t
end
6 _- O, m9 l, r' S' h2 o6 @& x
4 t6 ^+ }( R! g- |& p( N4 Lbegin P_induction arriving9 k5 Q& h& \! m) ~0 r3 w3 n
if A_induct=1 then clone 1 load to P_pick1- R, Y2 S. F$ {; V$ H) q7 {
else if A_induct=2 then clone 1 load to P_pick21 o+ i/ s" A# I
else clone 1 load to P_pick35 O5 T' Z$ z' P0 K
end5 W. \* _- y7 j8 }, Q% ^4 [
" _ `! T$ d, [1 _
begin P_pick1 arriving' E& H; B: U2 P' I! g6 r
set A_i to 1% |; G8 c- y, b/ {
move into Q_induct1
+ G9 D! {$ c2 i0 ` move into pickaisle.induct1
* n) ^) I& M1 A, @ J: C" ~ while A_i<=30 do begin- L4 t- J+ q. N; A$ _6 M
travel to pickaisle.con(A_i)
2 K& A( O) @0 u) v& m2 }2 ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* D0 u) b6 o6 C" X
else wait for 10 sec
2 [; h6 N4 J Y( E2 X if A_i=A_leave then send to die* Z, @- p# e( h# z$ J9 p2 R% a. G& @
else inc A_i by 1+ C/ ~: g4 Y7 n9 X
end% A! f: h9 T* K" P1 |2 k! n
end( p& e! x4 M0 }7 |: A# `
; Z$ v( Q1 ], f4 G1 S4 c! d9 vbegin P_pick2 arriving
# ~3 Y( Q& v. p set A_i to 11
j& ^2 U$ `8 n' D move into Q_induct2
~8 B; W/ K8 Q( ]. | move into pickaisle.induct2
2 ?4 V* V1 s$ y7 V while A_i<=30 do begin
' D8 l- h, q: s- j$ _( H( `0 l- c travel to pickaisle.con(A_i)
- c' N. Y- y% k- i2 f { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; V2 c: e. x# j$ x7 A else wait for 10 sec
6 \3 c/ J+ ]. R8 D- H* W if A_i=A_leave then send to die
% I. o8 t& S& ^8 ^ else inc A_i by 1
3 @% b1 [; U5 a0 u; [$ b end
7 S# y& m Y- [end
) N) a7 Y5 w, n% ~
- |& p6 h7 r, _+ u/ g2 W# ^begin P_pick3 arriving$ i3 p- u6 _# f. f
set A_i to 21; m" Y+ @' W/ L! z3 v
move into Q_induct3# Q3 A ]7 \( j% m
move into pickaisle.induct3
* b: f; J8 E# t2 E while A_i<=30 do begin: x- v1 v$ y# d1 L) ]" e+ |# q
travel to pickaisle.con(A_i)
" q! }' P! O* H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ Z) x( D( J6 x6 u. Y
else wait for 10 sec- _3 h U# p( b; t, b2 L
if A_i=A_leave then send to die
1 `5 y+ R% A* d2 O/ U else inc A_i by 1' D3 e3 H% W% Z# W
end% g8 K9 A) z, e4 s7 D
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,其它按你的 ...
|