|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ R' X& m2 W) G/ J' l
- S- J5 l8 S' m/ ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。! W! q2 g/ N+ O" U8 _0 h
4 Y7 s z/ U: Cbegin P_read arriving
" u- V1 U( M/ H6 b; T while 1=1 do begin5 E; [& V! r: o+ r X, ~
read A_tote from "data.txt" with delimiter "\n"
& }9 m0 S' f6 O read A_time from "data.txt" with delimiter "\n"
8 R$ i$ t. d" f read A_leave from "data.txt" with delimiter "\n"
* o" X, I, {. _ read A_picks from "data.txt" with delimiter "\n"3 J, t# P# j" k) |% ]& N+ z" n
set load type to A_tote
* {2 p+ z+ W+ ^$ g if A_tote="tote 1" then set A_induct to 1
3 Y( Y7 t5 [; |) r- Y else if A_tote="tote 2" then set A_induct to 22 k# V* q- W8 Y, M+ B$ m5 n! U8 s
else set A_induct to 3 + f: }# M' T2 M6 {' s
set A_i to 0
0 |# \' q% W" t clone 1 load to P_induction0 Y, Z- [7 u; @4 m- p
wait for A_time sec1 p) M1 |7 I) l7 f+ Y
end
5 i' S# F# U9 {6 p; ^, r8 y n$ vend; q4 n6 W t- z" \" B( E' T7 ]
# ^" ?( k4 u( B ~" Q. v- ubegin P_induction arriving) W- s# \) U4 a: @, _" V6 U$ M
if A_induct=1 then clone 1 load to P_pick19 C- i& V# _5 [; F( S' n
else if A_induct=2 then clone 1 load to P_pick2
; `0 i' t6 c ]8 a! `4 C# A9 t else clone 1 load to P_pick32 _+ [# L4 B- f% ^; l! D! `4 h. S
end9 G3 u; j% D, g- @
3 J# O& M9 G% sbegin P_pick1 arriving
( a8 ]/ Y; J* B" I" J, g$ ? set A_i to 1
7 ~! T# }; ?/ S5 F) W. \, O9 R move into Q_induct1# J* ?* {8 N, p# k* w
move into pickaisle.induct1
( K6 J, P/ E1 K$ V while A_i<=30 do begin
: s/ [6 t. q' n: ~ k: Y travel to pickaisle.con(A_i)
1 b+ G N s( S! x7 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N$ m( C2 u6 L4 h" d1 K else wait for 10 sec
" l' z+ j# h, D+ L) U) b if A_i=A_leave then send to die
6 `8 f8 ], c! M else inc A_i by 1
" K, a. D( ^8 z6 `- _+ o end
* d# B3 k7 [! @9 lend
# a1 R% e- W0 q! G H: ~! b
& D- ~4 j; y" D3 J7 lbegin P_pick2 arriving
% o5 R& h: M; ?; D5 {, P( B' h set A_i to 11
- `: Y. v7 @$ P/ k- `. A move into Q_induct28 e5 f, ?2 z% C0 N
move into pickaisle.induct21 `/ { }& T2 r- X
while A_i<=30 do begin' q |, ]7 d; g w
travel to pickaisle.con(A_i)
V3 e7 C& y+ X ]9 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j: D# d- e |- `& N else wait for 10 sec
v" J& T$ S! n5 q1 Z2 v i if A_i=A_leave then send to die+ ^5 H7 D0 y' o: i; d3 H' o. I
else inc A_i by 12 w5 W$ [8 p5 i$ v% ?( o
end
( w8 n7 N7 f3 oend
( k2 P7 N7 c; `/ h6 w. Y. d, {
7 _% [. p4 a: W; m( Ubegin P_pick3 arriving
) k4 k( K' C6 b3 P0 [ set A_i to 21+ U% n0 T% b5 f! o7 ?
move into Q_induct30 v4 |) u0 j! L v# v, d) d: \
move into pickaisle.induct30 g7 k2 h: k& d, Z+ U
while A_i<=30 do begin6 o) g! [! f' Z: t4 C+ @2 L. k; J
travel to pickaisle.con(A_i); L1 \7 k }. M2 I4 Z# b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ?- X& d0 ~ L# ]9 _' D, ~. @
else wait for 10 sec
" x2 A6 ?+ D8 a- m6 z if A_i=A_leave then send to die
! P+ U1 @4 V5 a3 Y( X else inc A_i by 1
2 C* n4 s" X6 Z. N! [3 [8 }6 O end
$ N% g$ U: b* |! Cend |
最佳答案
查看完整内容
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,其它按你的 ...
|