设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14464|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! o" @% s  x" D& _4 O0 T2 M/ j, f( ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 k3 w- L% t5 E

+ Y) T* w, M9 {0 m1 m0 K1 Sbegin P_read arriving
2 M8 \, j# H& `. W    while 1=1 do begin
$ z2 Z5 _9 o& }+ K- H. C( u+ ~8 a, y5 w        read A_tote from "data.txt" with delimiter "\n"8 _6 m' M- B  o5 o
        read A_time from "data.txt" with delimiter "\n", ?9 [; w8 _! [
        read A_leave from "data.txt" with delimiter "\n"( g% P- U$ o8 S$ D: m/ h# B8 N
        read A_picks from "data.txt" with delimiter "\n". D( }4 T. Q9 z4 M1 t) `# l
        set load type to A_tote) k7 W- n  n( u' v7 o  w
        if A_tote="tote 1" then set A_induct to 1- x. |6 ], |% ]4 C  i
        else if A_tote="tote 2" then set A_induct to 27 {- z' i* u- m: ?- f
            else set A_induct to 3    ! a2 Q0 y! I% D/ O( K8 r
        set A_i to 0- ~% N- Q/ P4 [3 c0 b
        clone 1 load to P_induction
0 L$ r$ i! R' n        wait for A_time sec+ ]9 H. Z6 R7 f% _
    end
2 G3 y2 y: E& S4 ]. q7 qend
3 s% ]# y3 x* g! s, G8 m0 K4 ?8 S% }
begin P_induction arriving7 I2 \, l0 O" d  a
    if A_induct=1 then clone 1 load to P_pick1% g+ |5 d' _( Q
    else if A_induct=2 then clone 1 load to P_pick2
5 Y$ g; P7 n! M: I        else clone 1 load to P_pick33 v$ [7 ^2 x# l9 h9 J, }
end& F. L! i# ]. d7 m/ `9 _

: B+ |3 N$ ?8 Dbegin P_pick1 arriving3 G) H# K: q! j
    set A_i to 1
/ s2 g/ O+ ]. D! s3 T    move into Q_induct1
& ], j& m+ W4 U( g    move into pickaisle.induct12 B8 h8 x9 K$ O% u
    while A_i<=30 do begin- A# n2 X7 @3 _$ O1 }
        travel to pickaisle.con(A_i)
0 Z" H2 R1 O8 d. }$ X0 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 V0 c% P- h- O2 K  j, V4 `
        else wait for 10 sec: U$ A! e8 l* l4 \8 l8 `! g1 |, b
        if A_i=A_leave then send to die
6 p- {: V0 F0 E; J        else inc A_i by 12 ~. @. K. u2 D' `' |& p
    end
# @! h! F  P! H  vend
* j3 ~7 u1 _- d( X& ]: J8 |  l% [$ I5 s" Q
begin P_pick2 arriving- F# n4 e/ S" j  `/ B
    set A_i to 11' V. q& z9 p" V* a) C: c
    move into Q_induct24 u5 D0 T2 I4 u  Q) t" z
    move into pickaisle.induct24 R4 X8 G9 q( {
    while A_i<=30 do begin
: p9 ^7 Y% y1 j        travel to pickaisle.con(A_i)
# Y7 A& N5 u  c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 D/ g4 `& _4 ~6 |4 w; H2 ]
        else wait for 10 sec
' Q8 M+ G0 Z4 G        if A_i=A_leave then send to die
- w! g7 o1 H/ z0 \; {        else inc A_i by 1
; ^/ R$ L8 D1 b1 i3 T6 H, p    end) v3 a$ e2 Y% l/ o
end
9 W6 ~) ]) f# h: O: Z
& |& x9 Y% v) @7 `2 J/ dbegin P_pick3 arriving. J. N( ]0 {% Q) D
    set A_i to 21, ~9 X" I5 C5 @$ R5 g6 w) b$ o" O
    move into Q_induct3, P) n! ?, R7 }" F3 V
    move into pickaisle.induct3
6 g/ e% a  H5 O9 \) K( ?* A    while A_i<=30 do begin8 t% n6 i. m: F- }
        travel to pickaisle.con(A_i)( x$ m) M, s% r/ ~2 _4 N( t; A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* M; C! [3 D7 v" ]& B# J% q3 C        else wait for 10 sec9 {& X# j/ b* y9 l4 Y
        if A_i=A_leave then send to die
1 W( ]# d- R+ h( ?        else inc A_i by 1
2 a; X+ [$ a$ n8 G; Q8 e* v    end" e' K1 [7 ^3 h; w8 W
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是个什么东东?
: Y" Y! `8 L% H8 P0 d6 omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( Q1 s2 N3 X" ^2 I( k. M+ `
3 r" v. b. Q  ?; |8 U. I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- D" o1 h6 W$ |; Z
7 n) @+ U  |5 y# V( o+ \% r0 c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: w# X* r2 q3 j& v$ F: Y# B: v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% i% R3 r* j  x4 [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& y$ C- b) M$ ]2 @4 A( h. s3 z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 m# q: o! e. h% U* N8 `" Obegin P_induction arriving" f) T8 K  o5 t4 l1 Y, i7 }( y  S
    clone 1 load to P_pick(A_induct)
# w/ g3 d5 [! O1 a/ Aend最大的系: \# }, s2 W" _( k5 u5 z

  r8 N5 Z, w' r& tbegin P_pick arriving- o5 ]( J. M. u6 Z; ]9 u2 x* j9 A
    set A_i to procindex * 10 + 1: z2 T3 w4 c- S- P, \' _  ?
    move into Q_induct(procindex)% z8 p6 D$ Q( e: M# o/ J9 y7 e
    move into pickaisle.induct(procindex)6 |- `# v, {! G  O5 n. ^% ]. b
    /*check the type of pickaisle.induct(i), for your last problem.*/
) K" h/ _% q7 h. W7 U* |! Z8 }  Y6 B- C; ?
    while A_i<=30 do begin
) ?, o( C+ O1 J7 q) I        travel to pickaisle.con(A_i)5 u1 L7 W4 J& ]( u! M7 b5 @) ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 D, q8 r  r. C$ i8 T) t9 S1 Q        else wait for 10 sec. ?1 T) _- s3 e
        if A_i=A_leave then send to die
- X9 k+ S3 q  q        else inc A_i by 1
) n: [8 k; s1 T: {    end
- T0 b- \# E, d. E9 [2 f9 E( q' h+ p- ^end# J- D) X8 R  i, @2 M% |. d2 f

# A  v( @+ I/ {! S其中的procindex为整形,代表当前process的序号。
& i# c5 a% m. K) {. T& B1 I& |# ?station和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-7-13 06:44 , Processed in 0.014240 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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