|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ f' ]: l- O' g; F/ _
, S- Y: ^- t% z0 q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' G" b+ P x) j; `
+ |: ?2 I9 I) t! v% c( q% D, sbegin P_read arriving
2 A7 z& K5 Q- D% m8 y$ L# _ while 1=1 do begin
7 i6 m, s. K- B g1 n8 R read A_tote from "data.txt" with delimiter "\n"
) a, {) P3 N% I9 U- X0 [5 W read A_time from "data.txt" with delimiter "\n"- O6 E2 }+ M& {, j" [0 {8 S- u& q
read A_leave from "data.txt" with delimiter "\n"
* E, c% {0 k7 \* j0 Z- [5 i! E: u read A_picks from "data.txt" with delimiter "\n"7 e: r% w: H) h) `, X! m, F' x) C: P
set load type to A_tote6 F# g( s/ t& u# h, E
if A_tote="tote 1" then set A_induct to 1! j' x; a) C+ X0 K
else if A_tote="tote 2" then set A_induct to 2" B7 P* p7 c C. d( m, G. E
else set A_induct to 3 5 {5 E# A) B$ f3 V! e
set A_i to 0
& G$ _3 e: m# o' S, P" h clone 1 load to P_induction
6 @& e3 g) Z, o; M wait for A_time sec5 ?7 w0 ~8 a, r0 G9 B! J, h5 a4 C
end
+ `* ^+ a) }+ v- Eend
2 F2 c4 T$ |/ i1 o
' k6 D5 h: I: V! fbegin P_induction arriving. y! C& |5 X" D/ { J
if A_induct=1 then clone 1 load to P_pick1
8 e- e- [8 L- F4 u) H7 r else if A_induct=2 then clone 1 load to P_pick2/ ]& |* g2 q8 P5 r8 x: B2 w
else clone 1 load to P_pick3
/ X# v4 |0 l7 C" hend; ?' F4 k/ e0 o2 j
% J' P0 {6 n" W: d
begin P_pick1 arriving
9 H$ Z; O8 f& v! c set A_i to 1
. v9 x8 q; U, L6 N$ e5 J move into Q_induct1
# d. { P. d8 B6 V! _* f move into pickaisle.induct17 D2 H1 H5 t+ S( N3 Z/ @
while A_i<=30 do begin1 u7 ^' z f' u- e
travel to pickaisle.con(A_i)
" d; _7 v z& G: k5 g! @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! A N3 u! r! Q) ^9 H# D
else wait for 10 sec4 z) e7 q7 j4 e- V' n; L4 P1 I6 W
if A_i=A_leave then send to die
( Y9 I8 v& w2 |% s1 U" c2 X: `- \ else inc A_i by 1
5 s) [$ ]4 ]$ E/ ` end
: ?* {8 U1 v$ ?2 ]: U9 bend
+ w6 M& I% Q; t* h/ O
w# I: F1 i9 Rbegin P_pick2 arriving* O- b# E+ s: F, h- L
set A_i to 113 G8 ~3 i \1 I7 I* O
move into Q_induct2
: V1 W- q9 y* b0 l move into pickaisle.induct2, b% L1 |" B/ k2 h! F
while A_i<=30 do begin: Q3 w3 a$ t% [' [
travel to pickaisle.con(A_i)
# _+ L! L3 ]1 @5 G7 e/ ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 p1 ? T8 w& L1 D. Z
else wait for 10 sec4 R: u# { Z7 E+ u
if A_i=A_leave then send to die0 F: F, T% ?; e+ r$ m% ^- U! x% ^
else inc A_i by 16 Y& `) n8 ^ G+ {2 i- @: g
end$ `4 u! K' z* t3 s' D3 n
end2 g. O6 @, ]( _; ~& w3 T
4 W9 r2 q- J2 X( Zbegin P_pick3 arriving l9 ^: m- i. T: a9 l
set A_i to 21# | X& J- Q# Q7 `9 c
move into Q_induct3
5 h$ H9 n' Z5 ^0 e) T move into pickaisle.induct3" [! e6 O+ x2 E3 b0 f
while A_i<=30 do begin- r/ G/ i! I* l0 \( A, o) ^ r. U
travel to pickaisle.con(A_i)# g! P1 ` m# ]- c5 [7 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
Y1 D& P0 N8 U2 U else wait for 10 sec
& l3 [6 S7 c! c+ C3 }1 Q8 o Y if A_i=A_leave then send to die
; x4 Z, ^1 [) m/ A: f' J# U else inc A_i by 11 O; [! i' @. W3 c
end* }; H P/ v' B& j* {6 ]
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,其它按你的 ...
|