|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' K) U# `1 S `8 ~' k5 _) r. K5 t
5 c1 w) n% P. g2 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中的数值,不知道会不会有什么不妥。
( ~- [$ U. H Z1 c; D0 W: f% c q: Q7 C& O
begin P_read arriving6 ^2 ?' ~8 ?- @# o
while 1=1 do begin
' J/ b! m9 X( A, Z0 [1 @; X5 Q, I read A_tote from "data.txt" with delimiter "\n"
, U, W' \1 R* r9 N. Q/ R read A_time from "data.txt" with delimiter "\n"* O) s. [9 Q+ ?9 v
read A_leave from "data.txt" with delimiter "\n"% @1 S- V% Q# ~7 M
read A_picks from "data.txt" with delimiter "\n"
# E3 N1 ?! c3 K7 x1 H set load type to A_tote& o9 v7 T c6 X' y$ {# Q; e
if A_tote="tote 1" then set A_induct to 1
: {1 _ ~ C! v C5 V4 i$ o, a4 C else if A_tote="tote 2" then set A_induct to 2& k. N$ c) Z) K
else set A_induct to 3 4 @/ F( a% H7 F0 W6 w/ ]" b
set A_i to 00 ^( A0 {5 ~5 ?. }% h3 @
clone 1 load to P_induction
: ~- \" e- v. Q) Q7 H wait for A_time sec
$ }6 w6 Q5 p9 X2 [8 f end: z' |* L9 r* e; ^
end
5 n2 z5 E) W; H0 n- |
! @2 e' g: P2 w- u+ ?% Bbegin P_induction arriving
# Q) z9 Q% S8 E% x if A_induct=1 then clone 1 load to P_pick19 W. ?2 A* }1 P
else if A_induct=2 then clone 1 load to P_pick2/ n! s6 L) S/ H5 ^
else clone 1 load to P_pick3
4 z3 J; [; z1 |8 r1 u. Xend
. N1 ^% s4 n# Z, N. H% b3 ~0 L+ B- f
begin P_pick1 arriving7 T. o# G% D* M1 L7 o! Q
set A_i to 1
# c- L' F [. ^1 ]+ s! ]2 L- o move into Q_induct1! f9 F: s, _0 O: O. f3 [
move into pickaisle.induct1/ c* K0 P7 m( ] A) @
while A_i<=30 do begin
! C5 j: W3 m' o6 | travel to pickaisle.con(A_i)2 G/ {" e9 ?8 V4 n5 i, D8 H% l8 [8 B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Q1 H/ m/ r* Z8 ~8 @" ?* @4 @' R
else wait for 10 sec
1 q9 ]% d* K5 s u4 o+ V if A_i=A_leave then send to die
" F) V) j) o7 a; D1 m else inc A_i by 1
1 y, D P; O7 c end
6 S$ ^, D/ ]) h& V6 E oend2 P1 K' W# }( N+ v
! Y6 x8 Y5 k2 \3 U( C' H- ~8 qbegin P_pick2 arriving8 m% l% x; q( G. F" }% U3 O4 h
set A_i to 11
p7 q, z& y! ^7 i7 p move into Q_induct2! H. h+ ?# j1 l. k @5 \! _* Y8 N
move into pickaisle.induct2
7 N' }. Z3 E* F! V# Q while A_i<=30 do begin
9 ~- ? F9 P0 b) y5 a2 k6 J: b travel to pickaisle.con(A_i)
& d+ z& h. A. U( | w. d/ A; M7 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! o+ H: |1 m9 P" {. s( a. f
else wait for 10 sec
2 S2 f) V0 f' N [ \ if A_i=A_leave then send to die+ p+ s, J! l/ Y2 k, v
else inc A_i by 19 K& c" J* o$ u+ Q4 u
end+ ^) y I0 P% j: |9 ]7 y8 U& F& Q5 m
end: f. U4 `! H! z& |! ~
3 u. q+ Y. R6 f. ^9 v* S
begin P_pick3 arriving) r: U7 ?0 B: [ @2 ]
set A_i to 21
! N. p: |. S# W# P% @ move into Q_induct3& g2 J5 R# j4 V- N8 k
move into pickaisle.induct3* F+ q; B% _, T6 }2 u7 G4 |
while A_i<=30 do begin
- _- A9 ?( ]( M/ m2 [' t travel to pickaisle.con(A_i)9 {) `, F$ F: [/ X- V& u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' O6 L% U9 @$ E" s
else wait for 10 sec
; y) R% |: q' |7 h4 \ if A_i=A_leave then send to die
1 |* w3 A y6 L else inc A_i by 1
, F W l3 _$ w( R( M' O end
2 w, u& B; s* yend |
最佳答案
查看完整内容
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,其它按你的 ...
|