|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 e$ U" ?" f. `% p+ A2 y
7 h7 g" Y( A! ~) f' o! J我的问题是,在每个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 \1 S U" [5 t
0 p/ J+ K2 M/ y$ _# Wbegin P_read arriving
7 x# C; x5 \- {- \ while 1=1 do begin2 |" G: `( ?* k# X# w4 L
read A_tote from "data.txt" with delimiter "\n"; P$ n4 |3 l, | {
read A_time from "data.txt" with delimiter "\n" P+ g$ e' E! b+ L1 ^$ e
read A_leave from "data.txt" with delimiter "\n": O. r$ u- v9 i+ S( l0 g$ k$ x
read A_picks from "data.txt" with delimiter "\n"
3 Q3 b& D8 h' v+ x U: x5 L* y set load type to A_tote; e' [+ }4 a7 K8 d- f/ Q
if A_tote="tote 1" then set A_induct to 1: K& y* s z- ~0 f
else if A_tote="tote 2" then set A_induct to 2
3 ~4 Z1 W. X( Q/ I% g" G; z- N else set A_induct to 3
2 X e) ~3 e; W% U set A_i to 0
, s- S% A: x7 p" D clone 1 load to P_induction, [- m# l7 n* z7 A* C
wait for A_time sec3 B9 e' M" ^& O. Q& S2 V- g' a. o
end6 j' F5 n8 X4 ^, [( ^ G9 ?% q
end) x& v7 u+ g/ c3 Q
+ w/ j3 ^9 F- j$ D% {9 ]# f+ n9 Sbegin P_induction arriving& \4 v. i% M9 ]+ H% o
if A_induct=1 then clone 1 load to P_pick1
! U7 v) a9 ]' v! b; p* X; e( g else if A_induct=2 then clone 1 load to P_pick2( |7 Z% R+ l5 w4 {8 b1 V8 v
else clone 1 load to P_pick3
8 h3 Q8 ]! B, p) Tend! P& f7 z$ h; T& I
4 H$ n( r5 C9 f. D3 Bbegin P_pick1 arriving' |% H5 L1 q% e
set A_i to 13 X A; @) p9 } Y* q- X0 T
move into Q_induct1
- k, l9 ~9 g( F4 d/ r0 a7 Y- [ move into pickaisle.induct1
0 [4 z2 I/ f0 e- y# m' H$ U& Z while A_i<=30 do begin
$ o6 {* u- S2 {% T* g0 m travel to pickaisle.con(A_i)' O# y: d/ Y" t3 q( h ?" {2 \+ H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ]) x s6 x5 @ else wait for 10 sec
2 ~7 A6 j( c' |* A8 V2 ^ if A_i=A_leave then send to die
0 [ B" |" o: _1 p" F* i9 r; W4 Q, Z' j else inc A_i by 1
; b( B/ f0 m; j& h% v; V end, K5 `. `, V$ f+ h5 l; S$ i
end$ D) T$ V, H O) g, g5 t& \ d
: |% O- h" Q: L; o" F" T. H
begin P_pick2 arriving
, j7 X: Y) h8 F. A set A_i to 11- |$ t& N) I! p. P" P6 r8 L7 a6 y7 d
move into Q_induct2- Z% U" r( B, G" g4 @0 c& a
move into pickaisle.induct2$ L% @8 \0 X& j% o) y g% D
while A_i<=30 do begin
' k" p) j0 a$ I8 o5 { travel to pickaisle.con(A_i)
0 V+ ~9 g; c5 N: W3 c7 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, T" n* e5 P# F, z else wait for 10 sec" g9 t) G+ Y# U# Y4 B9 X
if A_i=A_leave then send to die/ b. N) ^* v" s. s! _; A
else inc A_i by 1+ M' T' D' w/ w; K
end$ n( Q7 u' m' v/ p
end
) h b* o4 J3 d7 y {" e; y8 q. i. w S8 P; P; v" v# J) }( N
begin P_pick3 arriving
Y$ a" A/ k1 C( E: t# Y% l+ s set A_i to 21
9 X6 P/ f$ R+ I! w5 R J6 B move into Q_induct3
9 A4 A1 q1 ^; B6 k move into pickaisle.induct3
; u" i$ h6 a5 E' P; Q while A_i<=30 do begin" R8 j$ {5 s6 H$ q) Y
travel to pickaisle.con(A_i)& N8 Q- v5 I, A+ P$ [# a3 U2 C: @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) |- j3 e( z# a else wait for 10 sec
1 m' r: ^6 h$ B+ _% U+ X: { if A_i=A_leave then send to die- S& s. ]2 K1 r% M- u4 M
else inc A_i by 1
( o) z# j# s% S+ `& e end' v+ }4 c( L6 z# z, n V% i
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,其它按你的 ...
|