|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 C# E! I1 ^: U8 U" a4 z7 `$ D" t( b% C( m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! Z- m# I5 w; P5 J% e) _. N3 q3 P9 U) X- ~' Z
begin P_read arriving/ s& t+ a* U( }* e
while 1=1 do begin0 h# F, d, o& ^: n) E9 d
read A_tote from "data.txt" with delimiter "\n": S+ C/ `8 O7 L
read A_time from "data.txt" with delimiter "\n"2 y9 _: [, N7 l1 F9 {- Z
read A_leave from "data.txt" with delimiter "\n"
8 A- u$ @8 p. I- [: n read A_picks from "data.txt" with delimiter "\n") s* W. |- Y, c, E2 i3 p, S: N% D
set load type to A_tote6 d7 t8 S. N: N; T7 N
if A_tote="tote 1" then set A_induct to 1, L8 w- n$ b! P# V$ D2 B
else if A_tote="tote 2" then set A_induct to 2' X+ g* c: d, C- _& T& Q/ d
else set A_induct to 3 & B# U* f( y& E% d
set A_i to 0
: L, \+ c: q* t, d! n/ E" b% a7 j clone 1 load to P_induction. a! x4 Z4 H* `6 @! o
wait for A_time sec
& F% Z& S3 ]: y: u9 }8 e O end! e/ O! X5 q3 J! M, B
end7 f/ p+ r: s+ k: V
+ u( P4 g* t% P1 bbegin P_induction arriving
! Z8 O4 j) ^* y$ l+ \. {& N if A_induct=1 then clone 1 load to P_pick1( G9 P, Y# h1 G0 E+ |
else if A_induct=2 then clone 1 load to P_pick2 H0 Y# P! w. }, F
else clone 1 load to P_pick3$ `8 ]( s' D/ c
end& r) Z1 k+ p ^/ s" h7 ~% [* ?
; k4 {$ h' g" F6 J, `, A2 W0 u! W3 Z
begin P_pick1 arriving! v. T- g) r" q4 O: j
set A_i to 15 J# `* q9 G8 X- W6 v5 z
move into Q_induct1
/ D: x* V1 g) x1 I+ y2 p* N move into pickaisle.induct1
) X3 M8 D& e% Y& q. o6 x5 Z; k while A_i<=30 do begin
$ A" J- g: B/ W u travel to pickaisle.con(A_i)
' c, P$ c5 s% P2 c3 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- A1 m! o% c7 Z5 j: g4 @4 h
else wait for 10 sec
: `! k8 e' n' g/ V1 Q6 q9 c if A_i=A_leave then send to die6 @# ?+ Z: w; A' Y2 _1 g
else inc A_i by 1
9 c% ^$ X/ x: T$ O. \2 @ j4 S end/ u- I4 d* C: T; C5 _
end
" z5 E/ H# R+ q H P& x' A) d3 O! |% Z( o E+ e- j, |6 T8 k2 H
begin P_pick2 arriving
" h, ^% l5 R9 Z' a set A_i to 11
! r) ^/ S% q' R1 c q move into Q_induct2
& |+ H. W% i8 W7 M' M0 V move into pickaisle.induct2
7 r- H. o, c7 T7 g6 V ` z o while A_i<=30 do begin
5 X7 ~ W" A2 W v. h, ]6 Q: s( t travel to pickaisle.con(A_i)
E' |/ W8 ]9 V: X2 @; D9 j; L5 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: t, k3 _% S. i. B7 |& ?3 c3 i4 H6 E
else wait for 10 sec' I# f/ t- u. |5 {3 A3 O$ j9 z
if A_i=A_leave then send to die
' @! ]7 f2 q7 A9 M else inc A_i by 1' p o3 p9 {8 H1 ]# R2 x
end, Q5 t& p/ X3 I( a# r" Z* L1 R8 M( j
end+ T* ~# K( D$ ~1 F1 @7 A# ]7 M
3 ?! Y( F0 z' G1 L& _, @8 V
begin P_pick3 arriving2 J* K9 X" E9 w
set A_i to 21
# |$ ^* g) N0 }1 I2 H5 A4 f3 J move into Q_induct3. @# l, X' T1 u- u( K' ~# V5 u
move into pickaisle.induct3. o1 s2 D8 [' x( z' {4 N' ^
while A_i<=30 do begin
8 L/ C- ?* F/ c( ~ travel to pickaisle.con(A_i), p9 b3 Y1 g) ]3 r4 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' x' m6 {7 r4 |; J. L9 T' _6 J
else wait for 10 sec1 j) d3 a9 s# X! r
if A_i=A_leave then send to die
! y) J7 h& k5 h; S else inc A_i by 1+ ~' x! ~5 ~2 m/ v. u
end/ ]) B# s, {2 {
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,其它按你的 ...
|