|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) q# w: V( _. x) W! b0 o
m! i0 S7 U8 h* F2 a我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% Y3 f! t! i8 e( x6 ]: q3 _& c! `! g% m+ v
begin P_read arriving% e1 K' P# V/ \- D
while 1=1 do begin
# b# G0 C% A5 X6 [0 Q) s- d' m; @ read A_tote from "data.txt" with delimiter "\n"
& K0 h9 x2 R! [3 g8 W d read A_time from "data.txt" with delimiter "\n"
) E3 k5 U3 Y- F read A_leave from "data.txt" with delimiter "\n"5 E3 U: v5 w3 i- m! a+ ]4 J
read A_picks from "data.txt" with delimiter "\n": t# n0 m/ R1 @. Y! i( m
set load type to A_tote
2 k7 L9 F7 j# T( k$ H# T if A_tote="tote 1" then set A_induct to 1 v+ Z/ _1 m$ ?6 p
else if A_tote="tote 2" then set A_induct to 2
5 z. _: p# d- t- y7 E; o else set A_induct to 3
: c1 O7 S( H" O, e$ U set A_i to 0
- q' `& j9 K9 X0 \$ j- j: \ clone 1 load to P_induction% e. w% v2 a- F: }8 R: a
wait for A_time sec
1 b6 E7 x/ x6 B: K2 x4 Z* }( i end% E! O! u4 `' \3 u7 g3 b. i
end
% E6 v6 V8 [3 ~' Q
+ C' `0 y4 Q4 L2 ebegin P_induction arriving, _, e6 D+ s S0 r/ c
if A_induct=1 then clone 1 load to P_pick19 i% ]9 k- w5 Y' @7 L6 E
else if A_induct=2 then clone 1 load to P_pick2; G I+ }/ B4 f; E% N( O3 ]( f
else clone 1 load to P_pick30 W2 n0 U m) @, b
end$ c7 F8 J* p3 D+ _+ d B% o
7 o' u! K: D, G8 B
begin P_pick1 arriving; T1 c2 P1 x; [5 m
set A_i to 1
1 d0 k1 j: M1 N# ~! y5 f: c9 p move into Q_induct1
! Q: M8 X# J+ p' Z) T2 [! v" K( J; F move into pickaisle.induct1$ ~3 x8 i7 O" A5 p( a1 Q2 H. j9 \
while A_i<=30 do begin% r+ L' c- }6 \9 j/ i2 Q
travel to pickaisle.con(A_i)
- C$ [. i* S5 k: \0 l) P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- [$ Q& `2 f* `! \2 I else wait for 10 sec/ t# M$ t& F# W5 | w& y
if A_i=A_leave then send to die
9 w \+ G* w+ D+ I) \4 w# m7 I* \ else inc A_i by 1
+ A5 l9 Y6 f- a) o* m end
& m' B: L$ \: {1 v) tend
* m6 x9 J$ a, f5 X& x* n$ \/ g3 F' a- v3 ]* S" }6 i0 c3 c; Z4 B
begin P_pick2 arriving: ^" m6 M. W k7 H1 y1 {
set A_i to 11
! K8 j- z K# Z0 s& x1 Y8 B! M move into Q_induct2
7 Y( c. U |" ]- ]: R) y4 Q9 A. i4 Q, o move into pickaisle.induct2; P2 q1 X9 {; ^
while A_i<=30 do begin, r$ }$ ]$ z; C. f2 W5 L7 B0 w# L
travel to pickaisle.con(A_i)
0 u* B$ |% E! Y" P. ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
L9 [# @- _% [) b* u% Q( v3 O else wait for 10 sec
& r9 b' e3 a" P1 I8 x: N) k, o if A_i=A_leave then send to die
, D a- v0 L0 n* d# {6 L9 \ else inc A_i by 17 o4 V) s8 [0 t5 k. o
end
4 F; E0 _ s: J2 p; \& fend `! ~' R8 f) D2 W
& S0 [% W! ?! x' \ nbegin P_pick3 arriving# x( [! L3 t+ H+ n
set A_i to 21
8 ]' Z. G8 U1 c2 F: c1 o move into Q_induct3
& N" \% y: m9 t/ B$ c, u! D move into pickaisle.induct3
% @( n( g, L7 t6 ^( \; \ while A_i<=30 do begin' K! w& V( Z2 [/ q1 d- `
travel to pickaisle.con(A_i)' R! T* e& r- k1 `5 @, ?$ `9 d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) [0 E9 U' G( J, B1 Q else wait for 10 sec
6 s5 t6 }! W c2 M if A_i=A_leave then send to die2 T: q4 d# Y0 c- G, H; G9 t
else inc A_i by 1
f( J7 Y) T& I& [# V end/ q! C [8 C- h: B5 ~
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,其它按你的 ...
|