|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* x( i1 K; i: I7 {
f- y, T7 d" c- {* k7 S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' Z: V) Q, a" x; B4 y# o0 A4 _ o1 i4 I7 J J
begin P_read arriving
( ?1 W4 ^% ^ N2 \7 V R; v while 1=1 do begin
/ K( e2 K( q- { V read A_tote from "data.txt" with delimiter "\n"- x, H# k# @) a
read A_time from "data.txt" with delimiter "\n"1 B, ~' T _; F1 \6 T4 _" j
read A_leave from "data.txt" with delimiter "\n"
% U h( T6 \, _4 F Z read A_picks from "data.txt" with delimiter "\n"
; Y6 z7 J/ D7 {7 P5 b' {9 J0 q set load type to A_tote2 l) A( ?4 J2 ]+ [
if A_tote="tote 1" then set A_induct to 16 B, v/ t2 i7 x- r; I* }. A; F
else if A_tote="tote 2" then set A_induct to 2
3 u: H! t9 T/ Z4 M& b% m- j) W: N1 z else set A_induct to 3 : G9 g0 t2 H# z
set A_i to 0
$ w% `/ W% U7 c+ ~, ~ clone 1 load to P_induction
6 q) }* p7 o, W$ A wait for A_time sec1 W! B$ |3 M/ [8 k- n9 t
end
* `/ y2 J# D, x1 L) h: g1 v! lend/ D% B- D5 D* n/ A
9 `9 d- ], f, ?' k+ f, E$ p
begin P_induction arriving
+ Y( \. j( b* N" d if A_induct=1 then clone 1 load to P_pick1: f# [% H: B# g0 N
else if A_induct=2 then clone 1 load to P_pick22 y" s) U5 G% l
else clone 1 load to P_pick36 ~* M, C# k+ u3 |% G4 }9 M9 a
end
: a) ^2 N: A& V' Q$ b& E
! {$ n! V4 b# V9 o' Z% [$ m+ Rbegin P_pick1 arriving* o3 _5 K& K) k2 b9 a7 `
set A_i to 1
- y- o/ x g, u- _ move into Q_induct1
3 J( {0 M. B% R- b y. ~ move into pickaisle.induct1 D9 w5 b5 U- g
while A_i<=30 do begin
2 V1 w8 u |# ^7 q8 K1 U, ` \ travel to pickaisle.con(A_i)8 X* P; P9 M( }. T/ [' ]( U, k* o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 G5 @% a' f8 l2 R. E c# O
else wait for 10 sec
+ j+ `& {# n8 }% J$ d- m0 g( w4 D% j if A_i=A_leave then send to die2 \$ d5 g, ?( D# g' b
else inc A_i by 1
% ]# U- ^$ a- {) f& B( @0 B* o% C& {; F! K end
* H2 k5 T& W* d, C3 L/ Eend* v% s0 K2 P1 f. Y
$ {, H, y9 K; S. e) o. u
begin P_pick2 arriving4 ^/ q+ p6 B- H; q
set A_i to 11/ a; q1 { Q. [0 C
move into Q_induct2
* j/ j2 O9 P' @, n. [' V. H. k move into pickaisle.induct2
7 W l8 {6 u( N/ [: z \- J while A_i<=30 do begin9 \+ |# Q. G) g ^ `+ u8 |
travel to pickaisle.con(A_i)
2 f" @1 T% `% f- K- n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: B7 L1 ?( f0 g6 }- D0 M else wait for 10 sec g5 [7 M) ]+ k0 {
if A_i=A_leave then send to die& e1 B% [9 g- u @, P' U
else inc A_i by 10 J. ^! j' n( {3 ^
end- y& a1 ?: P8 `% v: R" C0 p
end+ X& W- `4 u: g% A3 d
! r# U @8 L# J9 Z4 W$ q9 ~
begin P_pick3 arriving) n" u9 N& e6 C$ a4 }9 T+ W
set A_i to 21
4 q* L( z6 s8 r8 B5 v" l move into Q_induct32 K' N; L/ i3 J; b, @+ I a! s
move into pickaisle.induct37 T& S# b( v+ z9 L
while A_i<=30 do begin; n" Y+ _0 o, V! n0 d/ v
travel to pickaisle.con(A_i). |7 t$ v4 B7 V/ j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 J" h0 @4 b7 ~& W3 D. X# v else wait for 10 sec) ~ k9 O9 u( Y! f# K3 l& x0 f
if A_i=A_leave then send to die1 X2 A) z) e' J6 R
else inc A_i by 1/ Q8 D h" B$ |- |. S
end' H' x5 a& Z7 i) a _
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,其它按你的 ...
|