|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. I! \9 E: s3 N( _% K# U$ M5 } Y* ^8 Y2 R- P5 h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ n* z. l* d! L4 n# C# J
* x: m" y k1 W: A" [* ]* }begin P_read arriving
" ~& Z, A3 a* V8 t5 X9 C while 1=1 do begin1 X# Z! t3 ]: q, v. K
read A_tote from "data.txt" with delimiter "\n"1 `: { M& {" z
read A_time from "data.txt" with delimiter "\n"6 P. o( V) H" ~6 |$ S8 |) y6 O
read A_leave from "data.txt" with delimiter "\n"2 @% E3 K. R5 d
read A_picks from "data.txt" with delimiter "\n"- U1 P8 R* U K; `1 f, S
set load type to A_tote
5 S& q' N' X3 {/ _+ x' M if A_tote="tote 1" then set A_induct to 1. Z% A2 C% z# n# F4 K( q
else if A_tote="tote 2" then set A_induct to 25 I' ?4 [' l( H
else set A_induct to 3
C* y2 V9 @/ X set A_i to 0
1 G% z6 M& S; B. j. Y0 k/ n" M clone 1 load to P_induction! o6 b8 t" Q! V7 }2 e. ^: ?& D9 ]
wait for A_time sec
- ~; E) ^) j) i4 C0 q$ C1 Q) G4 U end
: E9 j1 Z H/ ?9 w& Uend
/ N, r, ]7 ^$ U+ ?0 p; h) F: f# ^0 S$ g% c7 b
begin P_induction arriving& ], ]+ E1 l6 E- P% w
if A_induct=1 then clone 1 load to P_pick19 @" K, L! N: Z* q, i+ L6 H( T
else if A_induct=2 then clone 1 load to P_pick2- O% e# s) L! m, l! a9 U6 ?
else clone 1 load to P_pick3
5 F7 B5 M; A! o7 Z; l0 Dend
& Z0 H3 {6 c: M3 x5 V; H3 \2 A; P- N- k c
begin P_pick1 arriving
, y% q" g; {3 J% g1 a set A_i to 1. V: r- ~8 H% z% P0 x' a( J$ J
move into Q_induct1, b8 N9 Z+ G$ `8 K2 s8 @
move into pickaisle.induct1
' ?4 N5 j, n# A9 X, z/ c while A_i<=30 do begin
7 H% F' m$ r- o: n( u4 T9 a" @5 N' U travel to pickaisle.con(A_i)+ r F, C: o6 K0 ^# P8 c9 m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( E. m0 }) V) a* _; c8 _ else wait for 10 sec
5 K! i+ G; n8 R+ x' N! Z7 G# ` if A_i=A_leave then send to die- c' n! u* S/ E+ S0 V% U7 j! j
else inc A_i by 1
) s* v3 g& z" x, u2 c end
$ d& d% n5 @( _* Q3 \# n& Send
8 K4 i$ l/ l5 i' h7 b8 r# L2 ?4 Y8 G
begin P_pick2 arriving
- k# J G9 }% D set A_i to 11. p- \3 u% _4 y0 k1 r" ~+ t
move into Q_induct2
, C Q4 k& P1 f4 I# F move into pickaisle.induct2
( q4 p! P) H1 w1 r- _ while A_i<=30 do begin
8 ?6 ^; b' V- t4 u9 X travel to pickaisle.con(A_i)
$ P* \, G4 c8 \% x' S6 r8 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ | e" W2 Y2 i) @7 X else wait for 10 sec
9 O4 A' g% k% ~1 N; e if A_i=A_leave then send to die Z: A4 _- q/ I" o9 ~2 N; Z! f5 `
else inc A_i by 1: q' A ^& M+ t. E/ i: O
end
7 c1 k t- f+ p6 s7 w, X& Iend
3 R( R# l: U: c, b- g5 V! v( |+ R( e% {/ A5 H& ?+ h( m
begin P_pick3 arriving' t! m* S3 v* E
set A_i to 21
( h# x: v9 G1 P; I! k move into Q_induct31 I; R& [% `2 k
move into pickaisle.induct33 N- H7 q6 c7 C. C) }
while A_i<=30 do begin
8 L- e6 Z. t, V; G& c9 ? travel to pickaisle.con(A_i)
1 j6 w2 d" Z, z5 C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 @& r- O% O0 ]% [! m+ h; V/ ~
else wait for 10 sec
. H \( U0 N3 F Q' m/ b if A_i=A_leave then send to die
7 o" E# d) G/ z6 }. L5 V0 C a else inc A_i by 1+ E" c. U$ k" i1 m) V I5 s: Y. x! E
end" H# f' y- M. v1 i: G% b! n
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,其它按你的 ...
|