设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13916|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: e% x3 |- H0 m& T
+ Q0 r7 e( R: @; ^  A% r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 M) D5 s# f# ]# \$ z+ N
* Z, ^8 |6 P& {$ A/ Gbegin P_read arriving* u  Z. C# r' a* V# w
    while 1=1 do begin
( t" v# _! \3 M( p        read A_tote from "data.txt" with delimiter "\n"
/ y" B2 @" D% p        read A_time from "data.txt" with delimiter "\n"9 d6 d8 N9 L% b& |: \6 p
        read A_leave from "data.txt" with delimiter "\n"2 M! L6 g1 D8 ?9 Y- h
        read A_picks from "data.txt" with delimiter "\n"4 k6 Z$ l1 ?- B9 c' T
        set load type to A_tote- |2 ]2 L$ T) e+ T5 W# l
        if A_tote="tote 1" then set A_induct to 1: Z: k$ z. v5 \$ s* ?
        else if A_tote="tote 2" then set A_induct to 2% e, c- w1 y, a
            else set A_induct to 3    ) f3 }3 `: e2 `
        set A_i to 0. \$ ~7 l& j2 S' Z
        clone 1 load to P_induction0 t7 j7 @6 M' x# Q, K
        wait for A_time sec1 t8 O% G3 z0 z* K
    end
5 m5 R5 ?5 |) aend( R$ S" y: |) v8 L/ W( G: L
2 }& u0 k$ @: o- M2 @
begin P_induction arriving- V9 J$ ~3 k5 F1 ]
    if A_induct=1 then clone 1 load to P_pick1
7 x7 E# Y2 ~  \8 n: `8 z    else if A_induct=2 then clone 1 load to P_pick22 g4 h  |% I. K! |2 p9 ~, M1 g
        else clone 1 load to P_pick38 G, V4 L  B  u  ]
end- d1 z+ t- D5 X$ Y
( n" _* r3 }- x7 x9 T0 ^/ h
begin P_pick1 arriving
; f5 }6 v$ y: B3 \% T    set A_i to 1- n, _. A9 j( K6 o; L  S
    move into Q_induct1
9 W, D" H" w; J9 i% j( L7 D) {( w+ t    move into pickaisle.induct1
. a+ y" Q. P/ r3 e) F    while A_i<=30 do begin
7 R# [+ D- _2 u" q' n' c/ V; N6 p        travel to pickaisle.con(A_i)1 U! k9 f  G4 v. _6 H8 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 K$ C/ s" f! W% p
        else wait for 10 sec
, q) n& d  N+ {8 t. g. p9 }        if A_i=A_leave then send to die# ^9 S! m- S' g7 I) a; B
        else inc A_i by 1
* D0 Q) X; `0 W7 j7 f' M    end
8 P7 v) }7 J) T7 Q# {6 Lend
4 B9 f: Y" P& y3 d: w( K
. _. c5 ]( D0 H7 z9 l" H! Gbegin P_pick2 arriving! ]2 H7 X) {- H; Z
    set A_i to 11! o( C# ~) T3 X
    move into Q_induct2
+ W, \0 c! `) P    move into pickaisle.induct2/ E, s& ]/ E8 c! U9 X( m- h6 \7 a
    while A_i<=30 do begin! ?. {- q: z3 S6 r2 K* c  f+ o/ `8 W
        travel to pickaisle.con(A_i)
" l3 o& }3 t$ J& F. @1 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. A& m  O- o4 }# q        else wait for 10 sec
5 Q, B  X" d! ?8 s* R/ Q9 ]        if A_i=A_leave then send to die
) p7 {2 c+ M/ k) C  t' C4 z        else inc A_i by 14 O2 d# H6 n1 M$ m$ a, P6 T* y
    end
7 N# k5 \# E# F: B) m) ]end0 ~6 }' I) y/ p! D5 x

' E  i" z& \; H! h8 e* Ybegin P_pick3 arriving7 O# k& n. C  [3 W- H3 b: b
    set A_i to 21! f% }( d  m- S7 w; i: M
    move into Q_induct3
  C* @+ X$ T1 Y. @, ?$ P    move into pickaisle.induct3- J  {3 F2 [, x8 T4 v1 L7 D# [
    while A_i<=30 do begin& g8 e* g# K2 I0 O- G: V
        travel to pickaisle.con(A_i)* j) [+ C4 ^" Y, \8 ], _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! k/ p5 L; l0 X) L7 b) w        else wait for 10 sec
! ^- x! p: \. C2 B1 E        if A_i=A_leave then send to die
- W* Z1 F. A1 j6 H( a/ e        else inc A_i by 1
$ s- |8 n4 X) D/ k    end/ V6 D7 Q* b$ X3 d, 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,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
6 c2 Y. Y9 V4 a6 F3 x& |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* V9 o. k+ c+ M6 B3 {8 a; z
8 W' v# s% L) k# a+ G! V' Q. F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# ]1 X: H$ J1 b0 O% z+ z
9 z1 h3 x8 E2 I. y+ d8 T7 P另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! ]  K9 F. l- s& R9 p/ N+ A! X
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 O! h( W6 q7 ]  U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( q  d5 Z6 j% C4 V8 X( S. k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 s: ?# k( @6 d; |4 d
begin P_induction arriving
; k2 O& V( v5 z, a5 J    clone 1 load to P_pick(A_induct)
3 l* i4 H! h# r8 rend最大的系
/ x% ]% E% J9 d6 D9 h
& y! r* Z, M' J5 Rbegin P_pick arriving
- z5 Q/ i- d' o; n! i6 m3 u    set A_i to procindex * 10 + 1
& w+ E- Y) r/ t- ]" S) L: t    move into Q_induct(procindex)+ @3 W1 [  U& w8 n
    move into pickaisle.induct(procindex)
8 ~" v+ g5 [8 P4 H    /*check the type of pickaisle.induct(i), for your last problem.*/4 k3 h5 [% m# ?( s- l

0 e7 s) m0 K$ E: t' I    while A_i<=30 do begin7 F6 `0 i; ~1 V$ ^
        travel to pickaisle.con(A_i)0 \( Y$ r; F4 Y9 a/ J# e/ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 X7 n. o$ X8 H. i4 X7 n8 j        else wait for 10 sec
2 G) m1 o- U' g* x5 z  J& s! |        if A_i=A_leave then send to die
( o, d. q% b! [! F% b        else inc A_i by 1
# H6 T/ w, F& r    end" e9 m) P: b2 c) J: l' J! R
end3 H6 O7 a+ G& \& K
' l; H. E$ L8 L2 N! j! r; W
其中的procindex为整形,代表当前process的序号。
0 j& c' y0 s, L% istation和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, 2026-5-18 18:04 , Processed in 0.017831 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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