|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 o* ^% ~7 k0 v1 s; A7 u
7 I# B! P: \& ]% k: x- L我的问题是,在每个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中的数值,不知道会不会有什么不妥。- B5 O* m2 m7 U; r5 F( t, x
$ H! k. h. f' H
begin P_read arriving1 k, m5 ]0 | A0 W8 ?
while 1=1 do begin
' V* q6 F0 ~9 H2 O read A_tote from "data.txt" with delimiter "\n"$ w* b+ h" ?7 u, ~3 B
read A_time from "data.txt" with delimiter "\n"& j6 m: g. z2 {" x. T
read A_leave from "data.txt" with delimiter "\n"0 E' c. q8 k! L8 \+ M& x8 }6 T& U
read A_picks from "data.txt" with delimiter "\n"4 [. ^& ] p+ x9 ` g
set load type to A_tote
1 z. _: d. g: [ if A_tote="tote 1" then set A_induct to 1
3 P# x1 G/ `6 q else if A_tote="tote 2" then set A_induct to 2
1 l6 u- U5 q: B# r3 m# L+ k7 ]0 i, T else set A_induct to 3
! k9 L2 x- d* c' \+ Q set A_i to 0* i/ Q* z9 B( J" P& g
clone 1 load to P_induction
* ?$ x' B% P9 W3 P5 w* o$ x wait for A_time sec
O7 b8 D0 w, Z3 _) N end) Y" O6 F$ s8 t
end7 g. Y4 c1 _' D4 h1 z
3 A9 k! c5 S3 R" U7 ?+ K/ K6 b; W
begin P_induction arriving! C8 G7 V8 {5 n" h N9 N( P
if A_induct=1 then clone 1 load to P_pick17 r3 e# k/ `0 C+ Z
else if A_induct=2 then clone 1 load to P_pick2$ e% i2 }: K h: L, z5 D
else clone 1 load to P_pick3
* x+ m' C- ]% k- B" Y3 ]+ Bend, I8 ]% V# m6 B
0 r. a- _5 u6 p# d/ \- X/ Y) P* {begin P_pick1 arriving
, a% ]7 w2 V2 Y# ` set A_i to 1
7 _# E' J: P# k9 Q( K& F6 k4 ]# k move into Q_induct1
% [6 x% G8 w& q4 t7 G0 i move into pickaisle.induct1
( n& O8 D! N9 \/ d& r# ~: H5 V while A_i<=30 do begin" }$ p+ {% I! s8 z) a+ ? W9 b
travel to pickaisle.con(A_i)+ c! y$ |) I H9 ]3 V3 p' `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! r% v1 S9 K1 J2 n0 ] else wait for 10 sec
7 w. D/ p# Q0 _# [) c$ u if A_i=A_leave then send to die9 ]0 Y) @8 F* [: N1 {
else inc A_i by 1; h1 @4 l1 ?: Z0 S% A, @
end+ [* x) G* N8 B" c+ i
end. d/ W) e" M$ S0 S/ p% f/ J% `3 }
& A% R# k+ {; W
begin P_pick2 arriving
0 U* u- { R) o set A_i to 11
" C1 t" p: A2 m/ J; C move into Q_induct2) F; N i* R3 D" s
move into pickaisle.induct2- \+ m4 Q2 f7 s4 [2 C' L
while A_i<=30 do begin8 M! x: j3 W3 e
travel to pickaisle.con(A_i)5 }9 ^0 {: q9 I( l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( O, F7 ] ^% d. h6 _
else wait for 10 sec
! w$ {& x8 k6 ]2 ?) n if A_i=A_leave then send to die6 z. L$ m) @8 X3 W$ T* _
else inc A_i by 19 Q- g8 M* ]7 ~9 X
end- r5 |' k/ s M2 H
end4 G! R5 k( m% e0 t7 J4 G0 \ d; m
- B9 T; w- M1 J- T" Zbegin P_pick3 arriving
% |* P, J3 N2 j% C5 k0 r# C set A_i to 21
3 V% t; w, Q' G. q9 { move into Q_induct33 G3 g" ], B; e# @) }
move into pickaisle.induct3, v% Z( o0 x3 I
while A_i<=30 do begin& y: Z# f. ~; x$ D$ K9 ?
travel to pickaisle.con(A_i)
2 M: l# k* \/ V9 n) n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: C' U: G& {: p, @) k9 e7 a
else wait for 10 sec
4 q6 p( w, ^' W9 w9 b if A_i=A_leave then send to die
# X E4 j) X% A% K0 V2 }- c else inc A_i by 1
0 N4 u" L6 @: X( R7 ]' M1 e end- W8 G) M- w0 o" c) Z! g# I
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,其它按你的 ...
|