|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 J# I6 i* C0 H2 W3 ~
$ j0 _% T/ o& q; Z! @# q( N8 C5 I6 B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 C- `0 [- ~5 K8 e. N
- X6 z- @1 Z8 P/ \/ Nbegin P_read arriving
$ g5 F! D' J% d; ?5 X" f q while 1=1 do begin
: ]- N0 C, N6 k$ M1 H read A_tote from "data.txt" with delimiter "\n"
+ V' a0 {$ m8 }* G& z, I& W read A_time from "data.txt" with delimiter "\n"$ [# H* N. [8 t# @) L. k2 R# G
read A_leave from "data.txt" with delimiter "\n"
$ U/ i* g. b0 n8 G9 r& R3 D8 } read A_picks from "data.txt" with delimiter "\n"
) p) J) d/ [0 P: z# h G# n set load type to A_tote
$ Z. m6 A; E' ?" `0 w/ g/ a if A_tote="tote 1" then set A_induct to 1
2 m% C4 d9 Q$ | else if A_tote="tote 2" then set A_induct to 2& \! V+ _3 c; Y9 n* U$ S! W
else set A_induct to 3 7 `9 j7 N. I: l1 ^; H0 [) ^
set A_i to 0
7 n; E# D. q2 q Q& ] clone 1 load to P_induction
$ S# { N0 V; V2 X0 v) G) ]) Y) ^' ] wait for A_time sec* D0 D, G4 M0 u; c9 I
end x# C/ P; r% D+ ]9 N# N" k
end
9 F! N. `9 l N/ B/ C9 l1 y5 t5 \8 q( }1 S* \* ]
begin P_induction arriving( Y& {) o0 G; q/ @
if A_induct=1 then clone 1 load to P_pick18 B5 V" h# O& @5 n* L8 D) t- {
else if A_induct=2 then clone 1 load to P_pick2& \1 A3 @$ i$ T# f8 w. G: C0 U& i- R0 M
else clone 1 load to P_pick3
: ~$ T6 S/ R+ s2 zend, q! h* S9 n Z6 N
0 U9 X7 D, n5 O) ybegin P_pick1 arriving! R: F( x* b3 B9 H3 X
set A_i to 1* I, s8 M' b1 h8 }, w
move into Q_induct1# }6 \% k* `) s/ O) p% y8 {9 B
move into pickaisle.induct1
; Z- t. r7 K3 h/ W- p2 ? while A_i<=30 do begin i- e& `0 J4 S! U3 ?4 b* v
travel to pickaisle.con(A_i)
0 ?0 | \( [ K* Q; M2 v; G7 `8 ~6 | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( k: n$ N% l3 p2 i" z" w
else wait for 10 sec$ K/ a) v* Q5 b6 S
if A_i=A_leave then send to die) P% t5 d5 g! u
else inc A_i by 1
% o, r! F. g' \+ v end5 `3 \- b& d( R+ }# K
end
9 |: f& Z( F% B3 ?
" X$ f1 v9 T/ X" rbegin P_pick2 arriving
3 z: `9 G( ^" l; T7 L7 i set A_i to 111 h+ M# S& N" L1 }6 V$ a4 K
move into Q_induct26 q5 `6 [- B# Q3 F
move into pickaisle.induct22 g2 r3 t/ |7 y% a8 R
while A_i<=30 do begin& r+ s2 k$ ^4 ]- E
travel to pickaisle.con(A_i)6 }9 B" Z$ l# Y: f) I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
I, s a# P5 S+ n else wait for 10 sec4 n1 ~2 F2 X5 m# C; D
if A_i=A_leave then send to die. K9 n H$ u: v: V0 F
else inc A_i by 15 U* \! L" I6 m; r1 K& i
end
! G) n4 ^! z7 r' N& F3 ^end& t& |+ w( V9 i& i% n
8 A) u" g( w9 {- j* F
begin P_pick3 arriving* a5 w& r; f# K9 T/ i1 c# Z4 k
set A_i to 213 J' @7 c: [* g
move into Q_induct3
5 v/ l% G/ F9 K! m" g( `. ] move into pickaisle.induct3
6 r* b6 _/ }: G5 g6 y while A_i<=30 do begin
! S ^9 o* l! q* x, [. b% u: ? travel to pickaisle.con(A_i)
- \) N/ k( V* w. Y9 L8 i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' F) R& \- N$ i$ g
else wait for 10 sec1 D8 Y4 J, {1 d) @- i- P9 f% U
if A_i=A_leave then send to die" y n, ]6 W( ?9 U( K* `4 K
else inc A_i by 1% I. V8 d5 T- j: e4 e6 B; M
end. s) j; p- M2 L1 S5 j
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,其它按你的 ...
|