|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- q! ~; f5 j3 u ?6 L3 t
7 t0 b' i7 O' R; D% R我的问题是,在每个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中的数值,不知道会不会有什么不妥。! N4 ?/ m+ n9 s" h6 T* w$ y
$ k$ X* s) ~, `6 U
begin P_read arriving0 `" W9 m c; D! @' ]) }* F% I
while 1=1 do begin
! R) S9 Q& o2 x read A_tote from "data.txt" with delimiter "\n"
' `7 }* q' o1 p, H, e/ [. [, { read A_time from "data.txt" with delimiter "\n"; u* D- R p, G( d7 T; I& t! |* ]
read A_leave from "data.txt" with delimiter "\n"
- D9 ?( ]7 _' Z1 w9 l read A_picks from "data.txt" with delimiter "\n"
3 L! p# C) F6 O8 ] set load type to A_tote- D3 P# W& j7 v% n) k
if A_tote="tote 1" then set A_induct to 1/ p: L0 C8 P8 z
else if A_tote="tote 2" then set A_induct to 2. O4 G* Y' S( U0 L
else set A_induct to 3
: h/ O/ R$ _6 z* S$ F set A_i to 0$ I5 d, A1 L7 |' R/ \6 } K4 y
clone 1 load to P_induction
& O! s8 A- D: g1 C6 Y wait for A_time sec- _' J3 X4 d$ F
end
/ O; n6 A! f/ N0 S: p9 v3 M" X' I2 Lend
% r3 z3 j& V( C7 ^+ K2 ]6 f) K5 Q9 @
begin P_induction arriving
6 ~" v% i7 O4 b5 { if A_induct=1 then clone 1 load to P_pick13 S! P% s/ o0 D6 D# Y2 }
else if A_induct=2 then clone 1 load to P_pick2. v; r& V4 G! m. ~3 b
else clone 1 load to P_pick3
3 a# V: E( r2 d/ p4 g' ~end- h' v$ g) b( K
- `# h3 }" Q% b! n$ q0 }- q* f
begin P_pick1 arriving
% D4 n) a* o' Z8 [% e- E0 J# e set A_i to 1# R9 h4 _2 m* j! W. Z' B
move into Q_induct1
- `2 J$ H/ H- p; E0 K: Z( f# ~ move into pickaisle.induct18 o: v6 I" e, w' d! c! b
while A_i<=30 do begin; J! V! s: @ ]1 J- i
travel to pickaisle.con(A_i)
% S2 Y- }3 g: j2 ~7 j3 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' R [$ s: F: s" z# a else wait for 10 sec- n: J8 `. ?# r# V4 r* i
if A_i=A_leave then send to die3 o7 M1 v* C) A [2 K n
else inc A_i by 1
& B0 {3 q) A- G% p5 C# E! _ end' K( Y3 m; B/ D/ G/ E' }$ n M" {+ q' Y
end
9 Y( G A2 c- |! ]. e+ [- \7 h s# J
begin P_pick2 arriving- ?8 A7 R C9 w: b9 X# D' J
set A_i to 11; u# q) _0 \8 Y* T+ b
move into Q_induct2$ m* G- r$ q: `& t2 W
move into pickaisle.induct2- k2 b6 L1 a& I. i1 H1 Q
while A_i<=30 do begin$ {0 ?5 n$ y! a
travel to pickaisle.con(A_i)* n7 b+ ~6 V. P$ s$ `# c8 k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ _. G( K0 I1 G, E& D0 {' _
else wait for 10 sec9 a. L" S7 {4 ~2 D F
if A_i=A_leave then send to die6 N0 B3 `9 l9 e; q$ Q ~
else inc A_i by 1
7 y) ]( Z! r9 o* W6 m end5 U2 U! r0 _4 T, v) Z
end
% O3 Q A S0 K/ V3 B) Q5 [: ]2 K0 i
begin P_pick3 arriving
, M7 S. ]7 f$ u! y set A_i to 21
- J& g! T- e8 S( f' D: a3 w8 F move into Q_induct3* S# R' { i. c) D1 T: u5 D
move into pickaisle.induct3: T- Z4 j- a: D- G" ^" N) M
while A_i<=30 do begin
- U( J2 q6 J6 R& L, ^+ Y' l, e travel to pickaisle.con(A_i)" l% G* W0 E, U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 @2 E; j$ N! t% q9 d: } else wait for 10 sec, u J/ W# a, w9 q' I5 L) @2 x
if A_i=A_leave then send to die
4 g+ C2 H/ ]7 y6 S6 P9 a# G else inc A_i by 1* G& V5 A+ |9 K. \% u
end
# P' p) j0 c+ v0 K: [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,其它按你的 ...
|