|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 O8 Y2 b; a, D1 m [* k" z( e- m& u% f( W# N- k: O" Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ K& P- E9 u5 m
; S7 C2 z" V4 x% Dbegin P_read arriving
5 a0 s* M5 i& o- ^ while 1=1 do begin* E, A+ V! z! a" q$ o1 b) y. \) U% x
read A_tote from "data.txt" with delimiter "\n"1 ^+ j7 p6 H$ l: a
read A_time from "data.txt" with delimiter "\n"6 e8 u( X8 b) b% k$ }
read A_leave from "data.txt" with delimiter "\n"
: b5 ]# m& p, P1 f read A_picks from "data.txt" with delimiter "\n"% u3 |* k* Y7 n M. x
set load type to A_tote
' {$ H2 R+ h' T- i! N% ^ if A_tote="tote 1" then set A_induct to 15 f; _/ A1 j* j- T [
else if A_tote="tote 2" then set A_induct to 2- w1 R% P8 {0 c, U: F4 T- ~, p, h( l
else set A_induct to 3 ! F" r' f) v7 O9 I- b9 {
set A_i to 00 z* `' J' l/ Z& M$ D
clone 1 load to P_induction
- b, m4 _( [6 \& @% Z! `; R m* q wait for A_time sec
) \1 w7 V! A: j end2 Q% G2 O0 q0 O/ C w
end
) P- E# ^0 G7 `% X% \- Z q' w: h6 `5 U8 N
begin P_induction arriving, `& n# w8 a* n1 Q W( C: [( \
if A_induct=1 then clone 1 load to P_pick1
' d8 i9 v0 b. f( D2 c& t# p' | else if A_induct=2 then clone 1 load to P_pick2
7 v8 L2 j+ \! O* A( y else clone 1 load to P_pick36 `, K0 `" c3 P6 N
end
7 h7 k; P6 R' W
8 E* a1 T4 s- ?1 A5 ?8 M7 y0 n5 Vbegin P_pick1 arriving
: ~6 _. d' g' x1 y: N" t6 _ set A_i to 1) r" J' f& W9 {& D% O& z' ]. z
move into Q_induct1* M9 I+ ~8 V; o* |9 ^ H4 l
move into pickaisle.induct1
7 t+ n/ x: H; R) P/ e/ [ while A_i<=30 do begin9 ]0 N$ g- e5 y( f; {
travel to pickaisle.con(A_i) Q% V, {$ q- _* u! }7 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X8 O8 p* u$ n( l. K! c3 j+ k
else wait for 10 sec$ w; o/ q2 D6 P9 ~2 l
if A_i=A_leave then send to die
" E( c' D$ ~' z, q+ o. Q else inc A_i by 1
0 n1 H+ q# M9 Y end
0 D2 J; n! O* r/ u+ u. D: Aend w- y" s- g- O! Y0 Y7 |
6 Q6 v, T$ w; `0 C0 U, i
begin P_pick2 arriving
: C4 X2 B% _& c* C' z) t! e set A_i to 11- o1 v9 K0 Z6 h% |' f$ o
move into Q_induct2
- s4 c* z/ n/ H7 r E4 ?2 y& K move into pickaisle.induct2" J, T2 B t$ O: {* y; m
while A_i<=30 do begin
% Y; ?8 c1 _) M travel to pickaisle.con(A_i)0 a; z" K9 g% c$ O# `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec w' d) S3 b4 I
else wait for 10 sec! o: e3 x, H. H+ s0 ^$ u
if A_i=A_leave then send to die
2 ~. @! q" b1 o: |0 O+ H" }3 o else inc A_i by 1
1 b. W0 p& l4 `$ B end/ Y5 b' e) F* ]% u+ T; ~. [4 Y4 w
end! Y* `7 v8 U: I$ Y o% w
+ p. X; G* N" C* T9 J& @
begin P_pick3 arriving
2 M5 y, B) U5 s1 p( q2 A set A_i to 21
( V$ }# [* u6 t6 B move into Q_induct3
) C/ [8 ?+ O( T2 U# K' |! B move into pickaisle.induct3
& }1 G: P, Q/ c; b$ ^% w9 m while A_i<=30 do begin
) [* B0 m$ k5 ?% n4 J. _ travel to pickaisle.con(A_i)
9 u3 n+ O7 x2 D# n4 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Y! d, ]! D7 e, o
else wait for 10 sec. n: q( S7 x& Z2 ]
if A_i=A_leave then send to die
, ?% G/ D( i* n! O4 a4 ? else inc A_i by 1
/ F9 h, X; O: F: |: _ end
% w$ s) n; }2 ~; I& i5 y+ [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,其它按你的 ...
|