|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ U& h3 L+ a A8 [# g% H o' S2 W, E* i! l6 M: Y; a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! q- v" ^- m" c6 N
3 q$ W' |7 G' C# Nbegin P_read arriving; N; V3 [9 F: W& [& n* s* G* L
while 1=1 do begin
n) V7 z' g$ t6 O" m read A_tote from "data.txt" with delimiter "\n"3 m6 O. u/ }9 r2 _' {
read A_time from "data.txt" with delimiter "\n"5 e6 A" [: w* @1 q
read A_leave from "data.txt" with delimiter "\n"% y7 f0 N! Y- _8 k1 b# p6 k
read A_picks from "data.txt" with delimiter "\n"
1 `$ K7 M! I8 A" I, D set load type to A_tote
/ Q* \: ^. Q8 _6 \ o2 a- M if A_tote="tote 1" then set A_induct to 1
- M( i9 j8 t; i# b7 e, b) A4 m, J- ` else if A_tote="tote 2" then set A_induct to 25 v" W3 _: c5 q4 m
else set A_induct to 3 ! } I5 |5 F# n( H4 s" k7 T B% S
set A_i to 0
! c+ Z2 a1 f4 B& c7 c e$ g( E clone 1 load to P_induction
8 K! z5 i8 } N0 | wait for A_time sec
, k6 r7 a X% B* I5 A" I6 e end v G. a8 n, i7 |8 C
end! A& U! m& \( c& D
/ r4 ~0 a) \* I2 d! `4 Z8 hbegin P_induction arriving
. ?& F- L* n* X0 v if A_induct=1 then clone 1 load to P_pick1) H" L: o S2 h1 P
else if A_induct=2 then clone 1 load to P_pick2# k+ S5 L& B x& C2 G" Y$ A
else clone 1 load to P_pick3
- z H' P) a* [- ?end
; S; r! I& n# z0 u! X+ x+ w/ `' x7 `1 c( u7 W+ @
begin P_pick1 arriving$ k0 o- P# t6 d- v1 X
set A_i to 12 _9 W4 B2 H: K+ {0 i' M4 s
move into Q_induct1
# u+ C& z3 d& i3 D move into pickaisle.induct1
9 `- {6 ?8 ^) P0 n P k while A_i<=30 do begin- E, ?) i7 b9 B! J# O. G+ V
travel to pickaisle.con(A_i)' l* Z) e$ s5 o' j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% o4 A/ K- p, ?( _* ]* a! b else wait for 10 sec
/ Y# Z ~- M4 ~3 i if A_i=A_leave then send to die
( \; ^3 n: G0 \ else inc A_i by 1
3 A% {: E/ Z7 v* N+ b& `5 | end3 m, F5 b% r1 t3 Z( r
end
; b9 s- T" [6 e, m! R5 j% q! z7 x. t u' V j3 Q
begin P_pick2 arriving% o, M6 t! G' w+ I: G% d: T# K
set A_i to 119 V* n+ {8 E4 Y/ B$ I/ E8 y
move into Q_induct2
, v* ~# J2 r" O. a" o( v0 C move into pickaisle.induct2, s0 F% O5 \, Y/ P6 E4 U
while A_i<=30 do begin: n% a3 ?: \- Q0 |
travel to pickaisle.con(A_i)
% z. f4 h# q* b6 b0 N: t$ ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( O- a9 t: |; o9 T8 B
else wait for 10 sec. [, e6 [9 a$ E9 v9 F5 q+ n! {
if A_i=A_leave then send to die1 c# a. b; U! c {: V2 v
else inc A_i by 14 p5 g6 _1 L2 R6 b/ J0 ~- P# @* D& T
end
6 a9 r; u) `; X% O, zend: E3 a5 {% b: \; k+ E6 q% l. J
; ~: l9 u9 m1 M8 P$ D9 V
begin P_pick3 arriving
9 S' @ P, C) O: z set A_i to 21
! Y7 N2 `6 b8 R% U2 N/ m X move into Q_induct3
. P; _; V. o9 ]- X; `4 y) A move into pickaisle.induct3
3 R+ s" X( ~" p+ Q while A_i<=30 do begin2 f; ~! U: h: Q/ x) [7 c
travel to pickaisle.con(A_i)* n! A) A+ ~% O0 [, E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 o* V a- y. `1 L' A. ]( L7 ]% L* j
else wait for 10 sec
% U2 U3 b- x3 d; A" \+ X7 \2 h if A_i=A_leave then send to die, }0 _+ [5 I+ L/ J8 C
else inc A_i by 1, D/ p M/ p: {
end1 d# j0 E9 T# n. G! d3 _7 V* B; b6 s
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,其它按你的 ...
|