|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# d" r# K+ {, x7 M8 a9 i/ u$ M; y
* I3 \8 G, j' 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中的数值,不知道会不会有什么不妥。) X2 A0 O8 X& f V1 u: P. B
: T; n' t1 w3 G2 Kbegin P_read arriving' E% Z$ C$ n2 G2 ?; W3 ^
while 1=1 do begin
! g3 J3 L; ]. @- v' w: ~- m read A_tote from "data.txt" with delimiter "\n"
0 H( [% I. R; |2 p read A_time from "data.txt" with delimiter "\n"
5 I6 a! c: F1 s% [- y+ J# ?: Z7 | read A_leave from "data.txt" with delimiter "\n"
$ n4 s# \/ y2 \8 z: b( s" y: v9 { read A_picks from "data.txt" with delimiter "\n"$ P% D2 E+ v6 D: I& C! N+ W; I
set load type to A_tote2 ~! O% X% m x, P& n
if A_tote="tote 1" then set A_induct to 1
* H. ^& `7 [* t6 h. U: o3 X# e else if A_tote="tote 2" then set A_induct to 2& x6 H; [5 k4 x3 O3 m( ?
else set A_induct to 3
: D$ x5 q2 d! g8 y& |: a1 h set A_i to 0
" Q2 w# }) S3 t# o clone 1 load to P_induction! Q5 [6 x( }+ {3 t( ~: [
wait for A_time sec! S C6 Q: a, X/ }" E; X0 j) r
end
; a' c& X$ A- t# K+ n6 Vend
& v. }7 E1 V9 r+ X0 i& X& Q L, O6 |' m) G7 L+ Z5 \
begin P_induction arriving1 W+ M6 O* ` e5 [* n" o
if A_induct=1 then clone 1 load to P_pick1
& C4 e% d% i% p. x: U2 k3 I else if A_induct=2 then clone 1 load to P_pick2
6 R8 Z) L5 C% G4 a- |- H else clone 1 load to P_pick3- m: Z5 C7 h. V5 V
end' ?9 X z; j- B& l$ R5 W- W
) p5 N5 n2 U: q: _$ a- }
begin P_pick1 arriving& o. W4 |8 M* r8 M( o" T
set A_i to 1+ V8 X8 j; k) f4 M7 M
move into Q_induct1
1 a; L; g' H' U; o( P9 V move into pickaisle.induct1
* a6 S; t0 d V' g/ x$ ~ b while A_i<=30 do begin4 d& h( ]' A$ a9 @" Z
travel to pickaisle.con(A_i)
& X# t1 G3 ~. _2 P# I* [) ~7 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" a4 J6 H+ q. N" p( s
else wait for 10 sec
$ v& P" j# A* O% L if A_i=A_leave then send to die( D9 X S( I; [- y, n
else inc A_i by 1- J. q9 z& O) N: c8 l6 i( C/ r
end$ z) w1 ?1 J: ~; D! ^
end
( R9 `0 s4 ?6 o$ W' X9 _, v* [
P- _* X9 E( Qbegin P_pick2 arriving$ d" P3 Y# N1 ^5 Q
set A_i to 11( W1 S2 A& r/ g2 M, Q* [ D
move into Q_induct2
" ]1 ~2 r3 ?2 c move into pickaisle.induct2
! A7 S7 G) m7 e6 ` while A_i<=30 do begin
' q2 M Q- m1 u1 ?' | d! T5 K travel to pickaisle.con(A_i)7 E# L4 t1 T* p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ w4 S2 k8 D+ Q3 ~7 c
else wait for 10 sec# q2 J: B" P1 J% g Y
if A_i=A_leave then send to die
8 Z0 j, t3 Q% J6 c1 g/ s$ ` else inc A_i by 1
I/ l W8 }/ q6 K$ N: ? end
; a! D6 F; X! Mend. f* Y! |; q0 e, N1 i
9 u' Z' F4 b" X$ C
begin P_pick3 arriving7 _0 \, _. D/ @3 W; t
set A_i to 21, c3 b, ~8 u; d3 N. u
move into Q_induct3
6 \8 v: d+ H$ I: ]/ N move into pickaisle.induct39 z3 z+ S& V. W& R
while A_i<=30 do begin
$ N H, | S1 p' x+ W. S8 p travel to pickaisle.con(A_i)1 s0 J: \- `8 {/ X$ p! C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. H8 y2 `1 v8 {5 ~% d; c
else wait for 10 sec: w9 V3 x2 I& K3 h7 r
if A_i=A_leave then send to die
/ ^" O4 X! o% e) L; w& A else inc A_i by 1: D* }9 T% v, F8 e! c
end4 t- W; h6 R1 }$ Y
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,其它按你的 ...
|