|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 m6 X! w z4 Z: E( x4 w
6 K9 S7 R! x3 c# k' W7 X我的问题是,在每个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中的数值,不知道会不会有什么不妥。, V# |/ t0 h, f" V) Z. q u
- w# `0 H( k0 D2 x' W, n' w$ }7 C
begin P_read arriving
6 R0 l. A( ^" |6 A! m$ _4 S while 1=1 do begin
% G, x3 Z; G \" [6 _ read A_tote from "data.txt" with delimiter "\n"! d; g1 g2 l% k
read A_time from "data.txt" with delimiter "\n"
5 @8 _. a6 P' r/ _+ K, L: R read A_leave from "data.txt" with delimiter "\n"" p3 L: w1 L$ @3 F- F( z/ Y( t
read A_picks from "data.txt" with delimiter "\n"2 p. B" z1 |: L7 ]" w/ w# _
set load type to A_tote
) V0 q4 O' q) }4 G1 M if A_tote="tote 1" then set A_induct to 1
& l4 r7 ?6 y8 k7 K0 o else if A_tote="tote 2" then set A_induct to 2
* q1 D. v) J) r: ^/ \: v else set A_induct to 3
2 ~/ Z% r: R; U- {/ S: J; Q set A_i to 0
1 {+ B: t2 d O) H% {& B( v clone 1 load to P_induction/ y# F! K ^7 a3 G
wait for A_time sec# w1 E. t2 r+ z3 m# N, B
end& Q! {5 |# a8 c5 {
end
6 q! v9 u! t7 n: A- d3 E* J# c) d
9 G3 x# A `2 W4 d" ?begin P_induction arriving) n6 X0 C$ v1 Y( Y" h
if A_induct=1 then clone 1 load to P_pick1
( P" |, j) _* _: @. ^5 Q9 U else if A_induct=2 then clone 1 load to P_pick2/ G2 X: g* ~7 |6 y
else clone 1 load to P_pick3
, \; p1 P, x4 r% ?+ mend& L+ h: k3 n2 O$ K
* ?6 V$ S+ ~, A! Dbegin P_pick1 arriving
+ i2 E2 F* u- a9 X' {' k ` set A_i to 1+ \% I" I; s0 K2 u) U
move into Q_induct1
* M3 }; c, f3 k* u$ Y move into pickaisle.induct18 Q' \* Q1 |% p5 M
while A_i<=30 do begin6 z$ {% o( _& ?* u5 R6 N, ]
travel to pickaisle.con(A_i)% a. B$ s9 e6 I1 @4 C: `+ ]& ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) B5 D$ F2 P0 i# _
else wait for 10 sec, [- {0 t( z# z8 i; u
if A_i=A_leave then send to die
0 ]1 O+ c9 V' N7 z else inc A_i by 1
4 _# }) m# O8 K end
7 P/ i" F+ K! g: Y8 D5 K* e5 Uend2 J |. D8 q: M8 L- j. b
% H! l: Z% g9 X# U$ Q9 xbegin P_pick2 arriving3 T8 d( j! A3 Y+ u
set A_i to 11
2 K2 L2 p( X5 d/ r9 r# p1 P) A move into Q_induct2) c$ J9 z% d, h7 N! Q+ q# @
move into pickaisle.induct2
4 _1 }8 U) ^& Z$ g0 z- a) Z while A_i<=30 do begin$ d+ n2 A3 c* q! T
travel to pickaisle.con(A_i)0 [6 w ~) h8 v# N' Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 y5 p' [) \) {0 I" G else wait for 10 sec0 u$ _1 e! H( z8 t$ k8 L; ]
if A_i=A_leave then send to die! ^ n. G! E3 i1 I; E1 h
else inc A_i by 1
' r. B0 g9 t2 G4 O end
2 U& n$ Y8 i7 M$ u: ^8 U- d Yend
3 ~5 e: ~( ?4 S' p7 i1 k0 b' M7 c# v2 R; `
begin P_pick3 arriving+ Q2 \5 f8 M* `; r3 T& E
set A_i to 212 b' Y, C; n/ O6 u
move into Q_induct3
+ @: W+ e. ]3 ~( z& E E# ? move into pickaisle.induct3- A& r0 \4 k% }# f1 ^1 D- \) j Q
while A_i<=30 do begin
6 p" N! w6 k& f# o4 A1 H" U travel to pickaisle.con(A_i)
4 N) @0 \9 ^6 | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! A& U2 t5 b2 ^ else wait for 10 sec' [; ~3 ~3 b9 E7 l+ L; L
if A_i=A_leave then send to die- [7 R a/ R! x3 P( {! H
else inc A_i by 1; d1 f$ D1 [; x- h6 B: z) {! E9 e/ o( T
end5 _5 f. i2 T7 r; Z
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,其它按你的 ...
|