|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 e R3 P4 ~/ w4 [$ w* @. v
7 P( C! ]' r" ~. C$ s我的问题是,在每个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 j/ Q8 T2 a/ j6 f0 @, M
, h3 z1 h2 N# U, x/ M& Pbegin P_read arriving6 G/ c% m& s( v9 S# |
while 1=1 do begin
$ }+ o6 _: h# p+ `/ W2 R K read A_tote from "data.txt" with delimiter "\n"2 X, l8 c% P, T) K g# O
read A_time from "data.txt" with delimiter "\n"
6 N5 a+ h' C5 y( ` read A_leave from "data.txt" with delimiter "\n"( }6 X6 R( f( Y
read A_picks from "data.txt" with delimiter "\n": v! x9 z/ A, b) x& f2 I' \
set load type to A_tote2 f% Y6 U5 F8 T# R
if A_tote="tote 1" then set A_induct to 1
) l6 f# a; w; W1 \$ ]& W else if A_tote="tote 2" then set A_induct to 2+ [8 M, H' o: I: _
else set A_induct to 3 8 s. \/ `* N1 l
set A_i to 02 Y! p2 r: W$ }: ^0 l
clone 1 load to P_induction
( R9 j6 W6 D* e' L wait for A_time sec5 ?! g3 p V) k' T
end \* G1 c+ ]. N- O$ y" D
end! d; \, v7 Z( g. d7 x
6 T5 G$ D" d: M4 s9 M5 M! Q0 w! }
begin P_induction arriving
% Z9 h' [4 q; U, B# L7 u if A_induct=1 then clone 1 load to P_pick1
4 q; h' u, U. V0 ^0 k" R) } else if A_induct=2 then clone 1 load to P_pick29 N! |8 l7 K# ?1 ]2 f* b" r* E
else clone 1 load to P_pick3! s) t+ q& s9 }' j) k$ k
end
8 a" j- g6 ], k/ L0 d
& r) U% W5 ]: Y1 Bbegin P_pick1 arriving% z1 B) K; j, k) c! p1 |/ g" |5 N
set A_i to 1
" X1 n4 t' Z# | move into Q_induct1; k+ _, t# Q: |) l9 Q0 F
move into pickaisle.induct18 \) x5 w }$ i' a* c! W( a
while A_i<=30 do begin
+ \8 p, x/ T4 x, Q travel to pickaisle.con(A_i)
9 \7 @, ]1 W1 D) {6 y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N: I9 K% A" j* U' X; _% r' S else wait for 10 sec
6 t5 f2 d/ Z" V: e if A_i=A_leave then send to die3 s$ q, f* D/ d, `/ i! ^
else inc A_i by 17 F6 y1 w$ L4 M5 i# |% j% E
end+ k! @, j% Z0 _( A* v7 M
end
* \- a8 s4 Y+ Z# z& ^
, J: ]7 a5 j2 g- ibegin P_pick2 arriving
v+ x$ ?9 G, u/ A% A set A_i to 118 y u( s k: `* P! j
move into Q_induct2
# @6 K* C2 }. N move into pickaisle.induct2
, o% x4 }( c1 g! e- B; W while A_i<=30 do begin
7 b$ R( U) N$ ?$ p, t, F travel to pickaisle.con(A_i)
, |% Q( b" Q) l( Y. I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( M5 d/ s9 D# [; F
else wait for 10 sec
[3 s# N5 s |% E7 |' v$ D if A_i=A_leave then send to die* [: Z' J, {( Y6 S$ a* v/ [* b
else inc A_i by 1" P* D- g1 m& W9 a& x# @
end
% C) L+ a. g# Nend3 J# R' D7 g% P, T$ [9 @
" h: x$ T0 J4 c. T! s4 B; e$ b
begin P_pick3 arriving) ?" K$ v1 Z# |" g9 j! Z2 A9 L$ G
set A_i to 21
1 C s% j2 c; a, L X- c. ^6 _ move into Q_induct3* H1 o, Q8 E1 r4 I/ j, S
move into pickaisle.induct3
8 J3 {" t+ G2 X while A_i<=30 do begin
$ B4 z) D3 R0 n" } travel to pickaisle.con(A_i)5 y1 ], |. I4 H/ U9 v! n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. p2 K8 e# i7 A |) d
else wait for 10 sec: {; R% s4 e4 z
if A_i=A_leave then send to die7 o# t0 L& v- l& K$ g
else inc A_i by 14 v0 S0 V2 _: _ Y1 V5 t4 h
end
9 z# f8 R6 U- i3 D, f; ]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,其它按你的 ...
|