|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 H# {/ ?, F9 Y' O0 c" Q7 q) f; F. l9 m- M$ 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中的数值,不知道会不会有什么不妥。: Z+ @$ R) P$ F8 O, u. E
' g7 i* {+ u0 P* ?
begin P_read arriving
2 {1 K% i" j; c" o while 1=1 do begin& l6 M" x' g6 ^6 }% R" w% G) y
read A_tote from "data.txt" with delimiter "\n"2 l7 k, ]( b! T2 j) @. P6 ~0 i3 h
read A_time from "data.txt" with delimiter "\n"* E3 V$ j1 V! |3 J8 z
read A_leave from "data.txt" with delimiter "\n"
. G: h4 J) h0 F6 z/ ^* z read A_picks from "data.txt" with delimiter "\n"; g1 z2 |; c: b/ d; g6 X( {
set load type to A_tote5 M8 i3 H$ H6 ]3 m6 H/ z
if A_tote="tote 1" then set A_induct to 1; n, j: z1 Y: E6 p( Y
else if A_tote="tote 2" then set A_induct to 2
1 ?4 Q5 E: J9 O, {9 r" w else set A_induct to 3 4 ]* y0 | Y* n
set A_i to 04 k+ o3 Z, [& n; z4 b6 x: d& e
clone 1 load to P_induction, e- Q. Q, H( {9 z+ a: u1 ]0 e9 \
wait for A_time sec
, b$ {9 J' n9 A end
* a" E! Q" U3 [ D* ?+ send
! n1 u/ u. S; `+ D9 e9 N$ R: S6 B- H& M# w
begin P_induction arriving
2 N( }! C* P4 Z7 `" ]2 A if A_induct=1 then clone 1 load to P_pick1- r4 Z- n0 d0 i3 J2 O! e* u
else if A_induct=2 then clone 1 load to P_pick2
- s* i- K7 y1 m8 F K: ^" a3 D else clone 1 load to P_pick3
- P0 c; \. m; n* w! s! Z6 lend5 r1 O) G# y3 c- p( G+ I
y/ V1 V7 W% H$ s" [begin P_pick1 arriving8 k& a( W, R" p# t, Z
set A_i to 1
- ^5 I% [) q5 P# [! Z5 L move into Q_induct1
( g0 L5 F* A7 \% ? e" \ move into pickaisle.induct1
1 D. i/ D, E# K, b/ b- @ H5 v while A_i<=30 do begin
9 ?2 ]4 @5 |4 `' \1 r* R/ O travel to pickaisle.con(A_i)# s# D0 W8 t; ~" B( K4 i) z# f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 J( h$ a6 f! j# T
else wait for 10 sec
* W) q. Y0 S2 x if A_i=A_leave then send to die
: m# k( n9 S( F& L else inc A_i by 1
; l) W/ H B5 x% o, w9 ^. B end0 U; D1 G' r/ r8 _
end
# _4 v6 O& L# d% ~9 N- p1 S2 e w8 t# f% c+ Q
begin P_pick2 arriving
/ I7 q/ Q- ?; ` set A_i to 11
7 L- I0 E, g1 r/ D A move into Q_induct2! \8 o6 c+ B6 I$ T4 k9 Q
move into pickaisle.induct2
3 w& U8 w2 \* W# U7 Z7 r3 d% G1 I0 l while A_i<=30 do begin- W9 e, N. T7 ]- ^4 m! ?' O+ N
travel to pickaisle.con(A_i)" X# W1 E R5 @1 \+ l7 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 E# O. z. \5 i8 ?! a
else wait for 10 sec
3 f- S& H) `! l4 |* Z8 A if A_i=A_leave then send to die! ~8 D/ A- n$ y5 { @/ W0 \: s
else inc A_i by 1, |) J& j0 D3 m( E- R ?1 u2 d( v
end$ Q$ b* f- r4 j6 `7 Z+ ^! {! P
end
; X3 x/ ^: u+ w2 z& c2 H6 p- G" `' e( b, g/ y: ~
begin P_pick3 arriving" R& \) u0 r5 Q; O1 R+ A a3 P
set A_i to 21. A. L }! f) d7 D7 y+ T
move into Q_induct32 U, p+ n5 l; g8 J5 o T: H, z
move into pickaisle.induct3
# v1 q3 \+ S3 P q, O while A_i<=30 do begin5 V' U c% f( l; D, F( l, g
travel to pickaisle.con(A_i)
& y$ B9 j, [. s I+ G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% b6 S* A/ s6 ~8 Y* ] else wait for 10 sec
7 W7 h9 X+ |7 B& R! v/ u if A_i=A_leave then send to die
/ T# K! y2 j0 [% x& C else inc A_i by 1
% u# e2 w, Q) S7 l: {5 b& A0 X end/ e1 [: q% V) }3 x! E
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,其它按你的 ...
|