设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11786|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 N" q" Z; S1 Z; k
$ g$ c% U: Y) s+ j4 X+ g: f: 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中的数值,不知道会不会有什么不妥。1 W3 \: t2 a, H4 {/ I+ ?; I3 A5 m
( m* o" Z- x2 ]( X6 v
begin P_read arriving
4 k* F1 Q1 n* _' m) T  F    while 1=1 do begin; o5 O5 i& F( N6 N6 b
        read A_tote from "data.txt" with delimiter "\n"
" F4 _/ k) ?4 z        read A_time from "data.txt" with delimiter "\n"
/ I8 G/ @8 f0 i, X        read A_leave from "data.txt" with delimiter "\n"7 ]/ r7 l$ L1 p) b% z8 U
        read A_picks from "data.txt" with delimiter "\n"
3 T1 B0 k0 x5 r  I        set load type to A_tote; `5 H- ~, _0 O5 r  Q
        if A_tote="tote 1" then set A_induct to 1
  r* R) n$ m( n3 g8 D        else if A_tote="tote 2" then set A_induct to 2' h( f8 [* c3 x. o$ y8 O2 k4 N5 v  H
            else set A_induct to 3    ! F$ c: U, X1 _+ N7 k
        set A_i to 0& \. n# @, ]/ D: n
        clone 1 load to P_induction
, E$ j3 l/ j& c        wait for A_time sec8 U4 I6 p: {- f% }
    end
' h: j- r5 d, O  P% V* F+ nend
% i- ~; P- W' s" `* A3 e. S* u" `/ D2 S6 b2 P: a8 G/ d
begin P_induction arriving
! E9 u# [0 |- b8 y, J    if A_induct=1 then clone 1 load to P_pick1: o( O* `* b/ F: F
    else if A_induct=2 then clone 1 load to P_pick2
8 G  [3 ?9 m7 l2 K! d! I7 q5 C5 ~/ \        else clone 1 load to P_pick3
+ b7 ]$ d1 R* B: @4 B* M: ?end
8 g3 B/ r' V9 S+ r# X) b# F: H3 Y6 i& ]* ^( N
begin P_pick1 arriving' q% E9 H. m8 f  A
    set A_i to 18 n4 I. G5 z8 X  J% L/ F; e0 W
    move into Q_induct17 {8 d$ Y# q$ A) E
    move into pickaisle.induct1" E5 T: {' B7 M: i
    while A_i<=30 do begin
* W9 G+ I) N/ }; w! s        travel to pickaisle.con(A_i)
3 N4 f) N  s: g% U6 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! I- c2 M( q+ Z# m/ @! B9 o4 E2 P. C
        else wait for 10 sec4 ]% @/ o+ R: ^, `5 e
        if A_i=A_leave then send to die
# M3 `6 B2 j7 c3 L- N  M; B* q& V, k        else inc A_i by 1" [/ K8 T% m6 g2 ]$ m9 T) R$ z
    end
+ f: O" l3 p' t' {5 J( Tend
) g# F7 J0 n; x; N3 X5 i3 Y( f8 J0 ~4 e; U4 Q
begin P_pick2 arriving
8 I, [% C5 m0 M; q, ]$ E0 K    set A_i to 113 u6 L. I( ?7 L
    move into Q_induct21 m, T4 D, T: O' T8 B' q* A
    move into pickaisle.induct24 {- F* U* Y% h7 v* ]  O8 ?7 Y6 G
    while A_i<=30 do begin* ^7 X8 t( O: C. P, s
        travel to pickaisle.con(A_i)
( e$ }, V, p0 d  K3 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X2 E% w7 ^5 X; D        else wait for 10 sec$ p6 v) @5 K6 z8 f0 v, F: Y# W
        if A_i=A_leave then send to die# e  ]4 \& c9 q0 w- u/ ?8 M
        else inc A_i by 1" d! ]) V9 J+ W- h! L4 t
    end
9 h, |( G4 [. G; i) gend0 S. h/ B. d! I" @
0 g6 q; T( x) Y
begin P_pick3 arriving
- t; E( j$ m0 x. R( ]    set A_i to 21
0 V2 }+ I9 s5 m, V/ C( l, ~    move into Q_induct3+ H! v7 Y# |. Z  Z
    move into pickaisle.induct36 |; `. e- Z# |$ v
    while A_i<=30 do begin8 F- ~5 w0 O3 X9 s/ V' R
        travel to pickaisle.con(A_i)
) c4 I! W2 X( B) O/ W* \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ q% h, _! F* H. R4 ~8 K
        else wait for 10 sec
. H2 X' F+ |, s  ^! S        if A_i=A_leave then send to die# w6 D# o: z. @9 Z, f3 p
        else inc A_i by 1
1 F8 A2 t# K  i# u1 T    end
% R& Z  y% M- {7 @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,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?: m0 I: a1 m- y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ ?& o; W6 A4 ]  }$ c

! B1 x* [$ X6 m5 J& KAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ f& S! C6 b; Z: ~2 x

6 t4 F1 p$ d; [9 k9 z+ q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& M, N# \( e# Z& s+ F5 v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  _7 o) h1 q6 h9 c& u% D# a) E* q* T7 h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 i) b& g: g+ y9 J% O8 O3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 x" U- c1 \$ t1 x3 Obegin P_induction arriving2 Q& I# o; f: y- l
    clone 1 load to P_pick(A_induct)  Z' m2 u$ l* {. u0 ~# X
end最大的系6 P+ J% H: n" t* g# h

% M1 b5 f5 Y$ d( W% P" Mbegin P_pick arriving3 |8 H, o4 g/ ~, B% v' }  c
    set A_i to procindex * 10 + 1# |0 s% C5 y7 ^; x" e9 ?4 K
    move into Q_induct(procindex)4 _+ L# j9 L: t- k6 n
    move into pickaisle.induct(procindex)
$ A+ w8 j" W% g/ w. O3 `* r    /*check the type of pickaisle.induct(i), for your last problem.*/
- A# X( t" D  x0 q& O/ m7 {. u
# l# v& y1 z1 x% O    while A_i<=30 do begin
0 [  \: @( k( ]# v4 S" S5 [7 L        travel to pickaisle.con(A_i)
  ?+ e5 y% N5 v4 _& B4 i5 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ~# c  c/ p1 ^+ V# f8 k2 J        else wait for 10 sec
; I/ t- m" }2 V+ V        if A_i=A_leave then send to die  ~5 d4 _- }5 }% B- E! Y
        else inc A_i by 1( c1 X7 e- A$ n) h- S4 a8 W4 u
    end" }9 Z5 R/ _# m3 A' X) M+ Y: S
end% S* d6 {% [/ v2 P

* T2 F  k: }, f) l8 ^% t! Z其中的procindex为整形,代表当前process的序号。
" d* |- M/ M% ]( E# fstation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2025-12-5 09:08 , Processed in 0.018509 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表