|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 w% @) @: E4 n; ^3 ^8 G4 M7 \1 Q$ a. N; \* K8 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中的数值,不知道会不会有什么不妥。: A1 T: R f- U% Y9 J" _
" E, J' K6 L9 X. |begin P_read arriving
8 @& H$ ]2 e# B* m7 g while 1=1 do begin
/ X, ?; [: ]. K5 n+ e read A_tote from "data.txt" with delimiter "\n"
& M7 g& p/ m0 K7 X read A_time from "data.txt" with delimiter "\n"5 j2 D3 E1 D+ [$ o* @. `% Y
read A_leave from "data.txt" with delimiter "\n"
9 P2 W) u, B# O# X- I7 O- B# ] read A_picks from "data.txt" with delimiter "\n"2 ?, R3 F$ `" Y- ~2 I ?* q9 ]+ g: d
set load type to A_tote! r7 J4 S, m. Q$ |. R- I! o
if A_tote="tote 1" then set A_induct to 1
7 H7 `; T6 c& D6 a/ O" j else if A_tote="tote 2" then set A_induct to 2
9 c( i+ N" W8 `$ T. G" @( ?+ r else set A_induct to 3 9 G6 ^, v! X1 n( Q! c: a
set A_i to 0( i1 o% h- Z5 L4 o4 [, y
clone 1 load to P_induction
( R. r( a+ K! R' P wait for A_time sec1 w ]# L$ {# I; g
end3 E C& z$ i0 y! V
end
+ O4 l1 B& H) s+ Y! x; d% R- M" k6 }5 z# W
begin P_induction arriving9 \ h8 E* Q$ L2 s3 \* r
if A_induct=1 then clone 1 load to P_pick1
& u: [/ k) J- z/ W9 O+ A9 M else if A_induct=2 then clone 1 load to P_pick2" M7 c% J6 ?! F5 Y D/ D
else clone 1 load to P_pick3
8 }$ V4 l+ b D; ~/ u9 F& Lend# a6 Q& F& X& O4 `3 T M& ~
# D( q( y& K1 |
begin P_pick1 arriving
+ Z% m; }# |5 X; y& [ set A_i to 1
( E5 ]9 l/ o3 ^& C% I7 q move into Q_induct1$ h* l* M# A3 X/ o. }4 K
move into pickaisle.induct11 {& G* L$ u: q8 w2 O
while A_i<=30 do begin7 W- ?6 f2 [& r" c0 }
travel to pickaisle.con(A_i)
% J% j, |3 Q; h ~3 C" n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! G- ^& H& M/ x8 A) [ else wait for 10 sec3 N/ X! ~ V" [
if A_i=A_leave then send to die; s6 e) v. T( ^+ m+ I- J
else inc A_i by 1" W/ p4 N! T8 j5 j
end
0 u4 B9 a% S* ~0 R8 X! `* G H! Qend
: ]: O8 b4 h; a$ L( N: @2 d. y3 Y8 x9 {
begin P_pick2 arriving
$ v7 e! }4 ^- w" E& F# d, H set A_i to 11# z# |8 R& R4 b" i) H
move into Q_induct2
& {9 M+ S* t+ o move into pickaisle.induct24 X; w( v: _2 s% v- |
while A_i<=30 do begin* E* _; w) b& u$ q) C; F$ `2 M
travel to pickaisle.con(A_i)
. d; x% F' S9 C' q7 A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ J2 h2 p- h; g9 a5 T" S else wait for 10 sec
6 a: B' I( v) A6 t* O6 X9 K y if A_i=A_leave then send to die
% e' Y( \; |$ L$ M' x else inc A_i by 1
" m, e1 W2 s) _# y6 Y end( Q# W' }* U% I% b4 j! A3 A( f
end
# F/ ]0 ~4 [) x- r4 M7 l5 i
. _9 m8 y( \2 ?& f6 L2 t2 Rbegin P_pick3 arriving7 n, Q5 }) z' ~6 t" }% o& D
set A_i to 21
4 _2 a3 |, i0 H" s5 s, ?, G move into Q_induct3/ }) @5 n; j" ^$ z
move into pickaisle.induct3
8 O# D6 n! ?5 H {% c. k while A_i<=30 do begin
9 v- @( c/ T% @ F5 B% V! c( V travel to pickaisle.con(A_i)
( |! k8 ?4 n/ L* e3 A3 ^' \( m( B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# W% q. d9 R4 R+ o else wait for 10 sec. p1 v% k0 D3 J' H$ x; S
if A_i=A_leave then send to die$ n% [. T( S* k. P% s
else inc A_i by 13 s" G+ Z# J0 J5 S2 ?! ?1 g
end" A& M2 `! }+ U" L! M3 h
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,其它按你的 ...
|