|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 ^0 k8 ]0 n7 ~: P8 i y
, O) \7 g" S- 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中的数值,不知道会不会有什么不妥。% J" Z+ j& q! {: n1 {( q: w! z
) W% K1 L g/ }4 P9 q9 @
begin P_read arriving+ J% f* Q1 M8 d7 W7 I
while 1=1 do begin
+ \, t- t) v+ t read A_tote from "data.txt" with delimiter "\n"1 Q2 y' {- T3 t% e
read A_time from "data.txt" with delimiter "\n"
& h6 C/ E1 [; F6 I read A_leave from "data.txt" with delimiter "\n"& e; H) J5 c4 b( k
read A_picks from "data.txt" with delimiter "\n"
% V& r! d8 S8 k( t& F* P set load type to A_tote
, V7 F5 G: E" o" K$ { if A_tote="tote 1" then set A_induct to 1% G9 ?# D# ~; @0 f
else if A_tote="tote 2" then set A_induct to 2; @$ \$ w/ G0 E# g) p @5 x1 Z
else set A_induct to 3 - d* T8 {0 M6 S% @% F( O
set A_i to 05 q f4 V. k" H5 m% _
clone 1 load to P_induction- [3 C l, `& @" @+ [
wait for A_time sec
1 O A, f! j/ @- J' a) a5 a- q3 h end2 w2 e4 {; }7 [/ F0 p
end9 \" \/ D% _7 M9 G8 o& G8 m
7 b. H$ i& [9 U! C6 G Jbegin P_induction arriving7 y% y& b) A& A/ B
if A_induct=1 then clone 1 load to P_pick1
: |# w3 l6 H2 R else if A_induct=2 then clone 1 load to P_pick26 V$ g# R6 c# w1 d6 h
else clone 1 load to P_pick3
3 P$ V8 G" I- e+ [: Bend2 e* ~" h3 v7 H; y7 K9 C
# F0 ]5 W3 @% K6 S+ Wbegin P_pick1 arriving9 _9 ^8 m2 C/ t! Q6 l. |- P% Q
set A_i to 1
W' {0 X0 N5 D/ f. ]2 \ move into Q_induct1: A: m, d' R. I# U6 {0 c
move into pickaisle.induct1
8 M5 ?5 y) o V1 L% p" M while A_i<=30 do begin( e9 b/ G3 C \" Z, U: ^( N
travel to pickaisle.con(A_i)
& W" U* R- E! z& i2 v! m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ g& w7 i+ ^8 u7 C- d else wait for 10 sec
: W: W( L7 S4 }, U8 l' M if A_i=A_leave then send to die. v' k5 j5 s& r5 q
else inc A_i by 17 [* j* m7 o, r# {/ m
end }: m e# e( O% p% @
end0 R, R& B8 A' ?; }
4 D/ z: y; e7 j! m$ Y, `begin P_pick2 arriving- I ?8 ~! O: ^# ?4 N2 q, [
set A_i to 11
) u# e! q" |0 W$ H move into Q_induct23 W- G* P3 ~- s% M. {$ x3 K
move into pickaisle.induct2
! s9 z3 V* o& s, r8 ~1 I while A_i<=30 do begin# C3 W( R/ P0 N0 u g. P' z/ k
travel to pickaisle.con(A_i)
) l. t' N. Q) w, d7 g7 |6 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 o/ B# [+ P1 J4 G2 N4 ]
else wait for 10 sec
]% y* _) R& l, V7 d T9 w, E& X if A_i=A_leave then send to die
2 u d4 P z: y0 e else inc A_i by 1
) x) Q* F% l7 x% N8 E9 n7 g end
+ X; a5 G) V0 h1 \* w' _end
$ g ~6 Y e8 a0 w+ R, p
2 Z1 J4 o) V; p5 I1 K' @! Qbegin P_pick3 arriving
# I* [/ z. v2 |' h set A_i to 21# P. e4 z) u! P' [
move into Q_induct3
6 U0 b: O4 D; S9 h* L8 L move into pickaisle.induct30 Z8 Z$ {# u2 S9 {& @. {# Q/ X
while A_i<=30 do begin- o3 i0 D" r0 |% T' s- v
travel to pickaisle.con(A_i)
! x S! A* }3 `: Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S# k) e: j3 ~7 z0 I8 G
else wait for 10 sec
2 r) p/ E' a/ v0 g F if A_i=A_leave then send to die
( N, j* P- J( x5 b2 I else inc A_i by 1& X9 I2 O. O% n+ P; d1 Q; ^3 h
end( C8 L+ g3 G# J6 d+ j: r/ M2 o
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,其它按你的 ...
|