|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 \4 }3 C5 v- G# k0 i- V) m' {
+ S) ^4 I, Y9 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 S [" {5 f+ o+ l2 c
/ R4 Q$ R$ s0 J, Y/ }+ S0 o
begin P_read arriving+ g+ L/ b. I$ i1 m+ `$ s
while 1=1 do begin
M2 S' R4 l* [7 w; j8 Q2 X4 G' n read A_tote from "data.txt" with delimiter "\n"
) E0 K( G7 S/ Z2 {* G8 w+ Z read A_time from "data.txt" with delimiter "\n"/ I8 H- Z' n. ?
read A_leave from "data.txt" with delimiter "\n"
- J/ V* u, M8 u# H read A_picks from "data.txt" with delimiter "\n"
. n* Z+ \' W/ P set load type to A_tote% @; d/ m4 X+ M+ R
if A_tote="tote 1" then set A_induct to 1
3 v& M9 E. w, | else if A_tote="tote 2" then set A_induct to 2
% X* l3 Y6 U+ n5 b else set A_induct to 3
! b& L! b2 j$ T set A_i to 05 v2 g8 c! r3 e' ~
clone 1 load to P_induction
) I; P* W9 f; l8 P0 t wait for A_time sec
" @0 f) p: R% O! p$ J, w end
; q3 [8 K6 l1 k9 Z. Q7 fend# E F v0 F/ T: u" ^2 d
8 G( [1 ?' e1 L( e% \
begin P_induction arriving) v9 B; ~6 b0 i! V3 [' F% a% A
if A_induct=1 then clone 1 load to P_pick1
) A7 {, Z) r- |- n# w else if A_induct=2 then clone 1 load to P_pick2
# t X5 {# X/ \* ]/ ^/ _ else clone 1 load to P_pick3
]: I4 D0 R3 L, ~7 L' Oend
' }( V Q& \, Y5 ?# t* V4 p) B( ? I% u( ?* l; o
begin P_pick1 arriving
- T4 L! N4 @' y' I: p6 P set A_i to 14 t: l6 ?+ B2 t8 }5 X
move into Q_induct1
0 D% h3 y+ j) N$ M1 Q- m move into pickaisle.induct1) G& S- B" G8 G# N
while A_i<=30 do begin" ~0 B& [# v: r. ?) b7 |
travel to pickaisle.con(A_i)% n+ I8 [& e' Z0 u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 V# v7 K$ A8 m) y
else wait for 10 sec) N; j @+ f# |3 P4 o/ K
if A_i=A_leave then send to die! T6 M. J! Z. ~4 S2 c7 J
else inc A_i by 1
* i, i" N% L# G& v" t' p end2 j& x j# A7 A7 [" m# g
end
: s7 e$ \" B" {8 T5 T
( o9 e/ ?( H! B% n. ]1 a# {% pbegin P_pick2 arriving
# ]7 z) j W& t' f9 N- {. w. v set A_i to 11
+ [1 Z& d; G# V, V. X; F! o8 M move into Q_induct28 ^% U: ]7 M: |; j9 e
move into pickaisle.induct20 n) U! c/ I' Z( P! |$ e [
while A_i<=30 do begin
0 d0 i2 H1 f( v. B K* w% | j) Q travel to pickaisle.con(A_i)& g+ y; V6 P6 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 a7 k/ \9 P+ }! Q' z, Y% n else wait for 10 sec
, Q# ?: V" a0 y4 u if A_i=A_leave then send to die' j) {; s* y; O' U
else inc A_i by 1
# n I0 a/ o1 u4 v8 P end5 B/ V1 l: O: Q) c' p% c9 @
end$ O' Q5 E( P4 R" b$ ?5 F
9 m; ?+ Y% o' i9 R$ Q
begin P_pick3 arriving
4 q5 b& o/ C( F set A_i to 218 |) n: F$ \9 ^ d; u
move into Q_induct3) a: ^+ F3 a* i+ w2 M# F' q
move into pickaisle.induct3
( S( O0 l9 z- Q. H h; E2 a. g8 R5 B while A_i<=30 do begin
7 l& t% n2 H3 ^$ N" k0 M$ B travel to pickaisle.con(A_i)
& F0 u/ u6 Z2 _2 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 h T- |/ J- ~% P* o
else wait for 10 sec
k/ `7 ]' D8 Z% N% [% A+ H if A_i=A_leave then send to die9 c% ]7 }; ]7 g: _9 Z- B
else inc A_i by 1
0 c+ t" }2 f, U( M1 L8 R end2 Y" b& K0 K! o: ^, 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,其它按你的 ...
|