|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 f+ Y/ R/ p3 |: \
8 n, r8 x: |5 f7 C* n4 {0 n我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 a# H) N6 F5 g- O, a. o* w
3 ^/ L5 N* ~+ ?begin P_read arriving2 D. n0 V+ z e: u p
while 1=1 do begin
" I. a9 P* E- d- t6 v3 H read A_tote from "data.txt" with delimiter "\n"$ D) ?4 _2 A! f# s( |- z! I# O
read A_time from "data.txt" with delimiter "\n"2 z9 {! Q8 X4 u8 W% b
read A_leave from "data.txt" with delimiter "\n") L5 E# S& a& @0 A
read A_picks from "data.txt" with delimiter "\n"3 e- r9 k) X+ p7 F+ }
set load type to A_tote
7 { R; Y( |+ f1 P if A_tote="tote 1" then set A_induct to 1
- r5 W3 |; a& p9 X else if A_tote="tote 2" then set A_induct to 2# Z% H N1 j0 q- x8 Z
else set A_induct to 3
# {4 ^$ R9 B& |, P set A_i to 00 Z; e' c( T$ B+ q: m
clone 1 load to P_induction. O' k! e- i$ {( N" P/ o- j
wait for A_time sec& V% `" v# f- m/ {- ~
end A: U. g7 G7 x9 e6 b) X, D6 S
end8 a! |& b7 i3 `8 s! r
6 g/ C' V. @+ R* v* } J8 B( |begin P_induction arriving
3 E5 D( Y$ b, Y; `8 r1 ^ if A_induct=1 then clone 1 load to P_pick1
7 q; ]" a) g" t2 S1 r6 W h else if A_induct=2 then clone 1 load to P_pick2
6 U' h0 l2 G6 P8 z+ s else clone 1 load to P_pick3
$ N5 f, A, c2 G" B4 d/ vend) d* q. e* d6 W3 Y2 x6 p" n
/ }+ [* l8 S1 O6 X- Gbegin P_pick1 arriving: Q0 B. \9 B( a1 J% U
set A_i to 1
8 v. O s, a3 S7 R move into Q_induct1, g! f. r$ p" e; a" V
move into pickaisle.induct1
' {7 l) B+ a6 H while A_i<=30 do begin6 e0 p2 L) Y- w, G" r( l
travel to pickaisle.con(A_i) A6 ?" i" \0 j) f, o; F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* D4 F- _ [2 n. ^- J else wait for 10 sec$ u4 {( M- l& [
if A_i=A_leave then send to die
) Y9 I2 \0 N% j7 ?3 |4 K else inc A_i by 1
P3 Q6 q J3 ?+ s end
* ?# H: o0 w* jend7 Y# @. {% S( i, Y& ^2 u/ [. q2 Z M
7 G8 y8 V' R7 ^' h' Wbegin P_pick2 arriving9 \. Q8 e. Q* a% w3 U
set A_i to 11( |$ z4 ]* @ x' B2 r- `
move into Q_induct2
! q& F+ _2 I( h% `# z1 ` move into pickaisle.induct2$ P( L: N' T5 b' |* `
while A_i<=30 do begin7 g6 y3 }! h- Z2 G5 O$ H* d2 d
travel to pickaisle.con(A_i)
g I. w5 X) {3 _0 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! ]. H+ r' ^# T9 F
else wait for 10 sec
- I5 d5 t/ G& C8 ]/ ]: | if A_i=A_leave then send to die
/ u+ p7 c" i2 ~: C# q: g else inc A_i by 17 N6 C! ?4 ?8 z% C& O
end9 s# ^( m4 s* f1 u
end
6 s" ?6 {4 i6 Z+ h0 j
2 I& [. n8 d( `7 ~7 l7 Nbegin P_pick3 arriving; f; |' Z6 ]2 n0 t9 l' |2 [8 z, B
set A_i to 21
# N3 d9 y: u. ~9 a move into Q_induct3
n& F. ?. o; I8 Y, N4 G move into pickaisle.induct3' Y- K) d& u! r$ ~* u6 @
while A_i<=30 do begin
9 U, d- l1 n, z7 L' \8 s travel to pickaisle.con(A_i)) X2 M& B! j- G, W8 X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, h v {9 O S O6 s0 ] else wait for 10 sec
) m! ~0 h% s4 I2 [& `5 y if A_i=A_leave then send to die
' A& m! I7 v9 T3 c, K2 w else inc A_i by 19 r5 H% e9 p# W, |; D2 Y
end# p- n7 ~% q/ ] a, u( x3 d& Q) T* b
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,其它按你的 ...
|