|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 h4 W0 c! @7 R, E4 `( c9 [
( y+ ^3 J; w! J0 O5 ^: p, B我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 p2 `; x0 W1 K V6 k, @
0 ^$ ]2 F: k- V6 V
begin P_read arriving& O" T$ }2 W% G# s) u
while 1=1 do begin
7 F! k& a- c I4 b$ ]0 e6 o read A_tote from "data.txt" with delimiter "\n"% S- `+ J8 e- C6 L6 D4 {
read A_time from "data.txt" with delimiter "\n"
, g% f6 V# H7 I& U+ n9 V0 L- c) ` read A_leave from "data.txt" with delimiter "\n"
5 O1 Y) U( h9 ]. B* o& g read A_picks from "data.txt" with delimiter "\n"
$ q% R- @0 X' l) d3 P set load type to A_tote
C8 p2 J S. |- k) p2 Y if A_tote="tote 1" then set A_induct to 11 W# _( a s3 c
else if A_tote="tote 2" then set A_induct to 2
) h* [& i: w$ e! A" {6 T else set A_induct to 3
% M- x* e! N( f set A_i to 0
+ Z9 I5 O7 K; ^" o+ s) N0 L' ^* I' \ clone 1 load to P_induction/ V2 K( Q) [( V1 _1 v3 W, y
wait for A_time sec
/ X; q" @ O2 h end9 j- i$ |, I( c m: W" I$ I
end
' V2 F T1 X7 T- K# w$ {# N( ^. `. D: e
begin P_induction arriving2 U; |: T' Z$ @7 u
if A_induct=1 then clone 1 load to P_pick1
' ?* z7 Y/ L% _/ y' C else if A_induct=2 then clone 1 load to P_pick2) X# i) P- d( q
else clone 1 load to P_pick37 b' W- ?( c: d4 E- M3 F6 W
end
) c' R2 t: [+ x. m: v
2 M$ f4 w% a$ ?: _# Jbegin P_pick1 arriving3 E' G7 H, S/ y& [! S3 b& g
set A_i to 13 ]4 ?# V8 D$ h
move into Q_induct1: i# I& ?3 d" W" Y% o- s! G
move into pickaisle.induct1/ @- C. ^( P+ t3 b" V i7 j
while A_i<=30 do begin- k( l# v9 C8 [; Y
travel to pickaisle.con(A_i)% B+ c) f+ Z" b4 s' E& e' q3 q7 L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! z9 m9 H6 {$ x+ C% m' @- S else wait for 10 sec
7 @7 q8 C7 \5 N2 Z if A_i=A_leave then send to die
9 B$ }$ {2 c* P1 u else inc A_i by 1+ Z y" o0 C# _$ N! J) B# |
end
1 T% c& A/ W Dend
" ]) J! n! `2 R. F: l: }
+ D; G: [! n% a N2 `) t2 hbegin P_pick2 arriving
1 ^3 s) R2 l e8 d6 f6 h+ ?+ O8 X set A_i to 11
( t* W" v, Y0 c% e5 _ move into Q_induct2
+ h* n& U/ n* F$ Q% i- z+ e move into pickaisle.induct23 @; l# l' A/ C+ L# {. K
while A_i<=30 do begin
' _! s( l6 M P \" i/ i7 W% t; p travel to pickaisle.con(A_i)
- p1 I P3 [8 [6 H! M) w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 g$ T/ j o! v0 h else wait for 10 sec& O$ X/ Y; N& s v, ?; S
if A_i=A_leave then send to die
- ]/ r5 ?& _) J7 i else inc A_i by 1+ m! ]. R) ]0 [, x# `! v
end7 k: Q+ }& q4 `& l
end0 D3 k8 @5 v E; R/ T- F4 c5 Y' F4 i
9 ]; P/ y A+ W+ {4 _$ g
begin P_pick3 arriving
* V, m# F) n7 q: I/ G' E$ Q set A_i to 21* s6 t6 a6 f' \& H7 m. f4 b; U
move into Q_induct31 A; w4 ?( N, E) s, `! T) \0 h+ v
move into pickaisle.induct38 c; Q+ Q# _% [* J( j4 _; P8 I
while A_i<=30 do begin6 e) p4 D; F! Z) w# H$ ^
travel to pickaisle.con(A_i)* H- ]5 v5 X% n/ V; x- t9 v9 a+ V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ r% l2 B, |5 `! `, ]0 `& ]( Z else wait for 10 sec
8 J$ u! L' C# @! l5 R if A_i=A_leave then send to die
2 g5 g% w+ r9 \ `( G* t: W else inc A_i by 1" W2 h/ y3 G) l- w1 S/ _7 y
end5 H- s3 B& n3 J o; y& ?
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,其它按你的 ...
|