设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13818|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* o. L( J& i  t4 n( O9 ~& V9 E

$ r  ?0 P3 x% 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中的数值,不知道会不会有什么不妥。8 a( }0 [" s* m7 j% j9 h, C; x6 T0 T
4 b9 k  R9 j' y0 p% d5 l+ {
begin P_read arriving- o6 W2 W8 \2 R2 A6 ~1 T! p2 O3 F
    while 1=1 do begin( I8 S% }; X: |3 I! c( H
        read A_tote from "data.txt" with delimiter "\n"3 F- e, K0 O! [' k# O/ C' n* a
        read A_time from "data.txt" with delimiter "\n"
+ W. K, B3 J& Q. z7 |0 ^9 W: c        read A_leave from "data.txt" with delimiter "\n"
6 B. u% {5 P5 e( i8 \# Q4 X        read A_picks from "data.txt" with delimiter "\n"+ U( K8 t/ s2 d- V# F
        set load type to A_tote
# g1 f0 f* d3 {/ \* H9 n8 H        if A_tote="tote 1" then set A_induct to 1
7 h9 C3 e, F, [) ]8 i        else if A_tote="tote 2" then set A_induct to 2
; G* \( W# j4 ^* N            else set A_induct to 3      q$ \1 t$ m7 `. U4 Y* Q1 Z
        set A_i to 0) R7 b2 z, ^4 T3 ]" O( w
        clone 1 load to P_induction- P2 f' N4 \( m8 P* \1 F0 p  k
        wait for A_time sec1 V. D. }  K( Y" c" H( E' G# H
    end- V8 ^2 r" I5 V3 t# a( o
end7 X0 n; k2 W8 ?$ ^% [# s/ ?! K6 |
4 X% q) q/ M& [6 y
begin P_induction arriving) W. U' ]4 [8 `
    if A_induct=1 then clone 1 load to P_pick1$ l* u/ m+ q  K  [, ?0 p. |
    else if A_induct=2 then clone 1 load to P_pick2
% H% @5 o) a7 S5 K8 k        else clone 1 load to P_pick3
7 {5 Y5 ?. Y: ~5 ?" ~  ?: qend0 ^; G0 f8 X+ H) q4 T, P$ _- G
4 o! c1 Z3 A# \
begin P_pick1 arriving  B+ P) k/ |' a; Q8 }3 D: B$ i
    set A_i to 1( ]3 ~, h7 N& ]1 @! M; ], M
    move into Q_induct1( {8 E& S5 T2 e7 X9 Z
    move into pickaisle.induct10 O6 }+ v. H7 U0 p+ v) z$ ^
    while A_i<=30 do begin
' t/ D5 k4 K0 Y- i2 S+ [  V9 g, N8 W        travel to pickaisle.con(A_i)
. b) H, _+ C/ |# }) {, ]) u  J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 V/ ?' j" ^% S        else wait for 10 sec
! A+ R! A* Y; b0 ^. r6 N3 |" D/ S* y        if A_i=A_leave then send to die
  I  [0 I, `- w        else inc A_i by 1& C; J9 [- \9 }7 A% P
    end# K3 k7 }$ a% u# {" s% H0 r& @
end
- P' L) a: B6 {: u- M& @7 p% m% O/ x% q: I& s0 ]# m8 J
begin P_pick2 arriving
+ X2 s& k& r0 ^* W/ C2 o    set A_i to 11
7 G: i" l* M( d5 G, C0 H6 F    move into Q_induct2
0 T& F% ^# E1 A* g    move into pickaisle.induct2& k$ p1 f' W! E" Q, D4 v1 S# T- [
    while A_i<=30 do begin, U+ I3 o$ H. M& U
        travel to pickaisle.con(A_i)5 u9 N! [- P0 S$ {) t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' O- m& g4 h% ~        else wait for 10 sec
4 K6 B2 }6 I4 s' |" ~        if A_i=A_leave then send to die5 X  J6 L7 S  l" I: K
        else inc A_i by 15 C3 {2 I" G% E2 ]
    end
8 k! k1 m3 o, \. k& J% |% hend: l0 [& t" Y! a9 C
/ Q: `( `" r" b& h# t: d9 M
begin P_pick3 arriving
$ F0 Z6 B6 Y/ W6 S3 d8 H4 ]    set A_i to 218 {* b! l! Z; v& R2 H
    move into Q_induct3
6 }, ~. T  O7 g9 v( C6 n5 K$ f    move into pickaisle.induct31 P; G  ^% E6 M: [
    while A_i<=30 do begin. _/ a. B3 c2 B8 N
        travel to pickaisle.con(A_i)
9 ?3 W4 j# X7 I4 d: z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 O/ ]* A0 M& }: n$ H  ~
        else wait for 10 sec% F9 [# ~$ w  Q- T8 I9 O
        if A_i=A_leave then send to die; a2 D" {, a( p; H, V( B/ J
        else inc A_i by 1
# g$ [6 `/ F, G+ \& b( C    end
4 [1 {1 s( A0 Y! [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是个什么东东?9 y- z( b  H! j$ b$ L7 }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# L- \6 l) \- B* m

& o* A% I7 L; r, M$ G5 L$ XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ a" J1 i# u0 Z; z) T4 D
) D( P4 O. o# ?9 N0 o0 b  @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; K4 {: ^7 d* c- k- h$ j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( H" Q. d* F7 x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ }  w8 l+ @6 Q* A! m, p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 i1 B: L: h( g! l
begin P_induction arriving0 C6 {' D* W9 d9 I) N
    clone 1 load to P_pick(A_induct)' |6 T. S) g# A/ x9 O% j5 v! G
end最大的系( X+ p0 D5 k" _0 i* W

) e* v3 }8 w7 ^2 C& _" t8 L3 d+ ybegin P_pick arriving
- a8 e, Z) S' x3 Z; J    set A_i to procindex * 10 + 1. x7 Z' R  D: i1 x' Q; O
    move into Q_induct(procindex)
+ `7 t( P1 O" V6 _0 j    move into pickaisle.induct(procindex)
5 L% l2 K/ }9 \) p' U2 S3 I0 Y    /*check the type of pickaisle.induct(i), for your last problem.*/
' Q& U7 I& y; q  c; u" j3 o
2 s/ ?5 n1 \  U: h+ x/ h4 K( s    while A_i<=30 do begin; A& L) g2 `9 B& G
        travel to pickaisle.con(A_i)
' `( g6 |3 b% E7 f' y3 [2 i: F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( s! O7 K: v& i8 K! p
        else wait for 10 sec
+ b! U6 x* F* o4 Y        if A_i=A_leave then send to die
/ r2 s' z7 B- n0 o1 Q3 p" [        else inc A_i by 1
7 z0 e) f1 T' ?# z% b1 [* K    end& r5 V" d0 t! v4 L
end
# [5 x% b6 F: @0 c& e
- }, C$ w4 y, y8 @! n3 D5 Q& t: ]其中的procindex为整形,代表当前process的序号。
1 m" \# {5 s$ D, }- J1 M% P& [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-8 03:29 , Processed in 3.941248 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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