|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# O+ _8 t% f: X1 T& J. t. @5 B+ ^# V# M# o, _" i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ m; \7 r9 |8 ~* a2 M
" K4 b+ t7 r% K$ zbegin P_read arriving
' [ D: n& H# J1 c. t while 1=1 do begin
& K9 y4 b9 ~+ k* i. v read A_tote from "data.txt" with delimiter "\n"
5 q; t5 }) K; @ read A_time from "data.txt" with delimiter "\n"8 R9 _* M4 g# M; J
read A_leave from "data.txt" with delimiter "\n"& {. `2 V+ a! T0 v! @1 S2 I7 ]
read A_picks from "data.txt" with delimiter "\n"
- z$ [: [' Z7 r; W set load type to A_tote: J# C2 R/ a+ N7 C9 E# @7 h
if A_tote="tote 1" then set A_induct to 11 k( {) \/ H+ ^
else if A_tote="tote 2" then set A_induct to 2" P8 \& M3 j/ L5 d4 f- B+ p
else set A_induct to 3
$ P* A5 p# |6 Z8 f1 b set A_i to 0
0 W+ p/ P1 T% y7 ~$ M' r7 r# u clone 1 load to P_induction3 G9 K c9 D; `1 p
wait for A_time sec
7 ~4 P' k c) G) n z) y- I end
$ o3 N& N) ~( U# g& m. rend
7 B/ t% S; Z3 i" e+ o6 q; s6 G7 r* c# _1 U
begin P_induction arriving
. I- D1 g f: L2 b ?6 v8 y if A_induct=1 then clone 1 load to P_pick1) U6 [0 p* e- ^ w
else if A_induct=2 then clone 1 load to P_pick2
$ g' ]8 P1 t8 w- u' p' w2 j2 D else clone 1 load to P_pick3% T; O5 T2 J5 V+ H
end
0 s" {# O7 e. n/ w# s; X7 R6 N& g9 K1 r* M! b
begin P_pick1 arriving& X' E2 m1 |1 d& J4 D3 A
set A_i to 18 ? r0 t. c: V' L' ?. B
move into Q_induct1
& g e5 {" H% q1 {* K0 l move into pickaisle.induct1
4 w2 j Z) `! D# a2 Z |$ I! c while A_i<=30 do begin
; r; V* c, ^, Q travel to pickaisle.con(A_i)
+ w Y7 P8 L$ x& V+ \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 O: b# u; ]) a& E. ]# M else wait for 10 sec
- ^- u) t# G$ C n( w, r if A_i=A_leave then send to die
+ P( u/ q0 R# j6 l) M else inc A_i by 1
2 c/ o8 {: @( B: r8 N C end
5 p0 |' h$ Z, V2 Send& d, E' h0 [. p
. I2 H& ?0 J, x0 B( \begin P_pick2 arriving
9 w) O7 z# Q6 H set A_i to 11" B& v1 W) [6 [* k9 Q
move into Q_induct27 {- X6 K4 \4 P5 g- T/ w$ C9 J# Z
move into pickaisle.induct2
# w) H9 \' z1 b, z; x# _ while A_i<=30 do begin9 }6 ~1 i2 ?8 N5 e) n+ A
travel to pickaisle.con(A_i)! h, C2 C- r" a! K) b7 _" l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: _, S% `6 e! n! q- @ else wait for 10 sec
: g3 |+ b7 K+ B) n if A_i=A_leave then send to die
0 c8 }4 j+ q. X4 p# O else inc A_i by 1- X: x# K2 E7 C5 _2 ~
end
8 O" J8 S5 p4 `2 M+ i! ?" Uend# F* D" N) G4 L* Y/ w! i$ T
, y6 e' V( N8 F1 V) K M
begin P_pick3 arriving
7 O: l! r) b$ {' H0 j set A_i to 21
1 P3 |2 Z8 J% F, b# k+ p7 n+ X move into Q_induct3
4 ?7 S1 V+ h9 C5 x move into pickaisle.induct3
; r! Y* }: x: R4 a6 Z while A_i<=30 do begin. x G- w. W2 J7 n7 w$ N# D
travel to pickaisle.con(A_i)3 Q, o: f, V* z, g0 C8 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 L- d% L" |" o' b else wait for 10 sec; ^0 O5 K6 b5 j9 F' G; D
if A_i=A_leave then send to die
5 s2 o3 L4 Z% L! }6 A. R( O( _ else inc A_i by 1
, M" r/ W4 ^: e8 D! x, G4 u, T end" n& g O: F6 d4 R/ z9 g+ E6 b
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,其它按你的 ...
|