|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
M( t9 }, R. r& _$ r/ f
' `1 @) Y2 q4 G4 t( ~2 @% V* J! }我的问题是,在每个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 w" | F# r. J, E: e4 \
' G8 b% p* s% A% e1 l: I; ^0 s( ]: x9 sbegin P_read arriving
: _6 N, {, X2 l! f' N/ W' \% D) L while 1=1 do begin
W9 |, }1 K E6 J read A_tote from "data.txt" with delimiter "\n"( d5 n, V8 }% B! f* _( _' V
read A_time from "data.txt" with delimiter "\n"
, i$ j' P7 i0 X" Q& q4 b read A_leave from "data.txt" with delimiter "\n". o8 o* T- v2 o" H; F- n
read A_picks from "data.txt" with delimiter "\n" e7 C& J9 j0 ~& \6 w+ _
set load type to A_tote, R% o* J+ O( z# R" u4 ]. n I
if A_tote="tote 1" then set A_induct to 14 E/ ^5 K1 I' s
else if A_tote="tote 2" then set A_induct to 2
/ p$ A# r! _# U) D else set A_induct to 3
% [+ D, }* w% g set A_i to 0) a. g' P; b/ z$ m' i G, m( e9 W) Q
clone 1 load to P_induction A( x1 G% v# p& j$ k( e
wait for A_time sec& J2 P2 ]6 I$ I8 v! U) n
end b. G S, t" w1 e) i- ?
end0 y* ~8 |5 M, Q* V( f" Q' I
8 j7 A# r5 a! g( x8 `2 f' ~begin P_induction arriving
0 d" e2 D1 I! h: N E" h/ E if A_induct=1 then clone 1 load to P_pick1$ o' G3 j* J4 a' h/ n! `
else if A_induct=2 then clone 1 load to P_pick26 v+ e/ ~9 ^0 s( k1 n3 |
else clone 1 load to P_pick3( B2 L8 x: c& `% I4 b. d
end
* X$ N& o( l0 x+ e2 I' y. i( I5 v' R& [* Y, H& v f
begin P_pick1 arriving
* v3 c5 D: g# a6 n set A_i to 1. |; Y. n# M( J& A7 W
move into Q_induct12 B4 o, U4 u; Z8 Z
move into pickaisle.induct1
6 H& G1 H0 _0 {' D5 L while A_i<=30 do begin- z; E4 Z- L) k, d
travel to pickaisle.con(A_i)
- Z4 \: {5 k2 {1 ?( X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" D/ { r3 H; n0 Q2 I
else wait for 10 sec2 }0 ~; f1 K' t" |
if A_i=A_leave then send to die
. n' i* f* @3 |) P8 B1 s- O else inc A_i by 1
2 B$ c1 |& l ^9 }5 S+ h6 K end
8 y; \" q _$ X' n& xend$ \( q. D% C. u* A! K$ w
6 U% [; @6 k1 f6 I
begin P_pick2 arriving% X3 h4 l8 F p" E: ~
set A_i to 11
2 c0 ^2 h7 L ?2 q5 U* a ^- f move into Q_induct2) s7 S4 t& s3 X$ `0 g
move into pickaisle.induct2. E1 [/ v. X& R' p0 f
while A_i<=30 do begin
# X$ u& h% |: R9 ^ travel to pickaisle.con(A_i)' W/ L' g2 b, P: \' n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P1 O0 r0 E: L3 f5 M& R6 R
else wait for 10 sec
8 H$ c! R& Z8 @/ O. q! a if A_i=A_leave then send to die/ G! S% v3 t+ J8 a+ Q& O
else inc A_i by 1
0 }$ z8 m+ [! E( I end
: y# A' \3 V& send. k( [, H5 E/ [$ k- |( t
# V# p9 G$ u- |' D3 u6 c
begin P_pick3 arriving
9 V# l0 I$ e0 n2 d) N set A_i to 210 A) h/ }" L+ p) j! [
move into Q_induct3
9 d; ~8 B2 n4 o1 D! L7 S move into pickaisle.induct3( x4 b, O. C" {! m
while A_i<=30 do begin
$ {( b* |9 o" M travel to pickaisle.con(A_i)
% d/ {$ k& N( V) C8 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec Y& [6 h3 ] e' l0 b
else wait for 10 sec
1 S7 l9 M: W4 D0 I if A_i=A_leave then send to die
% N/ t- h8 M$ W' n& Z, G/ n) l5 x3 ?2 u else inc A_i by 1
/ R- w0 g* q' g/ O% P3 k- b8 Y end9 I4 z! ~5 r; R$ B
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,其它按你的 ...
|