|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. z# n M" ]5 l; L! W1 a
$ J5 K& g* x' a2 ?* ^' G我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 R6 |% q4 f- {/ K4 }. X
7 z/ o6 i% N, Ybegin P_read arriving
+ v" n) x7 e6 w: [ while 1=1 do begin% Y, @+ e4 \$ Q" ?
read A_tote from "data.txt" with delimiter "\n"% A4 e0 M* Y6 i; {/ [2 U& d
read A_time from "data.txt" with delimiter "\n"% J, Y* m4 I. ? m6 g" |
read A_leave from "data.txt" with delimiter "\n"/ Z: y Q. J$ c4 ~# Y
read A_picks from "data.txt" with delimiter "\n"
9 _$ _" s3 i9 p: H set load type to A_tote
9 B J1 a3 y8 x5 Y9 s if A_tote="tote 1" then set A_induct to 1! a0 S% H, @% N \
else if A_tote="tote 2" then set A_induct to 2* G6 C9 }5 L0 g/ x8 S9 c n" a
else set A_induct to 3 - p4 f2 R- [3 q6 `* m9 u C5 M
set A_i to 0
1 |) W* ]8 A* [8 J% O8 s clone 1 load to P_induction9 _; w) o+ f. ?. S5 X
wait for A_time sec
5 r0 M) }$ Y6 ~! b! M( p0 P3 B end
- H8 E) [- ?! `& f4 uend
, C% c/ Z5 S9 A& K7 l. |6 h1 f; |
6 @! z9 D3 Y2 Q$ rbegin P_induction arriving+ p" `( o: _- T
if A_induct=1 then clone 1 load to P_pick1
5 y" n( w6 a% W* P else if A_induct=2 then clone 1 load to P_pick26 n( x; S7 I3 q7 N
else clone 1 load to P_pick3
9 n; h. v; k- G$ v' V( Qend0 L; f1 S6 y* n
5 ?3 L: S) A* ]
begin P_pick1 arriving
) y5 f' M4 Y# h# g* v set A_i to 1
; d) d- i5 v$ A move into Q_induct1
, r% L8 N8 l: ^9 W move into pickaisle.induct1
. E8 H+ ^0 \0 S! o% [ while A_i<=30 do begin" C8 A( r, Q2 Z# N5 f, s9 j6 X
travel to pickaisle.con(A_i)
9 t9 t$ ~6 O$ n% V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* M: E- X* w8 \9 X. B& p
else wait for 10 sec
+ x6 Y$ O9 |9 } if A_i=A_leave then send to die6 T1 B( w+ x ?( k" d* I: C* I
else inc A_i by 11 V& N3 z: L$ }+ }' H- V/ x( C
end/ Z- ^4 F8 F D6 x
end! X3 g- u: w7 `0 L& E4 W; D% e
' c# | D& Z4 P* l
begin P_pick2 arriving; u- ?/ L; V6 l6 Z! b# N
set A_i to 11
2 Q- ^% g; z1 T0 a move into Q_induct27 w9 ~5 U, ^% n1 C* F! t1 |
move into pickaisle.induct2; @8 `2 z$ R- A
while A_i<=30 do begin) E, V5 [3 h. L+ h$ z- O& `
travel to pickaisle.con(A_i). f# N9 q0 v3 [- I# M. u/ D, P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ e; Q& M2 d, K9 U# `' N else wait for 10 sec
( o+ H e/ I# R7 e. j1 _ if A_i=A_leave then send to die
4 }/ ?% `" p- s. X+ P else inc A_i by 15 V! Q$ Q2 b& K7 ]! `6 s
end
0 Z0 Y* Z2 g* V. Tend- H$ ^. b- g# G6 I8 B( v
9 k: }$ |, e* l8 y4 w- nbegin P_pick3 arriving
$ @2 ~5 S0 ]; B5 U. F& f set A_i to 210 |# u! V& ~ R3 B9 X! M! N
move into Q_induct3
2 Z) _. J. X+ Q; o8 t% { move into pickaisle.induct3
8 e% [/ @6 O2 A+ O* F while A_i<=30 do begin
( B; k4 O, |6 ~: i0 t' n travel to pickaisle.con(A_i)
8 e0 |- i9 t" D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d( _1 _4 z. f* @: i" s1 j' B- r
else wait for 10 sec
0 U* y6 j( V r7 Q; L if A_i=A_leave then send to die4 j9 A0 m0 c) U" {6 Z
else inc A_i by 1, M+ \5 m: O: L5 z
end
: y5 @3 x( N. f# wend |
最佳答案
查看完整内容
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,其它按你的 ...
|