|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* i9 h' @& z& M9 x2 K* y
: q8 N& X( a. d; w- H9 c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 e/ k. B7 P& c
( t0 R" I4 v! a; ~* pbegin P_read arriving
, U/ }$ Z1 }5 H6 r4 p while 1=1 do begin/ T& i, g* o Y+ U- w* q
read A_tote from "data.txt" with delimiter "\n"9 ?1 V/ k; \+ o$ Y, o
read A_time from "data.txt" with delimiter "\n"
+ M! l5 @' L( q U& v read A_leave from "data.txt" with delimiter "\n"
9 [8 x8 \' G2 r7 ~ read A_picks from "data.txt" with delimiter "\n") l. A6 X- m; a$ l
set load type to A_tote" U: w+ _4 R- h
if A_tote="tote 1" then set A_induct to 1
7 [3 o0 K4 g- y1 G+ Z" v else if A_tote="tote 2" then set A_induct to 2
! `( `% F4 W8 r) d) e) T! ^ else set A_induct to 3
8 \, t* W4 z: I: K$ N+ O9 E8 r$ X set A_i to 0
8 V4 {$ _( L. S& ?# o# O clone 1 load to P_induction# F- F5 j7 W6 A: I/ i) y. Y; } r
wait for A_time sec# @% ?4 L& [- d9 @' H* `
end
8 X7 Q$ d% l5 P: Cend4 ^- |( L9 s4 A) X1 g
8 `: G6 @. q6 D; N. i4 y9 d5 Jbegin P_induction arriving
" @2 u% q+ ]! ~& B* ? if A_induct=1 then clone 1 load to P_pick1
3 h" u+ Y) t. K2 g2 ?9 Y, g% S# A else if A_induct=2 then clone 1 load to P_pick22 B; C9 U K& }0 m" j
else clone 1 load to P_pick3( [' G# W: { O9 d7 S! I) r
end
% v& d# o1 y: z7 ^* H4 m1 ?* m5 Y; m, T
begin P_pick1 arriving6 }; F2 l0 ~1 y
set A_i to 13 v' Z1 G# f$ b& C& _0 L
move into Q_induct1* R9 E+ a# P0 x0 D# v- \ m
move into pickaisle.induct1
" [' T4 z- `0 ?% L: y! @ T while A_i<=30 do begin) U* M( ^8 w O4 X9 H1 D3 @) I5 N
travel to pickaisle.con(A_i)1 \$ b- J" {* G9 t( R/ ^" M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% k5 H0 A! Z8 ~# o else wait for 10 sec1 P E; [0 r2 j% A
if A_i=A_leave then send to die6 x8 g" K+ m" U
else inc A_i by 19 ?$ O8 ]- ]9 a% y
end
& y2 g/ W. V9 g6 S+ A, Uend
) p' v$ V( z v) z r7 L" ?, ^8 M
" ~0 V7 R/ {/ Wbegin P_pick2 arriving. Y& q, b6 `( w* P5 Q
set A_i to 11
' V, h, A1 d) O1 F' p! L7 e0 C move into Q_induct2
+ }+ Z' a+ J" C& k+ [ move into pickaisle.induct2
; |. c! E9 z1 Z/ a$ | Q while A_i<=30 do begin6 l$ [: W0 f! }! t! P& Z
travel to pickaisle.con(A_i)
7 m4 ^4 `9 D' D9 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
T" J R5 ~: {4 g+ y else wait for 10 sec% `7 \# r3 g3 V5 b7 I& v1 j
if A_i=A_leave then send to die6 j# a- f4 m4 d& |
else inc A_i by 1* [. F' N! d& H# R
end, q% g( j4 i) ]$ ^$ N: X8 I1 x' |
end
+ D9 y; f( @- y% ~
& B" B2 P& b o; abegin P_pick3 arriving$ X8 |# w' D- [% c! U e
set A_i to 21
$ [9 U( |* N ~, p! b7 J move into Q_induct3
4 B. X, n3 _; [: A8 G move into pickaisle.induct3' c) r' C6 B) t1 R
while A_i<=30 do begin
) U! t7 }+ }2 e ?0 m, {* x. f travel to pickaisle.con(A_i)
& }1 a% V& p9 r6 E9 H4 \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- d2 n3 ?& m- Y6 Z2 v+ \
else wait for 10 sec
) @# s; c3 C7 F) \$ n4 E% Y if A_i=A_leave then send to die8 Z$ f! c+ f! ~* k, h+ p
else inc A_i by 1 b! d% D. r7 z% ~* s" C
end$ \- R* c! t* ]
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,其它按你的 ...
|