|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ R( L6 T: ~% K( S, J
: o' ^% ]# G4 I7 o( b& v4 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中的数值,不知道会不会有什么不妥。# |+ n: c/ W9 {
" z% o a4 z0 g4 C% A" I$ o8 Fbegin P_read arriving2 L( F) `, ^* d' a
while 1=1 do begin, x7 l& i1 E/ U/ l$ @& r9 z$ ?
read A_tote from "data.txt" with delimiter "\n"
' A. U: C; W" }. Q$ d read A_time from "data.txt" with delimiter "\n"2 r( V7 n* ^& x) h: p: g
read A_leave from "data.txt" with delimiter "\n"
4 }# m) W3 s8 }1 }# o p/ f read A_picks from "data.txt" with delimiter "\n"
1 z& l0 Q ~; y8 X5 A6 C3 u& |2 H1 q set load type to A_tote9 J" i! B' `! g0 ^$ ?% p" N- W
if A_tote="tote 1" then set A_induct to 1
1 H6 ~4 b0 } B. H6 r- A else if A_tote="tote 2" then set A_induct to 27 P4 }' x* S/ M g
else set A_induct to 3 ( \1 g/ h/ A* ?' f" O
set A_i to 0, B+ P/ C+ v8 k+ U, D C/ p
clone 1 load to P_induction
( U8 z) y2 E, r) v0 o2 r; j wait for A_time sec1 \* c0 N$ G' |- {! @
end
7 m3 @; p. y9 O* Xend
6 ` K" n' j, m5 }' s w( R- |% N3 j4 c% ~ h" B/ ]8 S4 y
begin P_induction arriving# L, C$ a5 a4 E6 b: B, g
if A_induct=1 then clone 1 load to P_pick1; k+ Q3 f5 {. q n s( z
else if A_induct=2 then clone 1 load to P_pick2, J' c# p2 A5 c/ b& K" L
else clone 1 load to P_pick37 j: x% E) U7 d( T6 f
end/ J! b" s2 ?' f G3 h' D& l6 n
0 I" j5 |1 W) M' V5 n9 s) h$ s
begin P_pick1 arriving
/ a+ O& f! G: K" {. O1 ? set A_i to 1
- b9 O, E+ h# J2 I% E move into Q_induct1# J. e" k6 G& q* g6 J
move into pickaisle.induct1
/ m) s5 r) t- v; F while A_i<=30 do begin
. y: x5 J: a# ^5 W travel to pickaisle.con(A_i). D; F! v. J/ L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* h! U7 J5 E- T" l3 A
else wait for 10 sec/ r. v/ G% j2 ^/ b6 l
if A_i=A_leave then send to die8 Y# o' c' y, e; l! P/ E
else inc A_i by 1
+ v( k0 D4 H( T end
, _$ }5 ^0 P0 F& V+ Q) d+ G& Fend0 A% d- H `* _( l" g% K
( f) m1 c% Y' n& x( P7 ]$ C
begin P_pick2 arriving
% H7 ?: y$ @0 K( ~8 }- i" G set A_i to 11+ l- L0 l- C: y# n5 z! n8 [
move into Q_induct2
& P8 P0 G+ q7 J move into pickaisle.induct2! h& c4 D8 K) h$ U+ E% q' E& x
while A_i<=30 do begin# W; p& [7 h7 B6 m
travel to pickaisle.con(A_i)
, V; m/ i' I+ B2 |' ]0 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( a- f3 v8 b+ q8 K+ g% Z) Z
else wait for 10 sec
" {7 @* h; o" A; c1 h. F: J# ^+ V if A_i=A_leave then send to die
w' A- c' P! D3 ^) v else inc A_i by 11 ~, k# |8 {4 \+ M
end
9 ^6 i) d" H9 c: [end* S% i1 a# s% t9 I' D% K1 }
; ~8 Q; X3 c+ b5 A: D
begin P_pick3 arriving" w2 z6 m) {# w. H# [6 x9 G
set A_i to 212 X: {% g, l; L- J" \8 Q
move into Q_induct3
5 |9 A* Z3 b- {3 G% p7 \9 X- x3 g move into pickaisle.induct3
: w% X& G6 x! P& b7 w) L" f \9 x while A_i<=30 do begin" U6 s+ m7 P" G0 m7 G
travel to pickaisle.con(A_i): [: @+ w* x8 x: q& S! k. {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 D: b. l1 Y0 O0 O6 c& D
else wait for 10 sec
o1 ~; v' M. e4 z' {+ F7 s+ Z if A_i=A_leave then send to die
; }: j1 I i4 f else inc A_i by 12 M( G( `, g9 `: V& Q% e
end
! P( d& v( `) ?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,其它按你的 ...
|