|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( t* [! ?# e6 H6 _ R7 Y$ [2 m+ X
2 X( U3 M: f% y- N; i t$ s我的问题是,在每个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中的数值,不知道会不会有什么不妥。; a# S- h* v4 M, j$ C
, A0 \4 p( z$ Gbegin P_read arriving7 Z2 c: g6 X1 p1 ?3 z4 C' s- _0 d
while 1=1 do begin
. X5 T# i" m2 i read A_tote from "data.txt" with delimiter "\n"
9 S' g& \; e3 I5 G# [ read A_time from "data.txt" with delimiter "\n"
, L% X2 r; d1 d+ t7 N read A_leave from "data.txt" with delimiter "\n"0 G4 E* `' o* ~1 W/ b; C
read A_picks from "data.txt" with delimiter "\n"
) v7 B- b/ A6 y& c set load type to A_tote6 ~9 m. B+ R; ?2 s# k+ t
if A_tote="tote 1" then set A_induct to 1
8 \ c: l7 M2 ]3 f6 ]0 a3 O else if A_tote="tote 2" then set A_induct to 2
: `7 E4 s# u) S1 N p else set A_induct to 3 & c9 d3 k/ c- x( Y# G
set A_i to 0
- e% @: \+ ]' I1 q, F clone 1 load to P_induction
l2 R7 z9 X5 w+ x. j- Y% z wait for A_time sec" l3 \% y& @5 i0 _/ }- y
end
( a) U' e0 l; U tend7 H5 o4 H! d& s" ~0 v% e. n
- I; d8 |3 \: o; M3 Q( n0 Ebegin P_induction arriving. D% ?3 r3 L+ W9 v9 j, X
if A_induct=1 then clone 1 load to P_pick1
+ _* H3 s% F% a7 j6 m- H- m" k0 U: H else if A_induct=2 then clone 1 load to P_pick2
5 ]" X+ E; r. I else clone 1 load to P_pick3/ F" K6 m7 a5 o' ^* z& N% A3 s
end8 m& e3 Q" d; ~ y: n
; N7 @' \, M- J( [3 t9 Mbegin P_pick1 arriving+ p# t& p9 t2 v- }* u
set A_i to 18 j2 x' X# g* }8 r) Z8 p' k
move into Q_induct15 ~* D! x) n* T( |5 `4 R9 U" o
move into pickaisle.induct11 q7 K0 k! G7 h/ k% W; `3 v
while A_i<=30 do begin
6 C7 d1 P( e; o: N+ I travel to pickaisle.con(A_i)
! m* j, I. o4 ^) o, k& B( }1 p& p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Z% z$ a1 W) G: N7 j# u0 }
else wait for 10 sec' m- C2 S1 z* f* w4 ?5 R
if A_i=A_leave then send to die0 M$ h9 H8 S( V+ v
else inc A_i by 1% v _- O, N/ X& ? |/ B; O
end6 K. J5 E# o: X
end
" O+ O: L6 `" G R0 j3 z& `8 y% Q7 }2 f- F
begin P_pick2 arriving4 b! P" R' B5 Q! K- b; O
set A_i to 119 @- o/ Y0 w: a& t
move into Q_induct2
s* G' p6 {. s5 _+ o move into pickaisle.induct2
; [& E& J6 S" F, `6 F" G. }5 Y, ]5 e while A_i<=30 do begin
6 q- A$ i: `+ A, s& V& a travel to pickaisle.con(A_i)* [6 ^0 J1 M9 F3 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# [! ^6 M. |/ `; A5 d4 s3 t$ I7 Y$ y else wait for 10 sec |$ R- V3 n( g' x. B2 ]: [
if A_i=A_leave then send to die7 | d" P i8 U# _$ x# y7 M- _
else inc A_i by 10 J0 _/ q; H# X
end
( u/ z! e" y6 Oend
. i7 ~8 A3 `4 d0 o2 R: c! Y5 n6 g" x" W3 o9 x, ^; V1 T _
begin P_pick3 arriving6 V. S1 @1 e0 ~+ e2 z& f
set A_i to 21
: K3 F. B& W9 C8 j- a/ Y4 \5 t move into Q_induct37 O' K s w; l' [8 M' w# b
move into pickaisle.induct3- t9 ?" a. K- X+ V% o
while A_i<=30 do begin1 y z: Y5 v: X) o& N4 e; T4 M" p3 P
travel to pickaisle.con(A_i)/ ?* r+ u" E5 ?5 s' e) [( O4 C3 o: A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 J& K- e7 S* _/ V& l
else wait for 10 sec
1 Q8 W* z5 W8 O' ~ B; B( _ if A_i=A_leave then send to die8 n: g4 A4 P- ~# i/ ], d& J
else inc A_i by 1
$ x6 l1 y" L5 e6 U* N: ?% M w" V end
8 a/ K% P2 j/ vend |
最佳答案
查看完整内容
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,其它按你的 ...
|