|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 S' ]8 | t* W* Y6 E# j+ A
[% q& u& _) @; k% o; d
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% T& B" }; k8 ]1 l
4 E, I, u6 t- [5 L5 Cbegin P_read arriving
0 i2 X/ ^% B, p6 S while 1=1 do begin! V+ Z% C" j4 W9 {9 h S
read A_tote from "data.txt" with delimiter "\n"6 ~1 |8 Y/ ?" R) |! M9 d
read A_time from "data.txt" with delimiter "\n"
% z( P0 D' e' z& V' v( x! l read A_leave from "data.txt" with delimiter "\n"; {5 Y6 l7 \% l) h X% ~& O7 ]
read A_picks from "data.txt" with delimiter "\n"! x4 K# C( Y, ^# _ p
set load type to A_tote3 p( F& k, i5 l5 g
if A_tote="tote 1" then set A_induct to 1: c5 N4 f" Y5 D6 E# @7 P
else if A_tote="tote 2" then set A_induct to 2! _ z. o5 U+ I$ \% t
else set A_induct to 3 ; A) k9 ~3 E# x7 d a
set A_i to 0
( v) x7 \0 p8 y" E& u clone 1 load to P_induction
2 ~2 Q1 t8 H, M# U' t. U wait for A_time sec9 u- o3 R9 n; I) ?
end
7 p1 y# D$ S1 L$ uend
* d: U% X4 L \* C. [1 ^7 V, U
6 N' N9 y; t, K, ^3 ]begin P_induction arriving
# [) q1 {! W# S9 ^: i0 G if A_induct=1 then clone 1 load to P_pick1 l& I6 Z) V& Y ~9 m
else if A_induct=2 then clone 1 load to P_pick2: u7 \% ~! a+ D+ w' v- h* d
else clone 1 load to P_pick3
* r- u! Z% s$ u% Mend* e3 Q- [0 k9 e' _+ X. L
# U1 b/ |1 Q1 t+ mbegin P_pick1 arriving
) [- x2 v% m6 R- u7 U* Y set A_i to 15 r0 N8 l+ m! K! m" i' L+ {
move into Q_induct1* B, ?( H+ `* p% y/ E# P
move into pickaisle.induct1
, t3 [: i: K2 W/ F7 z1 f9 `: u while A_i<=30 do begin
: l2 l2 `& V x/ q2 `, ~6 ^3 i% z travel to pickaisle.con(A_i)7 r4 j$ T% L- O7 n( a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 D+ e! C5 Z# _9 a( C$ j% P else wait for 10 sec
0 r% X5 N+ N2 V `" L5 R if A_i=A_leave then send to die6 O$ i, x8 F% e
else inc A_i by 11 B& | F2 b* |5 B2 r6 E0 r- |! H
end9 Y. S. J1 e4 I- \, M
end. G/ P) O4 \1 S1 j' \, t8 H
[ Z+ a& L9 d O0 r: Q: [
begin P_pick2 arriving, X. D" P4 R8 E( a: B
set A_i to 11
( B# T% k+ J1 O& r2 _6 m move into Q_induct2
' u1 r( U7 Z$ ?* t6 Y9 \4 Q2 u+ g R move into pickaisle.induct2
7 z; [8 w$ M# J4 V9 l3 Y while A_i<=30 do begin
6 S* Q8 y9 u, Q/ S5 Q) y7 ^( ^! d travel to pickaisle.con(A_i)
4 f" p- B4 t% r7 d3 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. C W) W1 C, x0 a% a else wait for 10 sec8 Z0 Y: K3 t: B. [# N* ^
if A_i=A_leave then send to die
$ [4 x6 a% C5 }- B- ^* h else inc A_i by 1
$ j0 V# K5 `4 u6 F end
. O- W) n L& x" Dend
8 Q" Z) w3 e# W. ~) N/ w
+ g. R, L- H; E8 J' \ A! Mbegin P_pick3 arriving
2 M7 [) |1 ~3 }! L M set A_i to 215 z3 Z# t. m: k, O: ]
move into Q_induct3
1 K/ y1 [6 I1 r7 G7 N0 U move into pickaisle.induct3
; D$ K, T$ g" [* F3 W while A_i<=30 do begin# z+ y9 h1 ~2 Y/ h t: D/ |
travel to pickaisle.con(A_i)
R2 B2 k2 V/ Y. I+ R: q$ K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" q2 [/ p# ?# ~) g* k$ |; b
else wait for 10 sec0 q8 I- [7 A+ k
if A_i=A_leave then send to die) h8 E9 [, h0 b. a8 F f
else inc A_i by 1" G* Z/ c# K% [* S) d
end
9 E5 I/ j- ]+ u( j, T; \' Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|