|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 d* a# a% T$ ?3 j+ D! O+ n4 J: L$ }9 w6 w4 ?2 N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( |+ C3 q1 Q! q1 m7 J( u
$ [- [ Z8 [7 a. z$ H; r
begin P_read arriving! K; n. y- |( N2 l f# T v0 C$ f
while 1=1 do begin* I9 ]# U$ P& i/ f- r, J, T: p; K
read A_tote from "data.txt" with delimiter "\n"! H: f. N/ N: y* |) S
read A_time from "data.txt" with delimiter "\n"5 H7 q- b E+ l. e% D/ u) Z3 d
read A_leave from "data.txt" with delimiter "\n"
: a6 [& p2 U' A; z) D: c" v read A_picks from "data.txt" with delimiter "\n"- f$ m& f$ w7 \' ^+ z, p) N
set load type to A_tote
) I! c& [" J! u if A_tote="tote 1" then set A_induct to 1
# J# O4 K, s( e% _) i/ _ else if A_tote="tote 2" then set A_induct to 2
s. _+ }. F9 e9 f* f2 I# y else set A_induct to 3
; S: ]2 j7 B! | set A_i to 0
& X; o' H" A, H8 N9 T clone 1 load to P_induction4 l, w+ }8 P. W4 ^2 U0 V9 Y
wait for A_time sec& R9 Q$ @! G9 [' a% }
end
$ m1 C) h3 d7 b/ P5 {7 rend
3 H1 t' Z- d# ^4 {- \. [+ Z5 Q6 U
. c# F* M7 ~4 X9 F5 r3 X; t$ Tbegin P_induction arriving- t8 a. x3 ^$ s4 U& r& a
if A_induct=1 then clone 1 load to P_pick17 o& r! j0 i6 ~$ ^
else if A_induct=2 then clone 1 load to P_pick25 ~. l. n+ V- \, u( ?! z
else clone 1 load to P_pick36 ]0 C' q9 F- A
end5 P$ R' Y2 X' h M, D
3 D9 A K' d! C6 Z' E- wbegin P_pick1 arriving7 V8 i7 x! j. |7 \7 c
set A_i to 1: s; R2 z- p* l4 E9 t! M
move into Q_induct1- D3 {$ S2 H* H5 b
move into pickaisle.induct1) P1 T$ h* k4 z5 [* P# F+ [6 j) x
while A_i<=30 do begin
7 Y+ L v& ~$ F% A& r/ @# y travel to pickaisle.con(A_i), T- }. t$ Y9 J- |& U! {! N$ |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 l2 ?6 {+ j9 j! @" z" x. P
else wait for 10 sec% O; x5 c6 F( _# v/ y$ h3 @
if A_i=A_leave then send to die5 d" g# l# j2 |( h
else inc A_i by 1
- h9 t* Z* h( C end
% m- T* C6 K6 H8 u7 w6 rend/ c5 E e. x" X/ p3 ]3 P8 \. Z+ K. h, X
* U J$ T; W5 s6 T
begin P_pick2 arriving
3 E1 P" M" S1 U' G set A_i to 118 I6 _1 |. I" V/ y
move into Q_induct2. ]! q( S3 l6 `& c1 M
move into pickaisle.induct2
. v4 m- G9 h2 Q1 d b! s& ` while A_i<=30 do begin# F, F- C c' l* P$ ^
travel to pickaisle.con(A_i)! Q" X. x# [8 C# i2 P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" }( U) g6 M0 E0 K: v$ U6 ^ else wait for 10 sec
% w* V ?' }, ^; T7 R8 U# Q if A_i=A_leave then send to die" }6 h: ~! w' l$ M7 L! X
else inc A_i by 1% H6 C8 C/ U+ ^0 M9 \. ?+ R
end
8 P. i1 Z$ M5 D; @, x* J* \7 ^end- J! T: b8 j# ^( i( t) v
. q* m2 `: X g2 Q% q$ W
begin P_pick3 arriving
1 V' y$ @! {6 C9 L* C4 c5 V7 p6 M set A_i to 214 p2 t: n/ }+ Y, w: r: W" J/ s* `
move into Q_induct3
1 c# Y) ~; ?8 R1 [ move into pickaisle.induct3
# J+ ?7 }* m6 R" D6 U while A_i<=30 do begin6 Z) z3 X- p. x0 t8 f) d9 B
travel to pickaisle.con(A_i)& `# ^* H7 g- p& S+ ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 X/ }. V0 _6 O4 \ else wait for 10 sec
1 b, ~: _# O0 W! V5 ?; P7 E if A_i=A_leave then send to die
/ t9 Q* t( u6 A else inc A_i by 1
! M2 W: ?& d) I- \$ u3 V end% j0 Z' b& N1 h+ l: V6 x4 ?( i
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,其它按你的 ...
|