|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ {9 F+ L8 @$ @ ~& q! b
3 ^- n0 y9 i% D: h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ H, N0 k: E% H4 V
, ]- L/ r! i- e2 Y, B% Zbegin P_read arriving
" K. Z+ H/ R# G u) R! t while 1=1 do begin
0 J, t, N3 d' }& a read A_tote from "data.txt" with delimiter "\n"8 R) @- q& Q! H% T7 ]
read A_time from "data.txt" with delimiter "\n"' F' E$ F1 f. U6 C" G
read A_leave from "data.txt" with delimiter "\n"
k h) \- F C read A_picks from "data.txt" with delimiter "\n"* X8 [5 J. D4 [0 s( u1 T* l
set load type to A_tote* |- Z4 o/ |: [1 `8 P
if A_tote="tote 1" then set A_induct to 1
7 i. L4 M; q! g- |; I/ Y else if A_tote="tote 2" then set A_induct to 2
; `) G* T9 M8 d2 s else set A_induct to 3 7 Q4 }+ @* a' }/ o7 a, c' s
set A_i to 0
1 y/ U- T6 x7 L+ m clone 1 load to P_induction
0 d. T ?+ A* V( l! E wait for A_time sec
7 k1 [+ S* G. {" d& V& C. ^; b end
2 M; L& j1 G- M8 W& `4 _: V Y \- xend
, j: n7 T' k, k& P" {
" t9 t9 u7 J m0 S- cbegin P_induction arriving$ {( U7 P u" G
if A_induct=1 then clone 1 load to P_pick14 k2 E( @" O: C* r7 D
else if A_induct=2 then clone 1 load to P_pick27 ?3 Y" E/ F: i. t
else clone 1 load to P_pick38 S# H% Q5 O+ b+ G, Q
end
& l n3 n3 R* v* f; K2 Q0 u) I, B8 F# _
begin P_pick1 arriving$ q, ]9 E, R/ _4 Z b! F0 Y$ h
set A_i to 1
3 z( z9 I- G* ~- o move into Q_induct13 C7 R* w( P" W# o4 H( E
move into pickaisle.induct15 b' n2 R6 }7 F8 |5 d) r ~
while A_i<=30 do begin6 T$ _) @) ]" X. n
travel to pickaisle.con(A_i)/ v2 x+ J; {9 ~, ^: A. [' _" B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 U& \! l9 j' Y& I/ T5 ?# L+ s else wait for 10 sec: x/ P& V; u$ c1 w' \
if A_i=A_leave then send to die; i3 I$ X, h# v
else inc A_i by 1
- k$ @1 z) `, H d; J: g8 O" M( _ end
4 w; e0 O7 c% t+ n1 T9 lend
. c5 O p ]" z0 T9 }, Q' k& e: @& y0 [/ ^; S- c; h
begin P_pick2 arriving' s; W9 e$ f; J' ?/ j
set A_i to 11' M# @4 Q; G! M9 l5 m3 Z8 u
move into Q_induct2
% { U w3 l# D( P move into pickaisle.induct2
* ?# u" O- x2 j* H2 U% j while A_i<=30 do begin# v. i: Q% ]; n7 s! y
travel to pickaisle.con(A_i)
. d4 d5 S2 J. R6 |' U' ^+ h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 v& m# m2 n- T
else wait for 10 sec
. k& k( M+ c6 I! O$ X- R if A_i=A_leave then send to die
" P) }" G2 ]& ~6 U; m4 B0 j else inc A_i by 16 Y! C- n' R# h w0 X* v
end
+ M% M& o c( r9 b* l qend/ x. e7 x0 i$ y( z8 c; c, c
4 ~% N: b3 _/ `; N% }5 j
begin P_pick3 arriving# @1 u5 N7 h a
set A_i to 21
4 b' @; a: p2 s0 \0 p4 ?. y* t# _ move into Q_induct3, K% _3 F; R) z! d' Y
move into pickaisle.induct3
. @1 ?/ e7 p0 ~ while A_i<=30 do begin( i4 u3 r5 \1 u! M( u' R
travel to pickaisle.con(A_i)
1 @0 P3 P1 a6 h1 I) ~( ?! X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ \. G1 o" z; t, l, V7 a8 C5 I else wait for 10 sec
8 i; P3 u$ _, f3 F! v' Y$ z if A_i=A_leave then send to die
# I7 i0 {6 E- C. \# K: H% H else inc A_i by 1
, G( U! V0 _4 i+ ^) a end
- l7 H1 e$ q7 Z0 k& d% m9 eend |
最佳答案
查看完整内容
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,其它按你的 ...
|