|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 ^# t4 B* [) A2 z
: _ n' B$ H/ l; c, {5 }, x9 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 J3 o" X- M8 C0 v' s, Y
: Q) k9 v+ ?% P& kbegin P_read arriving
* G; m: t. b4 H% @" S) h ] while 1=1 do begin
6 K6 |5 s; [ i read A_tote from "data.txt" with delimiter "\n"
5 [8 I* {# d# Q1 }* U) [7 U) A read A_time from "data.txt" with delimiter "\n"9 H2 v" ?% F% Y& P' |' o* M
read A_leave from "data.txt" with delimiter "\n"
% y& w7 q, F- q- m, A# B V read A_picks from "data.txt" with delimiter "\n"4 u, L' l( U" P$ y( ?& Y1 y- I3 q
set load type to A_tote
6 T7 U8 D- R+ \0 M. G/ C# g if A_tote="tote 1" then set A_induct to 1
% v5 T' p4 [0 v T" o else if A_tote="tote 2" then set A_induct to 2
], l% v# w& B& w3 d; _ else set A_induct to 3 # v+ q: A5 u; u5 m, _8 |2 y! D
set A_i to 0
* V0 W1 V5 J, H8 \7 K' f clone 1 load to P_induction. K- G6 k M" ?9 S9 I+ N
wait for A_time sec
4 V$ q- T) x) s$ H end, l7 R, E9 @" n" J
end
# @6 x+ |; |- G7 Q9 ]: `
6 t. c! a' `$ s Gbegin P_induction arriving
# {- P( E7 ] b2 C6 B if A_induct=1 then clone 1 load to P_pick1
# o4 }/ O' A1 Y$ G else if A_induct=2 then clone 1 load to P_pick2
3 z% X0 l f' n: t, ^0 Q8 ? else clone 1 load to P_pick3; s7 R! n, H) `* v8 P: | j
end
6 W0 n2 {+ l+ Q1 W$ Q: b" p" k0 ]
4 e* Y, H0 G/ | cbegin P_pick1 arriving
. n$ b2 k6 I& {2 ^1 I" g set A_i to 1- T, |3 w8 H$ C! G4 Q
move into Q_induct1! t( l/ {! h% |: f6 P. [! c; n' f
move into pickaisle.induct1
6 K% }6 s2 S5 S% ^7 @5 K while A_i<=30 do begin& k8 L% N- ?5 a* p
travel to pickaisle.con(A_i) e' Y* @) { ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec E/ T1 [4 s4 K( E
else wait for 10 sec* G: @0 |% v4 x% E9 g) h- J2 p& ]
if A_i=A_leave then send to die
. [( O+ O( W. \; N0 ~: S1 C% D6 _3 k: [ else inc A_i by 15 e7 f# `6 d- _# g: Y
end3 q* r* E6 _) C( t/ a$ B
end
1 T4 W/ ]2 y; B2 w1 N1 U* G$ c1 B) e; `' x/ l! p6 o- G8 l7 S
begin P_pick2 arriving& f* Q: x1 _5 u) {6 O
set A_i to 11( [( W2 {* K: m7 t% S7 N6 w
move into Q_induct2
0 W- ?0 Q/ x( Y l' W, C1 l move into pickaisle.induct2
* Y) p$ l* s$ e/ O: u3 X; T9 s while A_i<=30 do begin# {1 X6 s9 n! u x V+ o
travel to pickaisle.con(A_i)+ o# h# l6 y0 Z7 M- V7 K& ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! e+ g3 s3 N* |3 q
else wait for 10 sec
, o8 p' G+ p/ C- A+ p if A_i=A_leave then send to die
3 k* ?. _+ a. }# r6 h0 _: A: C) b: m: Q else inc A_i by 1
' F( ^ F) b# L9 C4 H+ m1 H end
: ^0 h5 \" J9 r, r0 Qend! k, } m/ ], Z0 |8 W0 C
" Z. i a# q7 z: g0 B9 I) F0 o
begin P_pick3 arriving$ ~' k, z! e# E( B7 D7 ?* Y0 {; Y. u" G
set A_i to 21; q9 ?6 K. {+ F% p* e9 `% i! T3 O
move into Q_induct3
# v. k; j: q, B9 l0 `2 P: B1 p. A move into pickaisle.induct3
4 g; [# r' K; T1 A/ Q! J while A_i<=30 do begin p& s! |6 P4 W8 c z0 D& l4 Y
travel to pickaisle.con(A_i)
" y0 Q$ A& D: Z4 C3 L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 j1 f6 }8 x) z9 z else wait for 10 sec
% f" T8 _4 B$ a$ v if A_i=A_leave then send to die( D+ n" G3 R) J* _
else inc A_i by 14 n; y: W ~5 R! N
end( k$ T# N; Z8 `$ q
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,其它按你的 ...
|