|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! \$ l+ R6 v5 H) N! {) [
9 b% r1 w6 [& f1 V2 F2 l我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 Y) P% Z' g5 W [
$ r! e* d( |/ bbegin P_read arriving9 c- n! _4 ~9 ~
while 1=1 do begin
; O7 U# I5 I4 W& k& ] read A_tote from "data.txt" with delimiter "\n"8 i) t. k: P% H% x# X4 t; x
read A_time from "data.txt" with delimiter "\n"
- I( C. v5 w3 f4 |, }) ] read A_leave from "data.txt" with delimiter "\n"4 z5 F9 o. k; R# ]3 g& p4 R; z, @
read A_picks from "data.txt" with delimiter "\n"
* |2 O! ]% K3 p3 \ set load type to A_tote
, }$ s/ \+ ~) O \! I! O, } if A_tote="tote 1" then set A_induct to 1
7 r' V( w5 P& L3 o0 h8 \* W else if A_tote="tote 2" then set A_induct to 28 I- {) b! v, b$ B
else set A_induct to 3 8 [9 f5 y1 [& i* S3 ]
set A_i to 01 g5 B: R7 B& S9 g
clone 1 load to P_induction
) k4 L8 j+ r+ y# w4 ^( @5 U) h wait for A_time sec5 ^4 E r# F1 r5 z
end
3 H) z+ Q- e { C! w9 A. B% ?; [end& ]- [# w1 Z$ s& y& x6 c
1 _. ?0 n6 A3 H& Y0 U9 m7 i
begin P_induction arriving
% G- e4 |2 S: _2 p) O if A_induct=1 then clone 1 load to P_pick1+ Z$ K. f( n, _- g) v* U& }9 M
else if A_induct=2 then clone 1 load to P_pick2
% } T) ~) D8 k, f! \- q else clone 1 load to P_pick37 H l! p8 p+ E. S# ^5 w/ J
end
/ E# r9 w' A. l& A
& p# ?, V$ D s4 _2 j; Rbegin P_pick1 arriving
- F6 A- U0 z, ~ set A_i to 1
. G( m0 }. W, g9 E move into Q_induct1
4 Y# d! G: u# c! t! P/ y' x" Q move into pickaisle.induct19 `4 P; X# p+ K8 E3 a, W& \/ O* y
while A_i<=30 do begin- w- m9 k" ]6 c! \2 H
travel to pickaisle.con(A_i)
3 C6 K; V, c. E, X! | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! m+ V8 g; K. u0 u/ J( U, r2 `
else wait for 10 sec
8 k1 S0 D+ ?& V if A_i=A_leave then send to die
3 a |6 `% m0 Z6 M9 x8 [ else inc A_i by 1" T0 Z) ]2 D. i( `4 d
end
0 P8 \/ s: T2 nend/ W9 a3 ?" ^# |$ E9 y
% K- k; A/ l1 b3 v% cbegin P_pick2 arriving
+ s: W# c8 t! Z& d" Q$ X set A_i to 11
) Z0 ]. l7 W4 e8 Y7 [ move into Q_induct2" w$ M" N$ A/ h. }, m
move into pickaisle.induct2
0 i9 j( S* y$ C" b1 { while A_i<=30 do begin
2 i3 @( [" m) }$ _) ~ travel to pickaisle.con(A_i): @7 q4 f7 W! G7 c2 O+ s( d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; w; A& v, |3 h else wait for 10 sec
1 K& D* `. ^, Z C1 g4 F4 ` if A_i=A_leave then send to die' V$ Q$ J" [% R y" U, H5 q
else inc A_i by 1
/ d$ v3 S$ H l end2 Q6 L8 U* k& R& O' |0 I/ }/ h
end
. ]" H- e4 _. M! y: a9 a2 {4 {2 j( P- S$ x8 ?2 i5 n$ G# u0 G" f/ y; B) X
begin P_pick3 arriving4 A7 _( V" P; t5 i4 }+ K7 d6 P
set A_i to 21! N" H0 @) H' p4 Y: g" d2 g: U. U2 U6 r
move into Q_induct3
: B- ]# G! Y6 \9 O" Z move into pickaisle.induct33 S+ B9 c0 Q! u2 y. M% k: R. l
while A_i<=30 do begin$ b4 \/ Y( I) z: m( u9 d; `
travel to pickaisle.con(A_i)
# B" X1 z9 e% p9 n; v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 W3 J% M* A& n5 v* g else wait for 10 sec
# ~. M# p' s8 B if A_i=A_leave then send to die
$ l n( P" [& g1 y1 b else inc A_i by 1
6 p+ ~! U, C! m6 q$ } end
5 G( @+ \' v, X6 Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|