|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) o% G- _( e" B6 m7 C; b) ?
+ _7 T# @' Y+ 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中的数值,不知道会不会有什么不妥。% i$ D& X1 f; ?
3 S. r! [* C2 I$ b! A! e* B- jbegin P_read arriving* A% I. ^6 M7 c/ ] z+ w
while 1=1 do begin; c$ P6 k# H2 R, d+ s# `3 y2 z" A
read A_tote from "data.txt" with delimiter "\n"
3 b/ h( p# i: w; }7 A+ q( o read A_time from "data.txt" with delimiter "\n": H& H- |4 x5 J) u& X' `. V
read A_leave from "data.txt" with delimiter "\n"
3 G5 ^' W- A: H read A_picks from "data.txt" with delimiter "\n"$ I/ z2 q& E/ Y: ^/ ?0 K- j
set load type to A_tote9 }- T& H' C4 Y" q0 u
if A_tote="tote 1" then set A_induct to 1
1 {- x; E' A/ Y- |3 l5 M else if A_tote="tote 2" then set A_induct to 2$ J+ W! Q* c4 t4 c) }1 y% ?! N! h
else set A_induct to 3 ' ^/ O; F$ c% K! F3 d/ t
set A_i to 0% s* K; d* R( l. w3 w9 P
clone 1 load to P_induction0 s" f0 m7 R3 T4 d; ?+ y& o$ t6 ]& b
wait for A_time sec: L- {7 n' s4 e6 X; ?
end
- M7 [# n5 r& b# P- g7 zend9 R' O7 y! F* I% l# B
+ Y# {$ Q2 O8 j1 Y0 G$ F- D& ibegin P_induction arriving$ n" R8 n' K/ q; P3 _ H
if A_induct=1 then clone 1 load to P_pick1' l# @6 f& A; P1 F/ r* \( v
else if A_induct=2 then clone 1 load to P_pick2+ z7 ~4 q# I; _+ d: {
else clone 1 load to P_pick3
# h# Z: n; q$ D1 E3 c& c1 g2 Qend: ^, ~6 q: a) q, H
3 Z% W! S% }) j0 T0 G5 Gbegin P_pick1 arriving
1 V- Y- c9 l3 G. G; y: o" h( i+ E( ` set A_i to 1
' t* l) w' W8 {6 R) ^ move into Q_induct1
& y% A6 r0 u# _1 b3 d/ q move into pickaisle.induct1
2 G7 P0 Q5 Y( u" h( c while A_i<=30 do begin
( E( y+ E7 ~3 l; Y6 ` travel to pickaisle.con(A_i)
+ s! c+ |: f$ r- Q. j) W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 V" i1 W. o6 F: W" _( J else wait for 10 sec
/ ` @7 \: k+ p w3 O if A_i=A_leave then send to die6 n) x" V0 }: X" N+ Z0 x
else inc A_i by 12 _1 w8 P7 V: A9 b
end
9 E1 |! P4 n5 Q- J4 K0 [end( j8 {. p( O" v/ e' x& W/ c
7 D/ z. `; g* S/ a8 dbegin P_pick2 arriving0 i" w7 z% _! ^/ i3 r, `, ]
set A_i to 11
& ~2 g; U4 a$ }# s. }0 y move into Q_induct26 U W# b9 j8 u* b7 O% N6 R
move into pickaisle.induct23 ~3 y( o9 G/ e- e; h( v1 e9 _
while A_i<=30 do begin+ k5 F6 j! C; _
travel to pickaisle.con(A_i)1 U9 [8 u- R' V$ m% O2 w Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Z2 w* A m& C
else wait for 10 sec
' K2 V; a2 X% T if A_i=A_leave then send to die
+ |1 e+ K, S+ r7 V5 r% S else inc A_i by 1: I; o i( i. s6 K* R
end
; h6 _ t7 }# Q0 e6 Z9 tend: {" Z( ~6 h7 E {. M* L* F, m X
/ R; B/ D3 q- F: v. \$ l) `
begin P_pick3 arriving
% W' {3 s, ?; f3 A set A_i to 21
* B% A n" d0 M move into Q_induct3
2 s( j3 @. [+ s+ N* d move into pickaisle.induct3( C `0 e. ~1 _5 [
while A_i<=30 do begin
f, H) e' r! T9 b1 F$ N travel to pickaisle.con(A_i)9 w- z+ m* d9 S; T5 K$ H7 B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 F& X" ~& p9 j# f7 W+ L7 k! G else wait for 10 sec
1 ~8 ~' Z# V) ?. z4 ~: t9 w4 z if A_i=A_leave then send to die# V+ V3 x- K$ q3 m% Z* R
else inc A_i by 1
) Z1 a6 f# e5 f) c end$ o9 j5 I! S* e6 ^
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,其它按你的 ...
|