|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ T0 ?6 V P9 N% h5 w
7 B% {; E, `/ W- f我的问题是,在每个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 X! l5 [) s- I( s1 k6 H1 E& `
: T/ [6 }1 i7 Q. J0 i6 R6 i% K+ E- o0 ibegin P_read arriving
F+ F2 s# I7 x. ] while 1=1 do begin0 c& {0 J4 Z& B1 ?/ z% R
read A_tote from "data.txt" with delimiter "\n"( \0 @6 `9 n3 w# X
read A_time from "data.txt" with delimiter "\n"
$ ]! C6 I1 S3 `2 @2 h% v2 ^ read A_leave from "data.txt" with delimiter "\n" I4 W6 ~0 p* R. C; T6 A% P6 _
read A_picks from "data.txt" with delimiter "\n"" i0 p4 Z, L' k
set load type to A_tote
) v+ a! C% h8 s% J if A_tote="tote 1" then set A_induct to 1
% D4 v6 l" T6 O- D5 x else if A_tote="tote 2" then set A_induct to 27 b v& d p4 ?" J
else set A_induct to 3
7 ~1 Z, r7 i7 v set A_i to 0
% { Q; R6 d$ \7 m+ K; ?9 o clone 1 load to P_induction
$ ~8 G0 G1 i2 q) }' O; b wait for A_time sec
+ B4 @# F3 g$ ~& F9 w end
6 E, ~* a' N# h6 ^4 A. Z( ^end# p! l+ Y# v1 z$ E8 X1 v, }. m
, v0 I' O* R$ ]4 L2 r
begin P_induction arriving: n7 l! [6 i! P" _
if A_induct=1 then clone 1 load to P_pick12 f7 a% b, m' |' p( r! D
else if A_induct=2 then clone 1 load to P_pick2
$ T4 q! [% x4 m- J* f: F0 u2 X else clone 1 load to P_pick3" [ h; }) ^, ~" A, b# ]
end" R+ J: @( w- k) Y) E. Y
. ^0 R# ^& s# `5 m2 L7 b
begin P_pick1 arriving5 G) ?3 L6 l3 {) K+ ^, F9 g2 Y
set A_i to 1+ @+ n4 }9 }- J! f# J
move into Q_induct1! C! \$ t7 N7 v& G, Z
move into pickaisle.induct1
+ ~9 i! K1 P N9 ] while A_i<=30 do begin
" U" y& |/ Z; e/ a( N# C* | travel to pickaisle.con(A_i)% m/ F+ E- G$ `: V( |% \8 E; Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 Y" R3 G' q! k l; ~ else wait for 10 sec
) X6 r. C: w3 E if A_i=A_leave then send to die1 c& x2 ~* v+ Q. `/ C# K5 v
else inc A_i by 1
8 p m8 O1 a6 Z+ e/ e M end, u# `) e9 n5 b2 q3 g
end& ^ T- \3 b: U3 i. e" ^% y
$ G3 |- y* J9 @5 J, ]1 G5 h0 d5 \! }& V! v
begin P_pick2 arriving
$ X$ h9 M5 S1 k) G set A_i to 11
/ X1 ~. v K/ F! B move into Q_induct2
+ F: M6 e+ r. G3 n4 b move into pickaisle.induct2
) R- ~- q) h. Y; ^" l) K$ e while A_i<=30 do begin5 p3 w" y- U, b2 p$ U
travel to pickaisle.con(A_i)
( f2 F1 w1 C8 `( Y$ x) ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 B+ U7 I: m/ O" [ else wait for 10 sec
7 }5 L- O9 Y: H% E0 G if A_i=A_leave then send to die
0 k2 ?4 ^5 a; u- I# t" l else inc A_i by 1+ k& r! H8 e' i0 O) i
end
1 f+ E8 z/ A. S# d! ~ n# Y$ mend
; u! y9 t& w* E% O5 l. w) w4 O3 @7 ~
6 ]0 z8 |! q1 c8 n) R- pbegin P_pick3 arriving
$ C" } R9 q" n: i. e4 B+ ` set A_i to 214 y- K8 f& f- U
move into Q_induct3
8 o- R- t& F( k move into pickaisle.induct3
% V* M0 @' k) U6 ]7 L8 l# d while A_i<=30 do begin- `5 n, @( }9 ]- E8 h3 L" g
travel to pickaisle.con(A_i)
" z$ F' }: P: K$ } H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# T* f# j) u' h else wait for 10 sec6 x6 @% i- Z7 d) K2 g6 j. f
if A_i=A_leave then send to die& M4 \8 V% K* w; S' @( E7 y
else inc A_i by 1# m# l6 A4 b) H& B' N/ F' u& a
end+ n0 C' I+ w, ]7 a; `1 h1 H
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,其它按你的 ...
|