|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' E% V' h6 ^' D: v/ d, b& B
5 c; q0 S0 E$ O0 `0 f5 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中的数值,不知道会不会有什么不妥。" q8 }0 _$ E, H D- S5 ]$ S$ d
4 u( D* [: {7 ]! l) b+ E1 [
begin P_read arriving0 L% s( ]/ K/ D& e; K2 x
while 1=1 do begin
* l& Y7 ^6 r/ H l( T read A_tote from "data.txt" with delimiter "\n"3 Z6 E3 b- I7 i: b# [
read A_time from "data.txt" with delimiter "\n"
: b, f+ r. m1 ]' p9 P4 p read A_leave from "data.txt" with delimiter "\n"
. F" l* [9 {: F/ [* r5 ^ read A_picks from "data.txt" with delimiter "\n"
" U/ @/ I8 [5 ~9 u& a: b set load type to A_tote. D, G1 P% l& K( m& j, s
if A_tote="tote 1" then set A_induct to 16 n$ `) A9 y. q" V: S3 X9 \
else if A_tote="tote 2" then set A_induct to 2
P8 H5 o" [3 T+ z* J9 ~ else set A_induct to 3
, w- \: ?3 {& K set A_i to 0" ?% J6 Z/ I; ?6 A/ H
clone 1 load to P_induction" I. _$ |2 {# E/ _( }
wait for A_time sec
9 y: i" k& k$ Z end
9 o: k' J" _9 F3 a" N1 T" cend
- k6 X. {' s1 U# i, E- l q& x- Z3 g% R% C
begin P_induction arriving
8 x7 t2 s: w" v. k- j9 j3 Q2 d- V if A_induct=1 then clone 1 load to P_pick1: S1 T! u1 r, I& S: [
else if A_induct=2 then clone 1 load to P_pick23 r/ Z0 z) s. k$ U8 A8 X: d' C3 o
else clone 1 load to P_pick31 b" I+ _- R$ f7 h' Y- f: k% ^
end
# x: P) o8 v6 Z; f0 ^$ r' F# t* d2 ?
% g8 D: `0 \! C% U. h8 K+ l$ U# S' Ebegin P_pick1 arriving
1 U2 B4 V8 ?9 _ set A_i to 1
: s d4 P( L- ?7 f' x move into Q_induct1, g* O9 d6 E. F% d- v
move into pickaisle.induct1
* @# x1 p9 n" C while A_i<=30 do begin
2 Y7 P: s+ \. ]9 I* z travel to pickaisle.con(A_i)/ m5 a% i I/ a4 T4 X L8 A: U4 ]# K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 P. V8 h" Y$ Y+ Y0 y4 T; J
else wait for 10 sec+ A4 x# `* Q6 C, T- |1 y: `, p; n
if A_i=A_leave then send to die
3 X& n, D6 \$ c0 g; U4 Y0 z else inc A_i by 13 Z( K7 k) R/ c# b' U" p! [
end
- y/ P1 R, Q3 k4 aend2 P$ ]4 H! v1 H3 I( m: _! p% U5 ?
& b! f D7 V; l: ?- B7 {: c% abegin P_pick2 arriving, w( F* E6 L. t9 `% H
set A_i to 11
- I# |: S$ `5 x& L& n: V d" w: o; E; c move into Q_induct29 U6 y% o' m" ?% {
move into pickaisle.induct2( Q4 _) u+ l) \; s9 i7 U
while A_i<=30 do begin
* C, n" \% n* M2 b W travel to pickaisle.con(A_i)
' |1 F$ ?, x7 K, k6 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 [- h% c0 N5 {" I
else wait for 10 sec
/ \7 R+ N' u" J/ s if A_i=A_leave then send to die) H8 T( h: G. z5 ^
else inc A_i by 1+ [: a3 ^- ]6 @: V- {8 P) W5 O
end
* i" d0 y* a! nend
6 Y3 j! Z- @1 o5 S* u. i: G7 A; t# T2 ~
begin P_pick3 arriving
j" \6 b5 ?/ [. p- R% I9 | set A_i to 210 D8 X4 E% b8 w) N. J/ t) C4 L) m
move into Q_induct3) @# p1 t4 i: n. O+ c
move into pickaisle.induct3
( D. t% a; R' o5 {& m: K while A_i<=30 do begin2 L0 d, e4 k/ b
travel to pickaisle.con(A_i)* ~' {) k" u8 s* L4 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& g# J+ e. E# Y' n2 ~$ I! v
else wait for 10 sec) [- t2 ?5 j5 r( _
if A_i=A_leave then send to die1 H+ n# X. k$ p
else inc A_i by 1
5 p/ x$ ^. j6 D) C% {1 ], u! M end
. E$ ~: _: N" I! a9 ~# ` s/ i* Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|