|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- H) m, R V8 t/ p3 }$ }
: G$ n* {" [3 {) Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。- ?3 y& i1 w/ s! q# M
6 e8 N: e# H$ {( z$ f( M; Y
begin P_read arriving- m$ C, I' N3 T( g- b: l5 }' S* P- n2 j
while 1=1 do begin0 ]6 v4 e" D7 m/ f6 w% W
read A_tote from "data.txt" with delimiter "\n"
1 U. }0 G: o% |, Q6 n! L' V/ G& [' U read A_time from "data.txt" with delimiter "\n"
$ s( M9 m% P3 n: V4 E* P5 z read A_leave from "data.txt" with delimiter "\n"
2 U. o# W3 z6 Q' {' e- u6 G read A_picks from "data.txt" with delimiter "\n". ~" b+ K4 h7 [. [
set load type to A_tote
6 c# C* v0 m1 d C5 Y if A_tote="tote 1" then set A_induct to 1
9 m% l% y9 W T a+ [; b! M2 ]! v else if A_tote="tote 2" then set A_induct to 2
5 m1 } H `/ W' Y+ x/ l n0 \; x; t else set A_induct to 3 5 \4 \5 b& z; J7 ^- p8 L, N
set A_i to 0" w' ?5 C) l5 G4 [
clone 1 load to P_induction. W1 V9 W: m6 f" A" D
wait for A_time sec% w, T( j; ~' v8 h) a' |+ l2 ^7 {
end
) V, V: x# m, q$ Y$ e7 _4 \7 lend
* k- ^6 p$ u* d* }) j$ ]" o
' l6 R. \8 s) A3 i* {/ [- k( I8 D4 \begin P_induction arriving
+ ? |8 V& j/ E$ q' @( A; Q2 R if A_induct=1 then clone 1 load to P_pick1
* d# O1 c) x! p' y" F, o D else if A_induct=2 then clone 1 load to P_pick2
5 R! `" d; _6 m) h3 k* j# H else clone 1 load to P_pick3
* S, C) Z- I6 R- Wend/ o( K9 v' P# R
* Z$ L5 x, a* [ L6 q" hbegin P_pick1 arriving* @( J7 r5 D, Z8 O ]
set A_i to 11 P5 S: O4 k4 ?
move into Q_induct1
V1 `: s* |7 u5 p move into pickaisle.induct1. Y$ L8 Z4 f0 Z. G; e
while A_i<=30 do begin) z# K3 ~/ T% F$ M
travel to pickaisle.con(A_i) c( A3 ?8 M8 _9 U H- ?% C2 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 X/ G. Y$ f8 C" M6 L else wait for 10 sec
$ J* p$ Z7 z A( E7 u# \$ h, X if A_i=A_leave then send to die. k, O" N: P# e0 Z( L
else inc A_i by 18 ~3 _. K! O+ t+ |2 u2 N; u) a
end# E5 F: f4 r' w' ^
end
5 S$ Y! X0 b$ T9 }. A0 h6 l; S8 Y3 l9 r+ N1 u% `
begin P_pick2 arriving
+ g% z$ o0 a$ N' r/ C' m set A_i to 117 J8 d0 w' ?4 h
move into Q_induct2; v* k6 ~( d5 U) H
move into pickaisle.induct2
1 H( @# d) z" `4 w9 G- D8 U" t while A_i<=30 do begin
6 d4 ^' f# {4 {) W2 n& X+ I) s travel to pickaisle.con(A_i)) d! Q7 x: V( |9 \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec m$ P, Z7 ? W! l: q4 n. m% n! f
else wait for 10 sec+ X; u7 M( B5 u# t h1 Y0 Y
if A_i=A_leave then send to die/ \* M# l6 ?6 p) M' a7 |; g
else inc A_i by 1& s; I- y5 s# G
end
# p: L) v( c. bend2 C( W: n& o* l( `
$ j# f# X* Z# A1 |; A$ d. Vbegin P_pick3 arriving
2 y, J- r% o; b/ r3 M set A_i to 210 w' t5 i3 @# D/ h& k
move into Q_induct3* B3 t2 q0 H$ R
move into pickaisle.induct3( Z) i8 Q( M1 _7 i. Y7 M+ Q& ^
while A_i<=30 do begin5 \& b) P; Y- N4 ^% Q5 `
travel to pickaisle.con(A_i)5 W4 m& ^& J+ a4 \! i0 {# j4 M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. o- F5 t' P+ ^7 ` else wait for 10 sec
4 F2 N5 @4 k! z( n$ m if A_i=A_leave then send to die2 C7 r8 j1 p! \+ ^" t8 Z
else inc A_i by 1
F: {8 }2 ` e8 Q end
! z* _' t+ @5 z0 k' [1 Send |
最佳答案
查看完整内容
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,其它按你的 ...
|