|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" ?$ m6 X; D& j; t5 ]6 o( K$ w+ {% o0 j9 c& r9 a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 j+ U" \( z3 z p
. D! [( _7 p% bbegin P_read arriving+ t* P- n/ p ]) }* t/ |
while 1=1 do begin
% Q& M! E7 Q. Q+ a4 V read A_tote from "data.txt" with delimiter "\n"- r, {1 b( W5 b, ]
read A_time from "data.txt" with delimiter "\n"4 h7 Y6 ~/ U R8 R" _
read A_leave from "data.txt" with delimiter "\n". J4 H9 l4 `9 g$ ~
read A_picks from "data.txt" with delimiter "\n"- }( J0 \' M `6 }+ L2 A( S8 x3 c
set load type to A_tote! F2 a1 f; {8 Y/ U7 S0 F( {' S
if A_tote="tote 1" then set A_induct to 1+ ~ b: }& v% B: Z
else if A_tote="tote 2" then set A_induct to 2
4 t" b3 O5 X& Z, u# b. |2 c8 Q else set A_induct to 3 ' }& c$ r' T% U( o+ b/ \
set A_i to 0
# R8 N @" m7 X5 p4 }) o0 N" f clone 1 load to P_induction; b) n% [9 k% J3 u
wait for A_time sec) ^9 y# v' H# X& @8 x/ y/ D
end
# |( _$ N' N* F W6 G) E, @0 rend# Q3 ]" }+ G& }8 d' A' z
# H$ T4 W/ N/ D5 I
begin P_induction arriving6 d: F! f+ b3 a' p, J* Z
if A_induct=1 then clone 1 load to P_pick18 @# R" \7 e( F9 q) A5 }) o
else if A_induct=2 then clone 1 load to P_pick28 ]$ ?: N6 R7 ]9 V5 a
else clone 1 load to P_pick3
6 @9 G9 S x& Z( o5 Fend1 t% j. N: }2 q1 W9 W6 O5 @" i
- {& l! U( m, a' n+ s0 ^0 f7 b0 }begin P_pick1 arriving
( Q' ?; E+ J) k2 C6 Z8 { set A_i to 1+ h0 l3 |, r% E3 W. _4 b
move into Q_induct1
2 x6 F& a# e$ `: r move into pickaisle.induct1! X2 J/ T- ]0 Z2 S
while A_i<=30 do begin) m% \" w& x3 f, k7 \: D; ^
travel to pickaisle.con(A_i)
$ i/ a% s: V$ Z9 c; {2 d& F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) }; [, C1 |) m
else wait for 10 sec
. e1 D/ c: v- K if A_i=A_leave then send to die# x# Y1 T, _& s8 Z$ p
else inc A_i by 1* I8 ~0 e: g+ L/ ~5 x9 C1 @* N
end
# j, `0 e% v# W- c& `* Uend
& k' ?' i' p5 g& k7 p* y, ]8 j5 A/ f, T
begin P_pick2 arriving9 h6 R# C- M ^, z
set A_i to 11% m# H6 C& x$ l) C- Z0 k3 R
move into Q_induct2) c* a' [9 [6 \4 f
move into pickaisle.induct2( f" ~+ O& Y( e* t" p
while A_i<=30 do begin b: p/ t" O+ t; { }
travel to pickaisle.con(A_i)
4 k" R4 e' c8 v6 [8 C5 d1 H8 _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 m# u# _5 C9 Y9 f7 J0 l, n! \
else wait for 10 sec
0 q2 ?% @2 j" g1 D if A_i=A_leave then send to die5 B7 i$ a0 |* m1 }% \! `
else inc A_i by 1
" _% y$ H8 c4 X9 |) ?% X end
& |2 Z* @# u' I: d4 E" I7 nend6 u( F4 r8 w4 D# j
' ]) Y/ x6 I7 k/ N
begin P_pick3 arriving
4 _* A( x V3 _9 n set A_i to 21" {# p5 `4 f* C; Y: ^6 k) O: n
move into Q_induct3" e! x: I+ s$ {- |1 n, q
move into pickaisle.induct3+ k2 ~/ o% T+ W* v& j
while A_i<=30 do begin; t. E2 l) D* o) w( W3 {' b
travel to pickaisle.con(A_i)8 k1 V7 {, w4 V+ a N" Y( l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 W; P+ I) p1 s, { else wait for 10 sec
8 ?$ c- [$ C7 }9 w if A_i=A_leave then send to die3 K t( H& C1 x% e5 l8 t0 c
else inc A_i by 1
& l t- ]9 z t0 o1 w8 V end# ?& Y# t. b7 _2 x
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,其它按你的 ...
|