|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- A( j" [' U. Y: k+ P3 G6 t5 i! T, V+ k1 ] 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中的数值,不知道会不会有什么不妥。$ T6 H+ r" P9 y( v7 |! m
( \! Q3 ~' i% Y7 W
begin P_read arriving
* j3 e7 |7 \! b/ J/ w8 p while 1=1 do begin
# r" P7 B3 X) u/ x+ A4 ~) C- C. q" A read A_tote from "data.txt" with delimiter "\n"
) r' y) H: j6 w read A_time from "data.txt" with delimiter "\n"+ q7 a4 e9 F$ U2 m
read A_leave from "data.txt" with delimiter "\n"
( D9 c* a* B% D9 \0 b. C read A_picks from "data.txt" with delimiter "\n"
/ {3 I2 F% w& g- V' k' U( N3 [! M8 t set load type to A_tote& A- Z- V ]' u6 C/ ]1 x
if A_tote="tote 1" then set A_induct to 1+ \3 ^4 E/ U: q+ J. k
else if A_tote="tote 2" then set A_induct to 2/ k# |% K, x" _' Q
else set A_induct to 3 % G$ b/ d# c' j$ ^. Q3 n* W9 f
set A_i to 00 G% \4 R W1 w# x1 b' h. U
clone 1 load to P_induction
: q* i! c' W2 R/ N1 Q wait for A_time sec, g- [4 l8 l6 Z3 a6 O C" P+ q
end% z0 k4 y0 D6 O' X% @
end" S# O/ {! y6 R1 K- k* T1 [
% a, n& m `* {4 vbegin P_induction arriving
: C$ J% ]- A5 A* r! b6 X" P+ r if A_induct=1 then clone 1 load to P_pick1
# S H, a* D2 v0 A4 ]' U3 C else if A_induct=2 then clone 1 load to P_pick29 y$ t/ X0 W1 u9 P; @4 u, ]
else clone 1 load to P_pick34 L2 U/ E+ _& h, U5 D
end8 y4 W% U9 M: `4 K
( S1 S$ o2 N0 { n
begin P_pick1 arriving$ t( @, i. \" m
set A_i to 1
7 \# d! o+ l$ o: ]% b# L move into Q_induct1% c- L; u* m# B0 X( u# u9 p; _ V
move into pickaisle.induct1
# \7 h$ m4 P/ z3 Z while A_i<=30 do begin' `, s `5 U& }1 x
travel to pickaisle.con(A_i)! r6 I0 N( g. Y5 |, ?1 N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 j9 q. A3 H" J: ~
else wait for 10 sec) o! e$ {# O' [% Q* F J8 _1 y! \% E
if A_i=A_leave then send to die
9 x) I9 ]# b7 ~8 G$ [. } else inc A_i by 1* a Q3 l/ _: ~. `7 j
end& K* ^/ v9 m1 q6 L. n
end0 ^4 M/ `" q8 y5 t% d
5 m/ I t7 I' d9 E
begin P_pick2 arriving- |3 P+ p+ f( |( R( Z
set A_i to 116 h" \$ D/ E9 T
move into Q_induct2, G2 U/ |& A/ C u: b& `" Q
move into pickaisle.induct2
$ I% o! B2 J2 R5 N; I while A_i<=30 do begin
p* g) Y4 I1 h4 T5 u travel to pickaisle.con(A_i)
2 e( Q$ R8 o" t4 T! G3 U+ X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) Y( i( ?! @% K else wait for 10 sec* }6 W# h9 H; Q) q( w
if A_i=A_leave then send to die4 }! X- m+ @( q( r% E# [
else inc A_i by 13 E. Q, S# G) V+ H( b+ |! ^
end
6 J* U& w) A5 m4 y% L* Cend0 l* u2 [# m, o1 U( d
* Z% l* m7 j: B4 \# B
begin P_pick3 arriving7 C6 s8 h& H6 Z U% \
set A_i to 21! Z& W+ z6 a- U r& `( [' W
move into Q_induct3
0 }6 M4 _4 J" l2 n move into pickaisle.induct3
q0 }& e5 G) l+ D$ Z2 k& D5 m while A_i<=30 do begin- s8 W3 s- g. |8 j, n5 A
travel to pickaisle.con(A_i)
* V( Z* j* d; h7 v$ a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 W4 w! m# k- k+ X6 p) J" v! j else wait for 10 sec; n( o' x) @: o3 q2 P7 z
if A_i=A_leave then send to die
# E0 b% |0 U0 A8 s* _ else inc A_i by 1
1 r( D* k/ N% n. B& h4 Z end9 V7 U3 F$ O. z9 p
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,其它按你的 ...
|