|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) H: K0 p0 [# R# j }. o& i
; {' F6 A* \3 ?& p6 @
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' m4 J8 B# D- e
2 D6 w$ u& t7 H3 lbegin P_read arriving$ _# f3 P- c9 P
while 1=1 do begin
$ f @/ {# h6 X0 |$ g( U4 K read A_tote from "data.txt" with delimiter "\n"+ a1 Z- G3 D4 }, ?: N
read A_time from "data.txt" with delimiter "\n"
1 L: }( y" R8 C& r1 X read A_leave from "data.txt" with delimiter "\n"; C( v, }8 y0 J* `
read A_picks from "data.txt" with delimiter "\n"
B* W2 U4 _. { g, v& M set load type to A_tote! ^4 H$ q% m5 M. G6 K. @
if A_tote="tote 1" then set A_induct to 1
' @; |) X1 r8 n9 O+ n else if A_tote="tote 2" then set A_induct to 2: F" _2 H7 a v% X }) a" J, {1 R
else set A_induct to 3 , K4 \+ R/ X* x# C; r3 G1 O' e5 e
set A_i to 0. {! X5 ?1 P1 U3 J
clone 1 load to P_induction
/ W/ J- a: g5 E! l% O0 ?4 W wait for A_time sec1 c1 A, \1 w1 B
end2 a3 b C1 {1 C: j: `
end
# ]& b, \) ]7 A7 v/ @$ A
6 F) D' ^; {0 w: Ebegin P_induction arriving
2 A% s# k% H% |/ I+ i" R if A_induct=1 then clone 1 load to P_pick11 a) S6 y) w& ~# ^
else if A_induct=2 then clone 1 load to P_pick2, w O, y" s- g% {9 i9 I* l
else clone 1 load to P_pick35 s6 f6 R5 C8 U; ]
end
6 ^' W# r( C) ]" D1 Q, j) J+ ~7 R3 a6 ]. O9 [
begin P_pick1 arriving7 O9 B* B9 F ]5 x
set A_i to 1
9 q2 g; J+ [) K- c. ? move into Q_induct1
( q) e! N$ x+ W0 M move into pickaisle.induct1
. t& K) `3 J# N$ B1 |% \, ^ while A_i<=30 do begin4 t5 ^3 e+ z5 w) c/ K Q. ?9 O" _0 [
travel to pickaisle.con(A_i)/ N6 V/ b; M8 U3 d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 K. i! d+ t5 o) p. U
else wait for 10 sec
h$ \/ o1 H: Q# P: U if A_i=A_leave then send to die% X% s% |6 z% H6 Z0 V
else inc A_i by 1
% Q5 c; R% P. _+ h- X5 n3 V7 ` end
A7 G) x9 b5 S2 Yend
" o9 }& P) K0 X v& C p* \6 r7 [9 E* _# I/ M4 n6 m2 z
begin P_pick2 arriving
- K, r* y C& O$ Y! { set A_i to 11
4 }! o! r# `, E9 [' q move into Q_induct2. d3 z% Q+ B: V# S1 d# E6 H
move into pickaisle.induct2; z; b l8 n9 V: e4 @% k, a
while A_i<=30 do begin
1 ? _% W3 ^0 U5 {/ A travel to pickaisle.con(A_i)
# u+ W# j$ k5 I) u3 g5 v+ \ { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; D/ _# M- q4 ]+ W else wait for 10 sec( L+ a' _" [ O" K& h
if A_i=A_leave then send to die
# r4 K8 T0 z9 }. ?0 W else inc A_i by 1' a; O, A; [( o6 e- y
end
) a- @2 X+ Q) H0 `" P! l: xend
2 h- {4 f, j! d4 U
! H' x( C0 v" p+ S) sbegin P_pick3 arriving: T" D: V1 a% _; o4 d8 {7 q
set A_i to 21
* N% j4 \9 }; |$ A4 U move into Q_induct3' \* B( T' @/ q I
move into pickaisle.induct3, N6 K, s6 W- [5 K& X+ ?# y" y
while A_i<=30 do begin
; Y0 |/ B/ [. J% m/ e$ y- c travel to pickaisle.con(A_i)
8 K0 `5 P, n, P$ R* w/ }. _* z3 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Q" @% D* ~2 D$ [. r
else wait for 10 sec
4 U" }) n6 j9 `6 [) W if A_i=A_leave then send to die
/ m8 F' n' n. p" M; C# e( v, z else inc A_i by 1
9 z, {5 V+ ], Q! Y end
# G# C* I$ a$ T$ m6 uend |
最佳答案
查看完整内容
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,其它按你的 ...
|