|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ R: I5 J& ^! ?
, O& @* U1 K( `% e! \+ ~2 e4 |我的问题是,在每个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中的数值,不知道会不会有什么不妥。, s0 c4 D( S; T+ K( @6 e
$ F1 V8 P! c& K+ M- t
begin P_read arriving1 n! u) E+ j; y+ q3 [
while 1=1 do begin
4 M- l# [! P' Q: y' s$ d read A_tote from "data.txt" with delimiter "\n"
; v1 j! f+ N) g read A_time from "data.txt" with delimiter "\n"
8 L3 ~# r9 |0 L: a$ @; L- j6 r; B read A_leave from "data.txt" with delimiter "\n"
% q6 W; P" x( I" X, e5 Q* ` read A_picks from "data.txt" with delimiter "\n"
9 o/ P6 K. i$ |2 x _, s set load type to A_tote2 }6 x! _# O2 A( ~$ d6 ~
if A_tote="tote 1" then set A_induct to 1
1 m, W0 L! e$ n4 H- h5 ]& [ else if A_tote="tote 2" then set A_induct to 2
0 v |& p0 Y0 q k else set A_induct to 3 ! u H4 y: m; E! k) h/ {8 g
set A_i to 0
* q7 m* g+ `& J4 ~& s2 ^ e! V clone 1 load to P_induction7 u- ~7 y6 {5 O o
wait for A_time sec
/ ?# |# c/ U9 m' ?; b& i) ?1 } end
7 ]( a3 p, ?3 Z* mend
' {6 {. L2 H# X3 k
2 ~5 `$ N" t* r3 ~! b" e, rbegin P_induction arriving
- I' B/ X7 v" V2 J if A_induct=1 then clone 1 load to P_pick1- J! z j* @. O% _& L
else if A_induct=2 then clone 1 load to P_pick2
' b* g7 o7 P( t. x else clone 1 load to P_pick34 }3 f- h( V1 Z+ n- g! b
end
$ Y6 m9 z# Q. ]3 Y! {7 D5 U' @0 }- n3 U5 J2 L+ I- K
begin P_pick1 arriving$ a6 {1 x# V5 t3 H- u7 Z6 m) m
set A_i to 1
4 s2 ~" S! ~/ f& Z6 g+ s move into Q_induct1# {7 s ]) s3 m; k8 p
move into pickaisle.induct1
S8 V1 t* M* { \& |! R0 u& E while A_i<=30 do begin% X+ z0 y" \3 Y& J4 F6 q
travel to pickaisle.con(A_i)+ U0 d' z, U: s+ b x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, @5 _# f( t1 m) L# P- o& @# W+ k2 j/ n
else wait for 10 sec
" [! F3 G z& V# Q if A_i=A_leave then send to die
@, @' T" R3 \# ~! E else inc A_i by 11 Z( u3 b; k8 B3 l9 I. }, N \
end
+ D1 L+ V ^" U* T, h# uend
2 }6 }4 J: ]& J
. ^$ u, d, t: _$ ybegin P_pick2 arriving% y% D3 L( E+ L; \* t7 c) a7 b
set A_i to 11
" Y$ x7 r- k. |9 K; a- y move into Q_induct2, k% j; n* t* T1 l+ R
move into pickaisle.induct2: T1 w' F& q( @/ D$ d9 q8 z: l
while A_i<=30 do begin
2 A+ `& y. H( d, f* e# ^( \$ x travel to pickaisle.con(A_i) p- O7 g4 f; d( `% ~; u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ?& Q" o5 u2 p6 D @
else wait for 10 sec# ^5 Q2 N( w: \$ h7 f" T/ D
if A_i=A_leave then send to die
8 r# G% S3 n+ B2 A else inc A_i by 1
, s7 C& {0 F# x4 B end
+ y/ e7 J$ ~" y: ~& Oend
. x! E' E& {% p @1 {7 b6 E; C H% k! T5 M- b* w/ u
begin P_pick3 arriving
4 E Q) e# C- Z0 C' H8 P set A_i to 21
% h- ]# h& y8 `, H move into Q_induct3
H# n8 x+ X$ [9 A2 u move into pickaisle.induct3
. X: v: k1 s5 T ]- R while A_i<=30 do begin5 i b$ q4 \( R; u Z3 ]
travel to pickaisle.con(A_i)1 ~' o4 B/ h( M7 Q3 u/ }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 i p' W# ~ G# _2 q9 U
else wait for 10 sec: w2 ^0 c3 V( @/ H: ?8 m) q) `( @) R
if A_i=A_leave then send to die
/ W6 y; O# I$ |) Z/ | else inc A_i by 1
4 E% w# Y3 t% K- s end/ g. p2 T3 G _0 a- [8 F# |
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,其它按你的 ...
|