|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) j. _7 {& T( F7 S$ F8 |
; m H( q- M, s9 U我的问题是,在每个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中的数值,不知道会不会有什么不妥。. a. V" |+ x, M) W
, t P6 w! T' f# V+ {& a0 V' F8 \begin P_read arriving
! w: ~4 {) `+ b6 q7 N9 B8 Z5 N: F2 Q while 1=1 do begin
0 l0 q( O0 m3 K% \0 P* R! a read A_tote from "data.txt" with delimiter "\n"! q, C4 s7 O- n0 ^/ t' v
read A_time from "data.txt" with delimiter "\n"* M5 ]/ A& |4 c
read A_leave from "data.txt" with delimiter "\n"
; J% R) L4 p( P0 p4 I: e/ X read A_picks from "data.txt" with delimiter "\n"
3 w) H0 U/ ^0 B- b& _, @ set load type to A_tote
3 a3 O* S% J1 ?. }0 y" x+ D if A_tote="tote 1" then set A_induct to 1( [ a) a) E; ?- H9 }7 e# O1 v
else if A_tote="tote 2" then set A_induct to 2
+ V8 o3 Y: D4 \& _, E$ |& F3 ~ else set A_induct to 3
9 q1 j0 @6 E1 w; X set A_i to 0
# K+ l. z$ ]7 ?3 u0 [* A clone 1 load to P_induction
" `3 ^( ]2 @+ [+ d+ [$ e wait for A_time sec
a$ |" w$ [% G; v end
+ g3 W2 w l+ Iend
/ y6 s P; w4 e0 m- m. k6 N. G4 Z$ c3 {3 r: a& R+ A2 G
begin P_induction arriving! H0 I1 A" B( Q9 @$ l
if A_induct=1 then clone 1 load to P_pick1
2 j$ J1 E- S/ T else if A_induct=2 then clone 1 load to P_pick2
/ N6 h! W1 r1 T& a: p+ g3 Y' v else clone 1 load to P_pick35 I% F" i0 c6 m
end
b- p; Q3 w' P* F# E) K* g+ t# g- i, J, j# N. C
begin P_pick1 arriving
& e% ?/ U" b4 p9 y9 T8 m set A_i to 1: y" Z+ v" H& z; ^: l
move into Q_induct1+ @0 n& D1 H* t
move into pickaisle.induct1
4 o$ l; D w( |% G" n5 t! p+ i; J6 S while A_i<=30 do begin
' f2 T: P& w* f& l/ E travel to pickaisle.con(A_i)
+ O& m( W# e! N5 E K( `/ S O0 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ^& u1 j) Y: t4 G
else wait for 10 sec
& i$ y1 Y, d7 V7 k1 ~7 H if A_i=A_leave then send to die
, @- J. {- p; x/ |" M/ {, n else inc A_i by 1
3 B8 \' J$ T- v' \* ?5 x end
6 D& h% W q/ F& `end
% G/ h/ [; s- }
3 K8 ~9 R9 B- r2 ?* Obegin P_pick2 arriving
& \8 i8 S B) \) r' g$ ] set A_i to 11+ Z) F" }* D8 v. r) V" K8 s9 g5 z
move into Q_induct2" j* E- ? c2 }
move into pickaisle.induct2
" \" j& r- J. t5 t: h( s. e while A_i<=30 do begin8 C8 z" z6 {" S3 {; }7 D
travel to pickaisle.con(A_i)
W- I" d! K. K) [! O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! v, z. r# h1 G
else wait for 10 sec
' `- l+ J R9 N( g! r2 ` if A_i=A_leave then send to die* e. ?, r; }0 J$ Q& p- P4 N
else inc A_i by 1
( L! a+ T8 w1 q, O- x end% R* }7 J8 @" A
end
( a$ P& z' l& z# I. v& A1 z; }! e" x
begin P_pick3 arriving4 L9 @( b1 k" f/ u- W! L
set A_i to 217 w8 t( I! b9 F2 m1 H
move into Q_induct3
5 ^1 `: c6 q! a7 _2 K move into pickaisle.induct39 ~$ j- H! d: k: Q( u& Z, k
while A_i<=30 do begin- B! a/ G, w; }/ O9 ]( i( ]
travel to pickaisle.con(A_i)+ y% I, v; P& A9 D0 w% E* X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& X6 {0 O5 K! p1 G else wait for 10 sec
$ @- n0 U8 l( w) R2 \ if A_i=A_leave then send to die! r5 l1 N' Q/ h2 r* h |! p0 ~4 G' I2 f
else inc A_i by 17 n4 R+ h+ F! n) k0 m- \9 c- y
end E. \( v7 \' v7 k, h) v; F
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,其它按你的 ...
|