|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: O. L- _8 {$ e% H5 m9 T3 R
" k. B! I! T7 x+ 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中的数值,不知道会不会有什么不妥。8 Q1 A' F5 n' y
( B m# J: p9 P# ~begin P_read arriving
$ T+ L9 r2 k0 y( j4 P' Q while 1=1 do begin
* l5 P8 z! o- N, v; L3 F0 q! ^6 K read A_tote from "data.txt" with delimiter "\n"# V. B5 Y: {) w
read A_time from "data.txt" with delimiter "\n"
2 D0 a0 w) C0 W2 s read A_leave from "data.txt" with delimiter "\n"
0 x! `- E9 }. F( s; b; R read A_picks from "data.txt" with delimiter "\n"* a& u% c' H7 U' c
set load type to A_tote- x4 R) r& }* M' N
if A_tote="tote 1" then set A_induct to 1
3 h9 `8 |/ E0 W' q5 e6 B1 ] else if A_tote="tote 2" then set A_induct to 27 y2 Q+ ]* r1 ?& M; ~9 @
else set A_induct to 3
9 N/ f4 o# \0 S5 P- k9 { set A_i to 07 {' @1 s7 ~/ w1 e1 S' Z
clone 1 load to P_induction2 s6 L9 u t; S F5 o0 c5 I
wait for A_time sec
( U% m6 A' h5 d4 g+ ~& I! }' j end9 S' C6 l6 _" W* `+ B* U
end
5 B/ L) t8 r4 a1 z. _& k
P1 M; e6 q& R" hbegin P_induction arriving' L( K* V$ b2 ]9 T$ h
if A_induct=1 then clone 1 load to P_pick10 u; f5 i( |% C( }7 ~+ Z4 |
else if A_induct=2 then clone 1 load to P_pick2. y, Q: t3 U8 ?# U" c) q+ D
else clone 1 load to P_pick3
, S/ R5 J6 s. s4 yend
0 E" X8 F! A2 [ B0 y0 M+ ~: H9 ~& V; `( E' Z* P$ S
begin P_pick1 arriving
; D- J3 O5 _4 p3 z, [4 E set A_i to 1
' u# M! v0 ^8 `3 m move into Q_induct1
" {( E3 _, @9 w* e. Q2 t move into pickaisle.induct1
8 P! N$ ]( l* e+ a! j' U- I( x9 u while A_i<=30 do begin
$ W: }) w( g2 l travel to pickaisle.con(A_i)
+ M7 V4 C b6 f s4 ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \; P2 A; B4 [; n9 q* T& X& N4 B else wait for 10 sec! E3 y* j( K3 t: r
if A_i=A_leave then send to die3 O( J$ ?2 c& ?: I$ Q1 ?5 e
else inc A_i by 1
! @) E3 W' e# X# v; V end* g8 t/ g+ I9 r* T
end
5 d, I; F7 C6 R% ?0 [
4 Z) L. [8 {- X7 n% ^5 |begin P_pick2 arriving
# ~& i# c& B4 T4 c7 x set A_i to 11
% Y/ w# g2 A- o move into Q_induct2+ M% b, R' h& S- s% t1 z0 u+ X
move into pickaisle.induct2
: R4 |0 ?$ v5 U. `0 V% {! J' w while A_i<=30 do begin# T6 r; m5 {8 s. S* o) q
travel to pickaisle.con(A_i)
( c! O! b9 r* o, n+ d6 S4 L# j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec G/ @' j7 O0 Q" m. h. n0 l
else wait for 10 sec
v# m/ G _, o4 S if A_i=A_leave then send to die' k# O! Z6 e, m
else inc A_i by 1' B+ n8 Q2 W& X! E% E# S [- {
end$ p4 x8 ]- j* M3 X+ l
end
, e9 L0 M" W8 e$ E& r8 c% Q/ X
0 t: @0 l, ?# l8 D& e- _# m2 jbegin P_pick3 arriving
9 @ D/ ]( z9 Q3 n; K9 g set A_i to 21" R" S8 t3 A! K$ U
move into Q_induct3
; B' R- A/ P% t; J: ? move into pickaisle.induct32 \/ f# R, X5 S# V; p3 u0 F
while A_i<=30 do begin
. K3 }4 P4 @( @8 M+ Y travel to pickaisle.con(A_i)
' q5 M6 [! }3 o) K6 F0 R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* O( j/ r4 C0 s* @% w
else wait for 10 sec* F$ M& f1 P; n: ~
if A_i=A_leave then send to die
' W Y1 X+ \. a4 D else inc A_i by 1$ h" X3 V' d" [# b
end
, O% G/ B ?9 P( c9 C a5 [' ]$ r2 lend |
最佳答案
查看完整内容
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,其它按你的 ...
|