|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 ]+ q: Z+ i( h9 N* M( I( V. O7 M: A" m) Y: \
我的问题是,在每个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 X+ i" }6 Y; ]. I; n1 f' c, \5 D$ ^. T: W5 ^' r0 \) a8 ~) w
begin P_read arriving
& l& _% l1 r4 Q% {$ h8 g, [ while 1=1 do begin$ y* E: ?3 z$ s6 W$ ]
read A_tote from "data.txt" with delimiter "\n"" d- e$ l* Y7 X) j/ ^( z$ z8 o1 ~$ p
read A_time from "data.txt" with delimiter "\n"1 J' L, Q: h4 w V# t4 c
read A_leave from "data.txt" with delimiter "\n"5 {7 \! }# V+ R, `- o; L$ a. x
read A_picks from "data.txt" with delimiter "\n"; I6 ^0 N: ?2 h
set load type to A_tote! [* D/ L( l3 q) A, R3 w
if A_tote="tote 1" then set A_induct to 1
0 g' `2 w+ A+ ^# R: b7 K( k. _8 |. T else if A_tote="tote 2" then set A_induct to 2
8 m- T S/ e9 L else set A_induct to 3 ( J- l# Z/ x; ]& y" }6 `
set A_i to 02 J# L( N( I( N
clone 1 load to P_induction
) d/ ] K* \# H" E( W: ? wait for A_time sec0 C/ Z* \& G" B& }' z: n: }
end
2 }. |* I/ O( u4 _! Iend4 Y8 ~ g* l. {6 K, R8 v0 h# K3 g6 n
/ Z% Y A& Y. A+ `$ m9 c) X
begin P_induction arriving2 |% `) ], x: f: n5 v) R
if A_induct=1 then clone 1 load to P_pick1( D/ X) I/ ]7 h9 {/ b
else if A_induct=2 then clone 1 load to P_pick2
. ^9 m! Q* ]& r) O! m else clone 1 load to P_pick3- Y( @- h3 [! u5 Q8 l
end
8 a( ?+ q1 S. s3 a$ l. Y
$ E i G3 `- O; X l1 Nbegin P_pick1 arriving
4 Z, U2 A) Q/ {/ e% }. o set A_i to 1' R. I' n. \# ?. k
move into Q_induct1: X2 ^5 m4 a; C1 [
move into pickaisle.induct1
% z% v& T) n5 \ while A_i<=30 do begin
) u' U! Z2 R! t7 A/ q travel to pickaisle.con(A_i); `" V6 X) _, L' K) L% q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& h/ V: m9 s8 Y8 ~3 n/ j else wait for 10 sec* D0 W5 ^9 b3 I) Z
if A_i=A_leave then send to die7 v* l1 C) T; u2 b3 {4 b. I
else inc A_i by 1
% {) O& D- m: z end
7 U3 G( O! G' k- N+ Oend
: B1 q' x9 V0 M$ g
1 Q6 t3 [# }. L2 K4 r2 T0 }begin P_pick2 arriving4 l+ N6 `: W$ B F& A1 d4 |
set A_i to 11
# g# c" Y5 R; q move into Q_induct2
W9 }! V& c& Q: \4 P, N move into pickaisle.induct2/ L1 D/ N1 Q( e$ H7 m; z {
while A_i<=30 do begin3 b* ~+ I/ R# {2 x5 U
travel to pickaisle.con(A_i)
: V, i F' A5 \: y- Z/ o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ s* [% f* d8 I+ E/ S; V else wait for 10 sec' j' N0 U" n# `( V0 W
if A_i=A_leave then send to die
3 M- P: o" q; I else inc A_i by 1( ?0 y2 q6 L; s; d1 f
end
: p8 E4 \+ _3 i, @; L/ ]end
. p" z. x, ^# {' ^7 R! S
5 H% C- k, `/ F/ K' d4 p- A# fbegin P_pick3 arriving$ z2 [# q( k. _) |
set A_i to 21
. W t% d4 C3 n0 q' ~ move into Q_induct3/ @. t, @8 z" \, k
move into pickaisle.induct3% Y9 I1 t& A" e. n# I. q
while A_i<=30 do begin' V" p% E1 k6 A7 n5 \0 L5 Q! W
travel to pickaisle.con(A_i)6 g8 a7 y( r6 R7 ]$ f* a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& m' u- D4 V0 ^ j' H& R else wait for 10 sec% I7 ~* l& N' U
if A_i=A_leave then send to die
" p- X' c2 ]4 q; ~ S else inc A_i by 1
; s4 d7 s' g+ I3 _; c+ B% m9 P end% B6 b/ Y# @" 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,其它按你的 ...
|