|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% m! S# T9 b; M- _
7 D8 s: C8 l' d: @, H1 e# l" [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) F X( |! U5 }
2 c! r/ n4 W3 y% R
begin P_read arriving: n! t3 e! {- D
while 1=1 do begin9 e! a& u3 E/ f1 v
read A_tote from "data.txt" with delimiter "\n"4 A7 T$ h2 ?* k7 @2 u
read A_time from "data.txt" with delimiter "\n"$ ? h7 [0 I, ]% _
read A_leave from "data.txt" with delimiter "\n"
! [1 X3 u9 m( H5 L/ X9 O read A_picks from "data.txt" with delimiter "\n") D) \8 B9 E, \% W' `1 c6 U+ i
set load type to A_tote
; ^0 e' a7 q1 [$ C- ^/ t5 L* E if A_tote="tote 1" then set A_induct to 1
! j T5 f5 G/ O2 O else if A_tote="tote 2" then set A_induct to 24 T) I2 d- n- G* L* Q- E
else set A_induct to 3
6 B+ a/ {5 d- T; f set A_i to 0
8 z0 D2 Q- ^* v' W0 w! i S# w" m clone 1 load to P_induction
7 U; Y1 F/ C5 `" ?( V: o wait for A_time sec
! P. f6 I6 K; B4 L- [/ H end2 L) d& t$ y' u$ b4 a& M; p6 g( c
end) n; L6 m" n4 b( S/ q
2 B/ {2 a( ?1 ?0 Qbegin P_induction arriving
( h6 d6 \2 [3 H7 b if A_induct=1 then clone 1 load to P_pick1* N8 Q2 J6 `+ q5 o
else if A_induct=2 then clone 1 load to P_pick2+ D/ Q0 l2 p% H, ^& _' w2 F- w
else clone 1 load to P_pick3% Q+ O' `+ M0 \0 [
end
* G& r- A, _( [, ^3 k; l W" O, m% Q9 H5 c( K. B
begin P_pick1 arriving& o+ e7 r: q. }8 t2 y
set A_i to 17 ^4 Y& ]4 x3 n" L6 B7 g
move into Q_induct1
* W; p9 Y2 J* z# [5 n move into pickaisle.induct1
$ g. q7 s5 @1 G while A_i<=30 do begin
8 A2 Y; Y* n' R1 l7 d# t travel to pickaisle.con(A_i)% i5 N& J6 a2 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 [2 i. ]' } i6 f( ?9 U
else wait for 10 sec& q) U {* N& C, H2 ` F& \
if A_i=A_leave then send to die
1 o3 z8 g$ T: P/ |7 G else inc A_i by 19 u, [6 ^" G% y: j! a* h6 j7 @
end
4 Q9 z9 M* {. g. @+ {end" h, y, x8 f- B7 J# v( e1 l7 d7 `
' T) {0 c* m2 K" n5 ^
begin P_pick2 arriving
) P A. S. F7 }' v( H set A_i to 11' M; @, v" \- C# j: s6 x( J
move into Q_induct2
8 L1 t, w6 F( ?( } Z7 D* d move into pickaisle.induct2
2 d& G0 y+ N9 }# U' x5 f4 G$ a J while A_i<=30 do begin4 ~6 a; S( a2 X3 f7 l6 D l
travel to pickaisle.con(A_i)
4 _* o! u3 H& ]$ m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* P+ Q/ }1 j) l# x) ^! d
else wait for 10 sec
4 ^! r/ Q. l% H1 P7 M! s% I if A_i=A_leave then send to die& x' v! j: X% U V% U8 ]7 H
else inc A_i by 1
+ h. Q2 l9 U# v7 I0 x- a8 Q! Y, D end
# s5 ?+ G, R; `' U) w" K7 S* d# Aend1 T# C: X* n1 {
7 ^- t( A: H$ H+ [) M; h3 u
begin P_pick3 arriving
/ t7 w" n2 H7 B+ [ set A_i to 21
# B3 {' |! D0 Z' j move into Q_induct3
% j" U0 I7 `; I, t( ^) r' D. f move into pickaisle.induct3
+ S" g, e' F0 h7 Z' X while A_i<=30 do begin
$ ~3 Q: D, V: k4 v+ D% b0 h travel to pickaisle.con(A_i)
/ ?3 g' m i" J7 N! z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ K7 u7 [3 B* c9 s2 ]8 f& F2 ^; E0 m else wait for 10 sec! w1 p- @! H; r7 V9 r8 o
if A_i=A_leave then send to die2 \& ]# t( [' \, }
else inc A_i by 1
% {# S( M$ U& L( b5 y/ I end1 p7 d5 f7 P( O2 \( b9 d' R* a
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,其它按你的 ...
|