|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, L$ L9 C9 S3 }% k
3 y! V" {3 z% z4 H* A# s, o1 u我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 o i, `% a2 D' L! E( U. s, ], c2 l0 D1 G% [
begin P_read arriving
* s% t9 s, O' L9 x# I8 \! C& ]/ } while 1=1 do begin8 U% v$ Q0 F, W. }6 w( H% p( J @
read A_tote from "data.txt" with delimiter "\n"+ ?; g: j) f8 s; a4 q) e6 x
read A_time from "data.txt" with delimiter "\n"
1 G; C/ f* @- I" r9 @6 Q8 J read A_leave from "data.txt" with delimiter "\n"$ w2 B2 y4 ?, {3 V1 Q, D
read A_picks from "data.txt" with delimiter "\n"5 U. [+ Z4 b' p1 ]6 V: `5 O
set load type to A_tote
8 J; L, N; H9 u1 J if A_tote="tote 1" then set A_induct to 1' Z7 d# P3 }0 P5 b& n0 x* \
else if A_tote="tote 2" then set A_induct to 2% q9 c6 O$ K- ]) I/ |7 t9 P9 Y# H
else set A_induct to 3 - c% ^+ {+ j/ b" @% ^
set A_i to 0
! B& O! a1 l& X, {9 m" C' K; w, ? clone 1 load to P_induction9 J3 N- T5 d E- H
wait for A_time sec7 q4 t9 v* n* s+ X; W* j, [
end% g1 ^8 D/ W. t
end) n: [" E6 t0 J# D
! M6 M# j) d9 o+ O; |, {5 Q1 W
begin P_induction arriving
& T# C# J6 F g if A_induct=1 then clone 1 load to P_pick1
A6 t# ^7 a: i% ^5 ? n9 j else if A_induct=2 then clone 1 load to P_pick2$ e6 o( y+ d+ v# _
else clone 1 load to P_pick39 [/ W" _ J3 ^! x# U+ y
end
3 d- U2 q5 l4 W _3 F6 b
. j* v$ n) c+ N( xbegin P_pick1 arriving' j9 {7 K2 B3 }; K
set A_i to 1
4 I) L& o: n( B move into Q_induct17 x N2 r; U: z: R
move into pickaisle.induct1+ u9 S# t0 a" l. w9 U8 H
while A_i<=30 do begin* Y9 c/ \- |2 j* g$ L0 c& H4 d
travel to pickaisle.con(A_i)0 ^4 a/ r6 U" L% x8 R i! U+ |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 n7 ^9 i/ @1 p$ p0 v- Y- P1 p2 _- G else wait for 10 sec& {: m4 T; b8 p9 ~& S
if A_i=A_leave then send to die' L l* d* j1 N' z, |
else inc A_i by 1
4 d z/ H" v( c, h3 | end
* V. E8 |5 q5 i, V1 uend
0 ^! e1 V! A0 B. }8 L. d2 R. E4 j7 g, E! t' }5 z" s
begin P_pick2 arriving
/ Z+ X# Z$ H- u! Y set A_i to 11
% n6 U' {2 x- W move into Q_induct2/ r8 Y* k& `" h% V) y
move into pickaisle.induct2
/ |! q) y/ G/ K# @5 \ while A_i<=30 do begin1 R; ]3 J3 P: \& R. Y
travel to pickaisle.con(A_i)
- \/ b3 x( U0 L& v$ @9 O3 z8 t! o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, m7 @- |- t: s8 w5 ^' r$ j$ O
else wait for 10 sec& w' J% e3 i8 g: o
if A_i=A_leave then send to die; Z4 Q- g& B& ^
else inc A_i by 1
! C+ T7 S1 s; H# e, w& p8 a- c+ j end' W- G' S& X+ N
end
1 K2 m, M( S( T5 s+ r+ Y7 a, }
# {: S+ n( D+ K& c/ ^: Rbegin P_pick3 arriving) b) ?6 i5 Y2 e5 J- O
set A_i to 21* e8 d1 _7 }* L* d9 }3 K
move into Q_induct3
4 w7 w4 I) H1 J# M2 L move into pickaisle.induct3
j3 H0 v+ ]2 J5 E) I7 n while A_i<=30 do begin% l: m$ p! T* n9 U2 S h6 ?
travel to pickaisle.con(A_i)
7 j K3 H5 v0 C0 {* I" `; [3 x* B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" U# ?+ |3 g1 M3 h, `# K. z( U& p
else wait for 10 sec
! p) L3 [! l0 n+ F1 | if A_i=A_leave then send to die
% p( w2 `5 S. R else inc A_i by 19 I! u5 q: h9 @. y) y6 Y" P
end
. P3 p5 h/ _7 ?; w5 A6 N, Hend |
最佳答案
查看完整内容
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,其它按你的 ...
|