|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- v/ o0 v: d; c. C2 s2 x- \7 N( K
& n, J% G" G f3 r1 ^: ~! c) S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# k7 \ \' K0 b- F6 t+ c" [1 K8 F- T2 K
begin P_read arriving/ Z: l9 N- l3 L6 h, e
while 1=1 do begin- X/ o1 [3 c% o0 Y) D) u
read A_tote from "data.txt" with delimiter "\n"- q4 U f4 N+ ~0 h/ J1 l) u! s
read A_time from "data.txt" with delimiter "\n"9 }. `4 l) ?2 q) D `6 X: X( v
read A_leave from "data.txt" with delimiter "\n"2 b# E5 e6 N1 h2 k: l9 U
read A_picks from "data.txt" with delimiter "\n"$ K P% o4 b$ b
set load type to A_tote, L( @* o @* j# `& Y9 Z+ U" n
if A_tote="tote 1" then set A_induct to 14 d; L4 v0 t$ J+ g
else if A_tote="tote 2" then set A_induct to 29 e1 P9 X) ?, n$ P2 c) @
else set A_induct to 3 & Q- m7 D0 i+ E* P
set A_i to 01 {" d; c; {, c# w+ O o
clone 1 load to P_induction
& ~! q3 H; o0 Q- w$ a+ Q9 ^* Q U( K wait for A_time sec
' u$ I( W( O b3 x* Y0 i. T end) ~) }: Z S% Q" E9 G/ K0 A( ?/ w
end" A0 P. {/ `, _7 `) _0 w( r
( X* H5 b3 n& }- k& Ybegin P_induction arriving
3 K2 n4 B- ~/ v if A_induct=1 then clone 1 load to P_pick1
& \9 ?) W$ V y6 r else if A_induct=2 then clone 1 load to P_pick2+ Y1 M7 t' b0 C% [
else clone 1 load to P_pick3) Y9 Y. `- D/ @& }1 S
end$ R4 m6 k& ^. W+ |5 r! l7 P2 o
1 T# p2 E( j& |. e" ^& pbegin P_pick1 arriving
! y+ b1 u' n- S set A_i to 19 D9 } d+ e3 [" z& s
move into Q_induct1
5 |9 p' [! J8 I: D; m& A move into pickaisle.induct1
& J$ |5 H9 p3 h' \/ R4 b while A_i<=30 do begin9 [5 L3 O( c) B. m8 u; k0 s3 J; l
travel to pickaisle.con(A_i)
1 k) b9 l& e) l) O5 U9 f \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ d! ~/ z0 c& L
else wait for 10 sec
% A, h0 Y' J: X& E8 L$ v if A_i=A_leave then send to die! _/ ?* M1 N8 O8 k4 `0 S
else inc A_i by 1
' A* Y( s5 R; H w* w end
b& z/ L: Y( w( ^end3 { d2 X6 e9 S& t( Y
6 j' {* h& T9 |% L
begin P_pick2 arriving+ ~, [ t8 M8 r1 E7 s) q! L
set A_i to 11! F8 M6 v" F; t, d7 p" |
move into Q_induct2
5 f+ P/ Z5 o$ E5 n* T5 Y move into pickaisle.induct2# ~- g/ z: l) Z& c7 A, s
while A_i<=30 do begin
' C7 C. y. [. T# N travel to pickaisle.con(A_i)
, S9 |0 E9 L+ ]1 r/ o" C2 {5 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 X+ d. E: ]7 k
else wait for 10 sec
9 B" [1 r$ u, k) @. J if A_i=A_leave then send to die& m& e- }5 F% U: Q- w5 O' B4 n0 n9 Q% o
else inc A_i by 1
2 F, [* w5 Y9 d# ?0 k, c" m+ @ end
0 y! h& ?/ `5 N, Uend
+ `% O* E" z2 W8 c5 I# M9 D/ w7 L
& m4 `' `2 C& r; Q) qbegin P_pick3 arriving
% M# {- r3 F. z2 t% }2 U. m set A_i to 21
* ?' u; |7 f6 g* `" x move into Q_induct3
: p( D! W" V# p9 d# |# B move into pickaisle.induct3
, K# P+ Y9 n$ n3 m" X# A* k$ ^ while A_i<=30 do begin
) Z+ k# I! V3 m4 K6 s `# | travel to pickaisle.con(A_i)0 X: N9 w; o0 P7 Q( `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 H5 s# o) j, ?# x
else wait for 10 sec
7 Z6 P* _9 Q! a1 S; m4 y if A_i=A_leave then send to die- s* i8 _2 ~2 b' X
else inc A_i by 1: I% k; O; B4 h" s
end$ T! J6 D3 t3 n! f& {0 s* l! ~
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,其它按你的 ...
|