设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15370|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ s- m+ _( B/ }8 I6 z) V+ k
2 K! r# R+ [$ O! q7 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中的数值,不知道会不会有什么不妥。
: H! X0 ?2 X- A3 u4 q9 u4 r
# d# K. O4 W! q6 a: D7 U- m  abegin P_read arriving
  ^( v8 \9 @, t  R2 A' I; a    while 1=1 do begin
8 s+ @) u8 |% @, v9 ^* |2 d5 R        read A_tote from "data.txt" with delimiter "\n"& i3 e# O9 j" n
        read A_time from "data.txt" with delimiter "\n"/ E& y7 w* v9 s7 Q0 f. j& {) h
        read A_leave from "data.txt" with delimiter "\n"
- _- i: K3 `. X$ C( O+ e/ s        read A_picks from "data.txt" with delimiter "\n"# J4 d' P1 N$ I
        set load type to A_tote
: f) W4 `6 L; R& ?, ^8 I( w/ D        if A_tote="tote 1" then set A_induct to 13 j8 q% F4 x5 x3 S* J4 T! t8 I
        else if A_tote="tote 2" then set A_induct to 21 }6 [! I- G- X' z, q
            else set A_induct to 3   
. U- b/ M* \; y+ x$ R        set A_i to 0' \" Q& R# ]: j7 a9 D9 ^7 w- X
        clone 1 load to P_induction' s: t; w" o3 x* t
        wait for A_time sec5 D' z  ~! n. @3 C
    end
0 F5 ~8 R) y' ^+ S6 z' N: Y, ]end: T# C7 {, a  G) n( x

# u; z$ `, F& n/ ^) N, bbegin P_induction arriving- i% x+ D3 V, W! n- G
    if A_induct=1 then clone 1 load to P_pick1
* g, J$ S. E$ E4 E. Q% N    else if A_induct=2 then clone 1 load to P_pick2  W$ w8 I$ t6 c) S& b
        else clone 1 load to P_pick35 C! K5 F. k) J5 w7 N- u" A
end
3 N% U8 L! E1 [6 m9 [- \- [3 W) P7 S" p, X
begin P_pick1 arriving. q' F  D7 _+ S: ?$ K
    set A_i to 1
9 a9 ?$ |2 O  f    move into Q_induct1
5 g3 l* _8 i) y8 y2 A0 Z    move into pickaisle.induct1
' t6 X0 q% I) u; J5 c( _1 Y    while A_i<=30 do begin
" J( [) F, s7 u, |3 ]        travel to pickaisle.con(A_i)( u% V/ u$ C/ L1 y0 `( r' o! K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 @& n0 A* B4 z        else wait for 10 sec
) g" N8 @( `! T) V7 E3 `        if A_i=A_leave then send to die- I2 G9 m" H) ~
        else inc A_i by 1
. ]5 a+ ?- Y  |0 }% ]9 J    end# \* z: D3 \$ p9 S! [
end
) j2 @0 g' X/ j  h& i, `4 Q, q! S
. ]$ B/ y+ f" R1 _begin P_pick2 arriving
1 \! z6 h. U7 J1 U, k5 n2 U6 V    set A_i to 11" _6 p/ v, l1 x8 N  U' ~
    move into Q_induct2
+ D0 [( }1 o# B7 Q    move into pickaisle.induct2
1 F2 i5 s. E4 I: B, u6 I    while A_i<=30 do begin
1 o6 d& i4 {4 h        travel to pickaisle.con(A_i)- d7 g/ _9 }! y" A& A0 a, g  Q  P& @( H8 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ]; O. ^$ O" T% [        else wait for 10 sec# h! u7 d" \( ]+ ^) J9 s! J, W
        if A_i=A_leave then send to die" U: h& J5 P4 ~9 o; R
        else inc A_i by 1
6 E5 y+ f+ X9 h0 I: ?    end# H( b' [3 J: [  }+ Z
end9 q1 {) ^$ l/ w6 o) p
2 b' [' f3 O6 f; f7 R
begin P_pick3 arriving
1 X& m# F! g: j. U: @7 u0 n3 L    set A_i to 21
9 N& L+ h5 p8 G3 @& `) V    move into Q_induct3; O6 `! J$ C. f+ _/ ?1 O/ i
    move into pickaisle.induct3
$ v2 n+ b- F$ k: E% _$ n0 P& B    while A_i<=30 do begin
- u, f% K2 V2 g6 x3 w7 a* I        travel to pickaisle.con(A_i)
! Q! V7 R$ |7 J+ @9 `+ j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( Q9 V% V3 o. j        else wait for 10 sec# c* T8 j( w* t, m
        if A_i=A_leave then send to die$ ?& U! m  N7 ~  @7 M( t( G( a
        else inc A_i by 17 ^; Y8 S' O+ i
    end4 G9 X' O0 m' u
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是个什么东东?
# A% Z) h4 l1 o( A/ J0 qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 h. [0 V4 J+ N- f. [0 H' g: }% n6 B, l1 q) {, ~! \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 @; Z' P0 o6 H4 u1 l

/ L( v4 f% Z; g7 X: |( Q' e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* q6 k$ m: a1 r3 y9 W' h* A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 ~9 q* h) S3 V& H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ l8 F/ ~! M1 F( Y3 d" H; u0 E3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( A8 q$ C! `# |, E/ @) c1 Fbegin P_induction arriving
7 H! i' ]% a  Z1 \, d6 I" j    clone 1 load to P_pick(A_induct)
, N1 d4 Z5 Q: _, ^+ |& @end最大的系+ Z& B8 u9 K  G( J

  k7 U. z% V1 r  L8 L# o2 ]# u: Nbegin P_pick arriving9 t4 A6 [3 z; i% I, W% f
    set A_i to procindex * 10 + 1
. d3 [& i8 O7 o5 [  L5 U! E! O! y    move into Q_induct(procindex)# b0 T+ ]: A) F( S" X' M- w
    move into pickaisle.induct(procindex), p" ~6 w/ X. X/ I1 P
    /*check the type of pickaisle.induct(i), for your last problem.*/
+ O  `+ |  }( L- t+ P+ N. `5 _! b$ D
    while A_i<=30 do begin
" T# B" ~/ c0 W! u/ E6 U% e        travel to pickaisle.con(A_i); s$ w8 q! _, M) z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" j; m6 t& n1 ]3 N: E        else wait for 10 sec
: x* h) r& |& h9 r        if A_i=A_leave then send to die9 k& `% s. F- T5 B# f* |
        else inc A_i by 15 k; x. `  M  p8 v9 N+ b+ ?
    end1 @+ O9 H) l! [6 [$ n3 i
end
+ L- Z7 l! c  E' W% f! ~$ H+ `* A; X% P7 N
其中的procindex为整形,代表当前process的序号。
/ r: c! F3 \1 j# C, B; Y6 astation和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-9-6 10:10 , Processed in 0.017969 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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