|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Q2 e" I6 |5 o: k3 U5 O+ T
: ?1 V" q4 w& v( v' f- c$ {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 n2 r6 ^* K- Y( a* p4 k' K) I
# ^- A+ Y" |2 q$ R0 D3 U; |
begin P_read arriving1 g/ J, @* M; j. ?' l
while 1=1 do begin# t8 B3 c' w* d9 f4 ^
read A_tote from "data.txt" with delimiter "\n"* b g% K8 w$ J' ?7 Y1 F+ S
read A_time from "data.txt" with delimiter "\n"
8 u( A6 l: ^) y read A_leave from "data.txt" with delimiter "\n"0 m9 y4 A/ C& T' `
read A_picks from "data.txt" with delimiter "\n"
) h; y6 T2 s# Z( U9 ? set load type to A_tote( }" x2 \7 [5 Y$ h" ~
if A_tote="tote 1" then set A_induct to 19 O; Q9 X2 c- M7 f, |4 C
else if A_tote="tote 2" then set A_induct to 2
8 C( ^- x( o* P; R8 b else set A_induct to 3
+ L6 O$ L6 s) g2 D: i0 Q* S) o3 ` set A_i to 0; o! P9 I) O( S4 B* p" U" C
clone 1 load to P_induction9 s" j1 u" z G4 z7 c! D( X$ X
wait for A_time sec2 [) A; `; z* K, w3 @1 U' o) c
end
7 j7 f, M! g1 `' a1 Gend" O4 f; G- T8 C& L0 ~. I( P. W9 c
2 m4 @! l/ n S/ @4 R3 [. j* a
begin P_induction arriving
1 P* E* r. C; @, Y* v# f+ R if A_induct=1 then clone 1 load to P_pick1& ?1 Q* E( Z& b9 `/ M+ |( r- B1 O# j
else if A_induct=2 then clone 1 load to P_pick2" @* K/ f# ~! ^. U( T9 z
else clone 1 load to P_pick3( Q& S) ]) B; G
end
|: m+ ]" o' ^3 i! a! U Z- e. Q2 _4 C- @. k: ]
begin P_pick1 arriving0 n, G+ `: d; s4 K( S
set A_i to 1
7 P" E" \3 S' ~; p move into Q_induct1
% v& ~0 j6 A4 w move into pickaisle.induct1
; t+ p, W/ J& j$ M- P! _( ^ while A_i<=30 do begin8 }0 O: J$ {) e: g9 D
travel to pickaisle.con(A_i)
, P0 J8 m" I0 I% K& X* a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ {* n1 j0 k! l
else wait for 10 sec8 K1 I* Z0 c C
if A_i=A_leave then send to die. ]% R \3 X9 r3 z& H
else inc A_i by 1
! |7 A, o7 n# R& ~ end
# c5 v4 _' L; @' tend8 d. s2 {1 o+ W2 ~% z2 G
6 a0 l" i* d( O- }9 B, N* _
begin P_pick2 arriving
5 v5 }5 h3 r2 k2 y4 f3 X0 B' @- _ set A_i to 11
; L. G- e' l& }: K3 E move into Q_induct22 x! Q1 W2 x/ }/ p* g( l- N
move into pickaisle.induct2
$ ?* Q" h) f, N: y9 C/ K$ N while A_i<=30 do begin
9 |, [- w! F- O) `0 ]# b travel to pickaisle.con(A_i)2 @ w- ~) i: t& G( Q, ]7 f! `' I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 x9 K# M m) R
else wait for 10 sec7 F. w2 g2 m( n% K& j6 Q
if A_i=A_leave then send to die
( G5 u8 {$ h( ^ else inc A_i by 12 r3 k1 c6 J8 T7 Z. q! r# ?. z) l
end
0 J4 q% E; ]# Fend
) g! b( k5 \, H d
- ~% g! s7 ?3 p6 A, E5 e# C5 @$ Zbegin P_pick3 arriving. q# Y! o7 o6 G
set A_i to 21
; Q# ^( W1 q; Z- Y) g2 x/ i4 H9 l move into Q_induct3
; z6 X ]0 p: k. P. [8 t+ H move into pickaisle.induct3
8 M% o5 G/ K% I6 c- x# f' a while A_i<=30 do begin4 p* m' s; K+ \9 s
travel to pickaisle.con(A_i)
- O, j+ k3 e8 C( k( g( ^* M% x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 c9 O* B/ j2 k0 u8 c/ l: \0 C6 M
else wait for 10 sec
* B8 e6 u+ F7 W if A_i=A_leave then send to die
$ W- }6 b% u# S6 a- w3 s6 N3 x( s6 h- o else inc A_i by 1
$ f) A( Y. `" Z end
8 k$ n% I0 g" P5 {- vend |
最佳答案
查看完整内容
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,其它按你的 ...
|