|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& Z: `; O1 d* j, q1 d0 G# R* l; e$ z- a! X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 `' x% A$ w' o
) ~4 p- P; p1 u% U% b8 E/ ]6 @/ X- Obegin P_read arriving
# S- c5 @; I0 H# A% ?" { while 1=1 do begin
2 H3 n- x9 S2 c2 B$ ~! u: E read A_tote from "data.txt" with delimiter "\n"4 M$ m( u6 f$ i: N* v
read A_time from "data.txt" with delimiter "\n"# T* k& a+ v: m) @- S5 Z
read A_leave from "data.txt" with delimiter "\n": p8 X6 k& x, x* f3 X k# P y) a
read A_picks from "data.txt" with delimiter "\n"% h2 J+ c# `: w) I
set load type to A_tote H1 o- P% w/ M" G# D
if A_tote="tote 1" then set A_induct to 1
9 h9 W8 d; F Y; Q! z else if A_tote="tote 2" then set A_induct to 2! q! H0 M, q& v% O' s
else set A_induct to 3
; x- ?7 S5 y0 v( W set A_i to 0
z* u2 w) w( s. P clone 1 load to P_induction
$ K" d/ g4 L+ D# ]* L wait for A_time sec' [2 @+ n0 k K5 ~0 C, X
end' ^1 d% F- A- l" @3 O9 n) z* A
end3 y! E1 B9 ^7 g0 b2 r5 }& a
3 O. o6 x" g6 x8 Nbegin P_induction arriving
$ ^: {' l# e1 P* u9 U. a5 L* W if A_induct=1 then clone 1 load to P_pick15 H3 ~- ^( H9 D7 l( H3 M: F
else if A_induct=2 then clone 1 load to P_pick2- k1 l: o& {4 F Y ]5 B* \; R
else clone 1 load to P_pick3
8 {9 |; g" V7 y4 P- Send y* Q, A, @5 C! E/ P+ U
' B! F: |# c6 p2 W& nbegin P_pick1 arriving4 N1 \' D2 R6 a0 l, Y
set A_i to 1
! _ {. v1 k. g x move into Q_induct1
+ p, |4 q. C% Z: w! n. [3 X/ f move into pickaisle.induct1( y1 D& d& R9 p$ X7 ^, W9 \( x
while A_i<=30 do begin8 r/ R9 y% C( M1 j
travel to pickaisle.con(A_i)
: C/ u( c2 j( {& O+ @( Z. Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 V& k7 D# ?0 I. t" D, f& m, j else wait for 10 sec
) m8 t6 o8 H6 U% X2 K. G if A_i=A_leave then send to die
# L; z( g; ?: J else inc A_i by 10 Q- s& ] r1 ~: S5 t5 w
end
6 ^" N" @( }7 i0 Xend
0 G4 h/ F1 R9 o3 s
! e! I3 W3 N8 v- y: f- D7 pbegin P_pick2 arriving, V# ~, A! w" S' Q$ K; l
set A_i to 113 z7 A# e1 ]7 {
move into Q_induct2
* b; \, c7 Y' j2 Y+ [/ O move into pickaisle.induct2, ^& G6 D# A* A# N/ \; S
while A_i<=30 do begin0 Z9 `$ l! {: Z& R$ z
travel to pickaisle.con(A_i)
: v$ `2 o% s& ?8 H2 n3 f4 C+ n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" N- c" B2 v" t7 d$ I. v; J. E9 n else wait for 10 sec$ W5 X. ]+ ]+ J1 x8 d
if A_i=A_leave then send to die* m" @$ s- ^& l5 r( C
else inc A_i by 1
# i4 l1 o" z- m' M4 a0 D8 O end$ F e% t2 _2 q/ ?8 y" ]8 Y
end& g6 B8 e5 c: \
1 [3 I0 `. \- r6 ~- e
begin P_pick3 arriving
; w% f- O" N/ S9 ?$ j set A_i to 21& l2 y- T' A* M0 `- i: L( |
move into Q_induct37 \3 Y% O6 E0 g9 }; M
move into pickaisle.induct3
& @" R2 _$ R) p/ t while A_i<=30 do begin
& z/ F3 o, I, _. W( q1 \% W7 Y travel to pickaisle.con(A_i)
6 G* W& f$ W/ i4 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# g( V+ `! |9 y7 [8 E) T" l0 | else wait for 10 sec
8 p! k b$ Z$ t# H3 J5 R! K if A_i=A_leave then send to die
! q$ Z+ g3 j- n+ G% `6 D else inc A_i by 1
, y( R; Q5 H; s9 t5 q# A% h" l end" _' S% f; A! x; Z4 h
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,其它按你的 ...
|