|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. { c( E% [6 G/ w0 S0 z4 R- C
% n! v8 o& e- ^9 y r6 F我的问题是,在每个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中的数值,不知道会不会有什么不妥。 T4 j4 C. S m* H# g8 e
& }2 t/ v& Y% g1 R# f' U3 W M
begin P_read arriving
( v1 e1 S4 I* {0 a9 F; Y while 1=1 do begin7 |8 t/ Q* j" R4 N, s: t
read A_tote from "data.txt" with delimiter "\n"2 O1 v% X% d, H+ \0 D: s, c8 ~
read A_time from "data.txt" with delimiter "\n"6 G; }2 S4 f U" R1 t6 ]: @7 R; M0 z2 n
read A_leave from "data.txt" with delimiter "\n", }. E2 y) t4 k. z3 r# m
read A_picks from "data.txt" with delimiter "\n"- t8 l( W4 {! r X( p6 d
set load type to A_tote
6 b" n2 _7 F6 y( o( {% d4 F if A_tote="tote 1" then set A_induct to 12 y4 X6 ~& Y! Y+ X: Y& F+ s
else if A_tote="tote 2" then set A_induct to 2$ P9 O* V6 w; u
else set A_induct to 3
7 c( e, f3 Y7 z8 o set A_i to 0
& r6 X; \) f4 G' ]9 z3 m clone 1 load to P_induction
9 X) l( g' n9 ~' @$ g wait for A_time sec$ N& W: D7 e3 Z1 V
end; |* a: o7 j5 D
end
5 }4 }% l/ b; v" e6 T) Y
( ~4 i/ C: Y$ X; e: qbegin P_induction arriving
# ~/ A" l7 a) @9 `9 E if A_induct=1 then clone 1 load to P_pick1
; F& v0 T3 o z6 O& G, h; s+ x$ p else if A_induct=2 then clone 1 load to P_pick2
6 s9 e" a) o, v; W& \4 n1 i: ? else clone 1 load to P_pick39 j$ @7 y Y3 w. g% H. f$ O+ V6 m
end
% B) S9 W9 b* Y& ^( v' s
2 h/ s. k8 o: g! t' K3 M3 z' {3 nbegin P_pick1 arriving9 q- }9 f' i/ W4 l
set A_i to 1
8 l" P% p* D9 B3 N5 d: ] move into Q_induct1
9 p3 n" i% x* W3 J8 w& E* F move into pickaisle.induct19 U. g/ c, i' w0 W; @, j2 z
while A_i<=30 do begin
* n7 q& v9 |. A* u* y travel to pickaisle.con(A_i)
' t' Y U/ P' v! e$ m5 j" u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 B3 o6 ^+ |( B3 {, K9 p
else wait for 10 sec7 [) q* j4 L3 P! g2 u) U, M
if A_i=A_leave then send to die+ t- c+ e: f9 s# t& i# f
else inc A_i by 1 E. Q3 a/ {9 Q9 ^$ P0 F9 `5 S
end
: R- q9 T- l; F1 tend. o* B, I' w* _6 V$ d! H
* [$ r! r2 |9 E" R0 sbegin P_pick2 arriving
, X f2 f4 W) n2 Q- x) H% P. m9 U( O3 q set A_i to 11
' @' w7 K7 P8 F( N- H3 Y( l3 q move into Q_induct2
4 T5 o' |, v% w# Q$ ]8 h& |- u' y move into pickaisle.induct22 X# F/ l; [" n" e7 P* p
while A_i<=30 do begin( m- \, Y. V0 I+ f/ ]
travel to pickaisle.con(A_i)! t, ~$ L# K; s: e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 K7 ^! k) B- j9 c else wait for 10 sec5 g/ W H; V9 }: S5 P- ^3 N8 E
if A_i=A_leave then send to die
2 z: I6 R8 s! L$ q' v9 v) P5 j0 D else inc A_i by 15 y3 ^" T9 {+ j7 i
end' @5 k m: h: d2 n$ a' a
end
' k2 x1 y' u: a4 k2 q7 o( J$ D# h5 E W$ q2 i
begin P_pick3 arriving" E. p) q. M6 H1 b' a
set A_i to 21) t2 v" P% r" r+ j9 y
move into Q_induct3
4 P$ e; W; d/ ? move into pickaisle.induct3
! H- b, t/ ]! r/ ~6 N4 g; P while A_i<=30 do begin Q- g4 a7 f( x+ B; j
travel to pickaisle.con(A_i)
2 b# @* p- V) f2 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ~' Q7 J% j1 e# q6 b1 g
else wait for 10 sec
, F: ~1 t$ Q' l7 c# I3 k if A_i=A_leave then send to die
, f! C0 l* B* G9 t4 @, j$ A% q else inc A_i by 1
# B( M0 ~, d6 Y( r end
' [" o* l& B1 K* `$ l9 w. a5 wend |
最佳答案
查看完整内容
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,其它按你的 ...
|