|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' a @5 c8 o% D/ b, K2 O
( V' V" J: @8 d4 S, o; _我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 C; v4 _6 h, Q4 I( A6 D% i0 s: T
begin P_read arriving
1 F6 W. b$ g/ w4 s+ L- p while 1=1 do begin, Z( l5 H* E' B. _: q% f
read A_tote from "data.txt" with delimiter "\n"
4 @: a: r: a, y& w: z$ p6 ] read A_time from "data.txt" with delimiter "\n"
, w$ L3 F$ L7 I( o* J( T read A_leave from "data.txt" with delimiter "\n"
' K8 `- G4 g+ \: d read A_picks from "data.txt" with delimiter "\n"
{1 V4 v; Q* B8 b' N( p1 `# h7 g0 H set load type to A_tote
! w% j& T$ d9 Q8 n- j if A_tote="tote 1" then set A_induct to 1% L$ l/ [6 Q7 O& @6 K
else if A_tote="tote 2" then set A_induct to 2! e, s5 l; r. S9 j2 T8 d. X$ P
else set A_induct to 3 " `) J9 B& K( I, N* v
set A_i to 01 w# B+ b2 M+ p$ ^
clone 1 load to P_induction
* f0 J+ v& L2 Y' c wait for A_time sec
/ A3 y: U+ s1 ~( m( ~ end
3 B0 m# k3 B/ y9 b( P8 pend
' o4 x/ b- |* h, b8 R* z: Z7 l
( l% O# [3 f7 P3 ^* ?* L% nbegin P_induction arriving9 m0 k0 Q7 } o- v
if A_induct=1 then clone 1 load to P_pick1
- x; z! P3 S% ]" O {# i$ ~9 j else if A_induct=2 then clone 1 load to P_pick2
K6 f& ^9 a; h% [, q, w else clone 1 load to P_pick3% r0 f$ ~( C2 w- v1 D
end9 k. J+ ^8 D2 N$ W
% ]1 @3 N; Q# q1 C2 K
begin P_pick1 arriving
8 j7 J+ o, X& C4 y" _1 k# S set A_i to 1$ s m7 C! m) I1 ~: s3 t J7 C! T l
move into Q_induct1' o( O `2 _% b% J+ L* b
move into pickaisle.induct1
! f( [( H3 p$ L3 h# S while A_i<=30 do begin) A8 s* X+ y' {1 X
travel to pickaisle.con(A_i)0 U n8 j }0 v9 z8 E x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 {6 j4 f4 n! P else wait for 10 sec" y; E4 ^9 h' ~9 v H+ X( \) W
if A_i=A_leave then send to die
3 b4 h+ e3 [; N2 K ] else inc A_i by 18 d, u! r; [) r
end
6 a( U2 P, o6 _6 U0 k2 Cend
" Q! q$ ]1 X) E6 {6 \
' \2 K& M, \6 I' kbegin P_pick2 arriving
; W) o6 Z4 A# @7 W3 V. h set A_i to 11
6 \6 [8 q9 J$ w! @3 X move into Q_induct2
" T1 y$ K( l, ^, H) u move into pickaisle.induct2
7 ^5 W5 c G- P6 U while A_i<=30 do begin3 M& X/ c% G) x: f1 l3 S
travel to pickaisle.con(A_i)
' U* q9 b9 V$ M1 W! w7 L# `( W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% @3 J! T% F2 W: H/ K2 S else wait for 10 sec
: E; {# W. N; W if A_i=A_leave then send to die6 o* p8 W7 d7 V9 r; x, d
else inc A_i by 1) K+ c( Z) P: \4 C0 t8 b! d
end
- R$ K1 \& t* t" O0 eend
/ W U7 h8 y+ m. q# x) r, j/ w4 e* }2 i0 |7 V, O
begin P_pick3 arriving) L- V e; C& v+ `: x [8 \9 w
set A_i to 21
9 N) W4 ~ N$ p. {0 j" V8 U move into Q_induct35 S& _: z. c* J+ I' `2 a( h8 u
move into pickaisle.induct3
: S5 J' w0 d8 w8 [ while A_i<=30 do begin
3 D4 C" G4 q* _8 |% {! L# H travel to pickaisle.con(A_i)
0 p! j' z* E& g+ m1 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 {( G9 Y/ M& [# a5 B. @
else wait for 10 sec* v1 P" V/ Z0 A/ \* l4 Q
if A_i=A_leave then send to die/ @3 t9 O, \% b9 p7 u
else inc A_i by 1
: |; e% s; p c/ K1 u, `1 x end$ A) m8 U) 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,其它按你的 ...
|