|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 I6 d1 J2 C3 \. j( j9 J
: Q5 f9 c( _- t我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 P4 m2 Q x% T! O1 g
: ]6 V. q" s+ q6 x0 @) I( S
begin P_read arriving
+ P5 S8 H! J4 b4 s6 k2 S0 v! l while 1=1 do begin
* H* A- k0 a. ]$ K2 ~; S6 a read A_tote from "data.txt" with delimiter "\n"* B% R, z5 Z. I d" D8 Y* u
read A_time from "data.txt" with delimiter "\n"' W [- G1 H( q( w5 P' a9 _
read A_leave from "data.txt" with delimiter "\n"
/ M* d- n9 q, [4 B, K# ~ read A_picks from "data.txt" with delimiter "\n"
( j* H w' N5 h* A. O: \ p% _ set load type to A_tote
2 n% k2 ?6 k W( I3 @5 `) g f# N, M if A_tote="tote 1" then set A_induct to 1
; C/ s4 r8 W* u else if A_tote="tote 2" then set A_induct to 2! `' o- J' k4 e. q1 B! S0 u2 k5 W4 J
else set A_induct to 3
3 J6 M! x7 x7 m/ \' r- J# L set A_i to 0
9 H2 l' J$ n) v, \( |" g- h0 q4 y clone 1 load to P_induction
0 E- f/ l6 j2 _ wait for A_time sec3 O( y* C: y( l9 T
end. M$ A; }, D1 t7 R5 [- d
end" [& N* t6 W" `' K5 e- M
. H) g" W. p0 J7 F9 \
begin P_induction arriving
$ d; c q* S2 t0 [- H if A_induct=1 then clone 1 load to P_pick1
- Y/ A1 I) `2 K; ^% f8 R! v else if A_induct=2 then clone 1 load to P_pick2
u6 P7 A+ Q& _0 o% B else clone 1 load to P_pick38 t$ ~4 I6 z8 m T, u8 @7 v# s
end
/ J3 W' y3 o0 G. I3 o1 G% r! c! B$ i; I
begin P_pick1 arriving
+ G" h8 k; g" o4 K x% R set A_i to 1: q( }0 {. a& O0 F! `1 G, g
move into Q_induct1
( w3 i0 u* B' ?4 }& S$ R) _8 Z move into pickaisle.induct1
, y3 w- J3 _- s* T" D2 E- j while A_i<=30 do begin
( o! N8 Z8 n9 l travel to pickaisle.con(A_i)! Z; x5 }1 B: v; U, h' M! Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Q0 s V9 b5 \3 Y else wait for 10 sec
' a$ |- h3 L8 `4 U- J3 e2 [6 i if A_i=A_leave then send to die
9 F2 g) T% \& P/ t; ~ else inc A_i by 1* R) W( U. y, h0 _1 }9 H
end: e# a2 h* {/ D7 D& ~; u7 p1 ~) U0 f
end
k3 w5 \" |% M5 y0 t- O9 J0 o! ^7 }( o/ @
begin P_pick2 arriving. c4 E) l2 W; B& O, L: [
set A_i to 11
6 `0 S% k, Y9 N) k# H% C move into Q_induct2
2 g- R5 O. o" z0 ~ move into pickaisle.induct2. n+ |$ O) J: j9 J. O% t+ w; i5 y) ^
while A_i<=30 do begin! b8 V1 ]+ Z# l2 f
travel to pickaisle.con(A_i)1 i" y/ G6 L* {0 N1 F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; b/ O, ?$ U; x& o
else wait for 10 sec
8 r7 L# ^/ g3 U8 C0 Y& V! t if A_i=A_leave then send to die0 _8 [7 b) M) O2 i+ H5 c$ E
else inc A_i by 1
, f( Y: ~8 f7 f4 ^" ^# O end- K" j! Z" m; q
end5 S7 J! d5 Y5 s) t3 |0 C, G
) a5 }5 Z3 I [3 s9 Cbegin P_pick3 arriving
- ~: C, [7 d* }- W) B set A_i to 21
4 S, s# l0 P9 S1 \+ i/ }, {; Y& v move into Q_induct35 j2 [; ?2 A. M' `* j
move into pickaisle.induct3/ }: [9 u. @- g3 l4 i9 t, ~ c
while A_i<=30 do begin
; |/ n3 }# n$ ]" ^2 P. h- C travel to pickaisle.con(A_i)
+ l; o* h2 g# ^- T( ?3 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' s: y0 c* k5 C0 P9 l0 \: n9 D
else wait for 10 sec
S* q$ n% n- _# c0 _ w+ ^6 R if A_i=A_leave then send to die
/ e3 s% Z, x0 O else inc A_i by 19 \3 T7 o1 i- J' r& [0 a6 D
end
2 Q0 A! z3 b7 G7 a/ b* send |
最佳答案
查看完整内容
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,其它按你的 ...
|