|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; D: r0 \' X& i' F0 c
% M0 b8 u$ ~% C8 p我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. f% P4 \5 k5 @; M. H" b7 ~
A( h/ k: w1 M$ l2 U4 S rbegin P_read arriving- M9 u; b7 d8 J0 m
while 1=1 do begin' Z# L+ N3 S6 Y! r/ c6 H% x
read A_tote from "data.txt" with delimiter "\n"
! i, l/ E, f. H' v read A_time from "data.txt" with delimiter "\n"+ G/ `) D" m$ [
read A_leave from "data.txt" with delimiter "\n"2 f! \: y6 T' m1 m X/ X
read A_picks from "data.txt" with delimiter "\n"% j6 h3 X$ r9 X& x, |% Q& [" t
set load type to A_tote
% z* l& Y: G% _; n% _ if A_tote="tote 1" then set A_induct to 1
& m: ~! ]: s0 i, p, s3 D else if A_tote="tote 2" then set A_induct to 2
. F3 g4 ~. G p x else set A_induct to 3 6 D& w( a8 Z* o7 Z. n- G1 }
set A_i to 0
3 W8 z {+ k( ~. S' _/ a; q. f clone 1 load to P_induction6 p! l6 W* ]6 Z) b2 B5 k
wait for A_time sec9 e. D6 B( w* v3 ^
end& ^2 f9 o' W0 w v D
end( E9 j# M+ ?0 |7 W
# E$ B" j4 }! T) O) f
begin P_induction arriving
8 g* }% p/ H: O+ L% E5 i& o if A_induct=1 then clone 1 load to P_pick1) }3 C: k. z8 y% ^( B
else if A_induct=2 then clone 1 load to P_pick2
2 z* E% Y: c P else clone 1 load to P_pick3
" y5 ^- p- @, y" G& D$ i, P9 g; dend
3 J2 K8 K2 J: [, T1 h/ }' \. X' D% {: O. }5 e1 P4 ~
begin P_pick1 arriving
+ j- |' F9 n. Y, b( D6 G set A_i to 1
& x* U; `5 p* c7 A move into Q_induct1
0 c2 g- _+ |* H1 B) l: s move into pickaisle.induct15 ], t, e) \3 x' _+ E& i- H
while A_i<=30 do begin3 d! B) N* w. u$ f+ q
travel to pickaisle.con(A_i)
" h; j; o" i, `* u$ W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 G! b5 k" O9 G" H. E
else wait for 10 sec
# C/ N# ]4 I* s3 A* W$ J if A_i=A_leave then send to die* u6 W; E5 {. W
else inc A_i by 1+ p! U' U2 I- S9 B* q; G! P
end0 }+ s- p. _% I1 a# `
end5 q& |+ z% ^- m; Z% \3 r$ R
8 ~( V9 z# t6 K
begin P_pick2 arriving
# ~+ W: [6 o: A set A_i to 11# e2 K8 `$ G5 {2 w
move into Q_induct25 S; }' ]& N. U, _
move into pickaisle.induct2' o- O5 d$ Q9 g! R
while A_i<=30 do begin
$ |1 a6 Z# O' R+ U travel to pickaisle.con(A_i)
' ~+ [& a* O( Q" }' E8 i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& q$ T5 H, i+ m+ v else wait for 10 sec) j- |$ L% l+ z+ [/ M) d! @7 {
if A_i=A_leave then send to die+ N4 E# _4 \, ^( H
else inc A_i by 13 F8 L) }* ^& J! S" k4 f+ v
end2 H/ p1 \9 F5 l2 S" |* F# R# E9 u
end
2 ]# l; O+ j( g5 |# z _: r7 ]" K, t, ~9 A* M9 z
begin P_pick3 arriving
! x0 {2 g. I# Y: f set A_i to 21
$ ?9 S% D6 y9 G move into Q_induct30 Z! x0 i5 W9 n8 c4 K. c
move into pickaisle.induct3
7 { w6 G+ ?6 A8 O' i while A_i<=30 do begin: b! g- J+ P- X. O w1 s+ a, w: K
travel to pickaisle.con(A_i)% \- D6 k( B7 l/ f1 j! h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; y7 w7 e2 E; g p% X9 f. e else wait for 10 sec" P7 v; d2 H3 O6 R( Z4 C
if A_i=A_leave then send to die
. T) C4 w( E {. X! ?* B2 V else inc A_i by 1
" ^0 h, t( Z$ q' q2 f1 u4 R0 T1 C' T end
6 m! J" c# t4 m8 m& \. @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,其它按你的 ...
|