设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13909|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ b; `- {! Y- k& I* ~
% @- Q4 L  I+ l1 G1 o# q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 i1 \0 ^  Z0 s0 c+ L6 \3 q5 f% s+ m1 y3 S
begin P_read arriving4 Z& a- y' N$ H9 f6 I
    while 1=1 do begin6 ?2 T5 R% Q  [- B4 ]9 K/ M
        read A_tote from "data.txt" with delimiter "\n"
0 v1 l. L( \, N6 k1 G6 [. S        read A_time from "data.txt" with delimiter "\n"( f& I, H% ?9 _2 I$ ~$ M
        read A_leave from "data.txt" with delimiter "\n"' Q3 v" L9 H9 |6 ^7 v
        read A_picks from "data.txt" with delimiter "\n"
4 F0 ]9 ]+ d$ [; x0 }' M% ^        set load type to A_tote! {) B; f' s# G0 n8 ]. f
        if A_tote="tote 1" then set A_induct to 19 u* J' T2 U0 j. k" R$ Y, U! d
        else if A_tote="tote 2" then set A_induct to 2! i$ @/ }; o0 Z- }# u/ _& W8 I) g
            else set A_induct to 3    8 n- q+ }9 K- K# H7 a+ Y% `; ~
        set A_i to 0# U& |. E. ?( S7 e/ M
        clone 1 load to P_induction
6 y# u( Q+ h: }7 p, o        wait for A_time sec
  m" H% e& d0 P1 P6 F) h    end
. m& @5 B1 h; g! b# Z+ zend6 Y+ b( F$ X6 M
+ v1 C- Y& [7 M9 l& g# J# M
begin P_induction arriving
  [& `& U, ?* t7 T3 ]1 A, O, D$ V    if A_induct=1 then clone 1 load to P_pick1
6 T# x5 F: I5 i" L/ @    else if A_induct=2 then clone 1 load to P_pick23 O2 k2 k: y5 `$ n0 V$ s5 d2 [; @
        else clone 1 load to P_pick3
: O5 z3 Q" |7 @/ i* n+ \end
! s" I: M; j% s1 r
6 T3 b& y" Q+ |0 O& e1 r9 d( ibegin P_pick1 arriving
7 x$ w2 A8 T9 G% J- M' z    set A_i to 16 X' n. }5 N/ m1 W+ G5 \0 L. Z
    move into Q_induct1
2 u/ a1 t7 H% y    move into pickaisle.induct1$ `- v8 ^6 {6 X
    while A_i<=30 do begin. T' `& g, o8 N' b- r' N# _
        travel to pickaisle.con(A_i)
7 c; v" C$ h4 q3 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. n0 E* ], V9 F# \2 w6 [2 q
        else wait for 10 sec
6 _0 t+ s. h. a6 D        if A_i=A_leave then send to die
4 w* }! O9 d) r6 T. F# r        else inc A_i by 1
! O, q% w! v  M0 d/ @    end  t2 k5 R5 u# S- U* m. C  R: i
end
/ ]$ T" N6 i- @( m* s$ ]3 c, ]! S$ f7 K
begin P_pick2 arriving+ @4 G; Y0 B9 R3 l9 F
    set A_i to 111 b1 `3 i; z& ^1 R6 G3 y% J$ f* Z+ Z
    move into Q_induct22 x4 N: n5 {0 z# F4 A, ?( W
    move into pickaisle.induct2
( Q- E  B; K* b" d    while A_i<=30 do begin
  |, i+ Y  A* f/ a% z        travel to pickaisle.con(A_i)
2 Z% _5 F4 _5 ]  i% k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ M( c. z# L) n4 m/ l2 {9 K
        else wait for 10 sec* L9 Y: Q9 d1 `0 k& ~
        if A_i=A_leave then send to die
; ?! i% f- G8 l1 {, Q( c        else inc A_i by 1! h4 |8 P6 q: y# g2 Q
    end
) f1 J. \* b- iend
) D! l& B( d5 G9 Q1 r  k3 {5 }$ Z8 b- ~; N* H+ L5 {  B
begin P_pick3 arriving
& j) e+ s* n+ u& A0 W9 L0 Y    set A_i to 21
" r2 U0 M/ h  ?  v( m    move into Q_induct3, X- k! U7 i  W
    move into pickaisle.induct3# G9 ]7 A1 `2 u* G9 {
    while A_i<=30 do begin: V. d9 l. R( m- f, ~4 N+ ]+ _  y
        travel to pickaisle.con(A_i)! r% B, x) p7 b8 N* e2 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& u. J( D9 C; x! v6 M( x
        else wait for 10 sec2 j% `8 K/ g+ S) N5 k& R
        if A_i=A_leave then send to die$ L  L) w4 l& J" P5 G; l
        else inc A_i by 1
" d5 B" F8 |* v9 W) P! }    end
  V( k) k1 L! Zend

最佳答案

查看完整内容

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是个什么东东?# o1 x: F; L) n# w' h0 u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% W: t& c! Y4 a, u! v

3 T+ Q( O! O1 o5 yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: v% b2 g. C. }
0 E1 J4 q) Z5 ~) Z  l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, n) C& ?5 T4 v* r0 A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 l# L0 A: e. d/ m6 c* `0 H1 a1 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 k% K0 n# p( t: t1 t" t2 E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 q8 }+ T5 c% K* Lbegin P_induction arriving
- B; a1 F# O0 _; W9 c% w5 j    clone 1 load to P_pick(A_induct)
0 G) T, y3 V5 V5 E# B$ ^end最大的系8 s0 K" T9 H  Z7 y& _* p! H

5 O& }. g% |- Q! ?1 A7 ybegin P_pick arriving9 S2 I* t; }2 p/ ^5 C% \
    set A_i to procindex * 10 + 16 Z5 q4 {6 M: W+ q  c6 B# |
    move into Q_induct(procindex); R9 f2 B7 J7 U/ u
    move into pickaisle.induct(procindex)$ z/ t) ^% s" C! K) p  J
    /*check the type of pickaisle.induct(i), for your last problem.*/" t" m5 X6 H5 \8 P
( R' f) h9 \$ C! Y
    while A_i<=30 do begin& x0 F8 E! |4 H  }8 {( |# v
        travel to pickaisle.con(A_i)
+ e' W. t4 ~5 i- E9 ?5 A: v0 s% E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ?1 z6 Q: g1 x6 l& }        else wait for 10 sec
+ h0 ]" c: K+ g/ ~# ~! o        if A_i=A_leave then send to die
* n  `  j9 `, L/ `6 p' b        else inc A_i by 1% W5 u! ^2 P8 U2 M# t
    end
% \. t) ]' Y+ vend
) d  k, @/ ~4 ]4 p& Q1 F$ @( T
# c; Y4 U) ~6 j6 Y其中的procindex为整形,代表当前process的序号。8 u  e0 b, I1 g2 @% R; a. B% t
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-5-18 02:09 , Processed in 0.018362 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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