|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ^6 j: h5 E, \
/ e; P! C9 n- Z! Y. @$ a我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 a; S# T& g, i0 g, |
3 E" G2 A/ X, m+ x
begin P_read arriving, q: Z" d; m% ?
while 1=1 do begin
+ @( n; V; W- v1 [ read A_tote from "data.txt" with delimiter "\n"
2 y" x/ C7 p# F* q: L read A_time from "data.txt" with delimiter "\n"
5 L5 G. Q8 \/ S7 g( K) x read A_leave from "data.txt" with delimiter "\n"
: z0 k; m# g/ G$ I read A_picks from "data.txt" with delimiter "\n"9 X# x" }7 z0 o
set load type to A_tote
# e8 w, p$ C4 ~; p if A_tote="tote 1" then set A_induct to 1
; z# \: w, m' o( {& h else if A_tote="tote 2" then set A_induct to 23 L0 F. T7 ^3 A- F3 z0 K1 E
else set A_induct to 3
( Z9 e% r' o! s& m2 O) h. w set A_i to 0; D N1 H l- s9 r
clone 1 load to P_induction
' ]4 z% J5 e; t1 U" i h wait for A_time sec: _2 A2 j) r1 Q+ c4 D
end
0 {; L- |5 V$ j3 c* g: a( iend w. ~- [9 |) \4 X& s2 \3 H6 H$ b
8 a3 `! H2 X" k. x; u2 d4 I
begin P_induction arriving3 ]' i4 c6 I2 J$ n: Q u) A
if A_induct=1 then clone 1 load to P_pick1
7 R. H% c. o. u& g, x+ U5 n Z else if A_induct=2 then clone 1 load to P_pick2: ~ Y& i/ L2 g! J
else clone 1 load to P_pick3
$ d; b0 t0 M8 b1 ~! g1 C4 rend& s/ r+ o9 D! Q, h8 ^3 V' Q
# W( w7 r5 n" |7 I2 S. gbegin P_pick1 arriving
* F0 m" v2 c5 \- [1 Y. u2 r set A_i to 1, T0 B! m/ q, i& [
move into Q_induct1+ @$ _' ^( Y+ f; l1 b7 {
move into pickaisle.induct1
4 \* R! x4 O% c" M, K while A_i<=30 do begin0 ^2 U0 O1 C4 t8 F* |
travel to pickaisle.con(A_i)* ^3 @( b. a4 E9 C- z3 [: R$ w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 M. r1 p$ M# D( q5 v
else wait for 10 sec
% Y6 v5 @5 ~" B, M6 u- [ if A_i=A_leave then send to die" l) `3 w1 R" w/ I8 p5 E
else inc A_i by 1
/ u# P* H ]' U5 q; w7 E end
) I1 \ U1 |; p% J2 j, nend2 c. [" u$ |' N A2 |, L2 u
; V( ~, o) D: e' u& [begin P_pick2 arriving; \% K( e4 b; p! {& G3 A
set A_i to 112 E6 m& Q* C$ `8 V4 c
move into Q_induct21 S+ X. [2 `& s
move into pickaisle.induct22 b+ |( T# k/ S, {4 l$ O
while A_i<=30 do begin2 E7 M' Z* `6 Q/ z2 L1 W- K" }
travel to pickaisle.con(A_i)
0 K) t4 s3 r- i( b0 S4 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; } V6 m- y+ j1 M" T9 w0 K+ B/ p6 |
else wait for 10 sec: Z( M' R2 f( c' b
if A_i=A_leave then send to die
4 F9 u4 v- C9 t( R' G6 h else inc A_i by 1: n& i- ~- _$ z' ^6 T1 }
end
B2 R4 B& e* y6 ?3 `. xend3 V& c, A( L4 E
! e- h% H0 Y0 G9 f! k
begin P_pick3 arriving
7 t: q) h. T X5 @" ~" z+ ~ set A_i to 21
4 B( S( |3 s/ ?. t& h move into Q_induct3
. U: y( j# r3 ~0 d* S move into pickaisle.induct3
9 C, H$ |" W0 j+ S7 i7 r+ Q- Q while A_i<=30 do begin
j5 Z% {3 u- k4 |( m# L travel to pickaisle.con(A_i)
- z }7 s& |0 ]- }* D3 e0 Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
K; t- Z0 ~' e+ O; a else wait for 10 sec5 u5 g6 c2 J) j5 S* p
if A_i=A_leave then send to die( i! r t8 E- ~5 R5 y5 z- `$ A% g
else inc A_i by 1 w j, P" F; C3 \! {/ g
end
$ F, }3 x- m5 V7 u4 vend |
最佳答案
查看完整内容
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,其它按你的 ...
|