设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12332|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, X2 O" G( q0 V$ H, v0 j
& B7 g. X& E' c2 C4 z/ L( 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中的数值,不知道会不会有什么不妥。
7 F, H, R3 M/ i9 n; u# c
8 K  [9 n: A  y" o0 M$ Dbegin P_read arriving8 Z) Y0 _7 N# k# E( D
    while 1=1 do begin3 w; t  b! H) ^: f, I( O* P
        read A_tote from "data.txt" with delimiter "\n"
: K) s+ }. i# M1 O  N7 s+ A: Q        read A_time from "data.txt" with delimiter "\n"
2 X$ g0 D8 Q8 U, U        read A_leave from "data.txt" with delimiter "\n"8 A$ ?/ ?/ }" a7 x* J' M) u$ r: G, u
        read A_picks from "data.txt" with delimiter "\n"' M& [( ^5 Z% s. h! h
        set load type to A_tote$ K4 |9 E1 f7 a9 B( Y" u
        if A_tote="tote 1" then set A_induct to 1
% z% ~. t  C+ A; t5 s1 t  T        else if A_tote="tote 2" then set A_induct to 2$ b5 E% K! {7 r' W
            else set A_induct to 3    8 }, C% i! g' ?7 W
        set A_i to 0% H, ]' S7 G6 T
        clone 1 load to P_induction: T5 t/ K' e8 [: J- T. N
        wait for A_time sec
: d: x7 y; y- [7 n* t  ], V! r    end
- o: B' F+ j- r* i3 Zend& v! T) c* o- A% ~/ k9 r

) k, B( l9 O- E8 r$ @5 r6 Zbegin P_induction arriving
9 U- b. G4 W3 @" S    if A_induct=1 then clone 1 load to P_pick1
8 j5 k( n$ h  j. D    else if A_induct=2 then clone 1 load to P_pick2
8 @0 d; v. g2 r& X; K        else clone 1 load to P_pick3# k4 x8 ~0 G6 q# x! p
end# [1 ^1 c5 v, x( x! i( r
( L# S3 }, J* ^) f! J
begin P_pick1 arriving
: q0 H! D  @' m" Q# C    set A_i to 1  [6 _% c. u  u) h. X! C. T; X
    move into Q_induct1
( @8 r3 |, F3 _  B    move into pickaisle.induct17 N% u( J6 y" P. n
    while A_i<=30 do begin
2 d2 p, c5 _/ V% K' M        travel to pickaisle.con(A_i)) S: v- Y8 B6 `, X$ u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& L/ L7 a$ E& a5 a
        else wait for 10 sec
: K) i* d. f0 u7 T0 q% J        if A_i=A_leave then send to die2 u: V# H8 X3 s( Z6 A
        else inc A_i by 10 x- D' y* H8 b4 R; @7 v' Y9 n
    end
/ g. y, j# p6 x4 Z* d9 l* D' Fend
6 d4 [! ]6 h. N' H7 V: V
- K; W. l- |, ~1 Z1 }1 S0 abegin P_pick2 arriving
1 Q- O6 o2 C; [# H) ~$ U    set A_i to 11
- ?1 `( z" o4 j4 w! I( |$ k9 k" a+ C2 i    move into Q_induct2
+ P6 e0 b. {% u6 ~    move into pickaisle.induct2
& E% Q$ R5 v* G3 F    while A_i<=30 do begin
# |* I7 j- {& ^) F4 l# r        travel to pickaisle.con(A_i)4 K3 _7 Q0 ?4 D6 f$ Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 @8 m  i8 J2 `4 _6 q$ _7 O( b0 P
        else wait for 10 sec8 O9 O8 H2 Y: Z) ?
        if A_i=A_leave then send to die
/ c! p( e/ f$ K/ O7 b8 t% [        else inc A_i by 1
6 k# ?" z* h$ r% @    end
- c* s' c# @, M: C1 v& c5 {& i+ L! u2 Pend% A3 `- ~, r) M* z/ j9 R9 v+ m

" \0 D6 o+ E- {+ v7 e, hbegin P_pick3 arriving$ Q$ Z, G. s0 ?. ]- i& f( a
    set A_i to 21+ ~; ?, I" _$ |: W! v
    move into Q_induct3
3 P1 {+ o, z) N  ]( U* I  i    move into pickaisle.induct3
. t3 |( {7 F& _. b7 A+ ~& R5 ~    while A_i<=30 do begin
# |( t& C  w: m) V! M- l! n" V3 J        travel to pickaisle.con(A_i)
* L* b0 q7 l, k7 m) t7 W0 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 i7 Q4 \+ f. r0 l( _4 Z3 p        else wait for 10 sec
2 H. z1 g8 c1 k: z        if A_i=A_leave then send to die' P7 O( \6 l% v3 k
        else inc A_i by 1
7 t6 l+ `% K- k3 B    end+ m; u% ?' q. K) J4 ]7 r
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是个什么东东?% N3 A8 S2 c8 x$ z) A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" t4 |" D. A" e1 ?& x! x

, Q- x$ q/ U; o$ ?: ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. H6 `- v' J0 ]

3 I$ U9 E& T" u6 X0 m$ S9 X- Z0 y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) T( A. {! W2 I3 }, @8 ~1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; h8 Z& q/ y2 ?- k1 Y, ?# j- s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ g. j; h, q) ^  l, j$ x3 Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, g$ D) {; l% X7 @( j# A' n' `0 ?
begin P_induction arriving' f; M; h5 W, V; \. v: S
    clone 1 load to P_pick(A_induct)
: |: \' B# I" Xend最大的系
% f, Y& P2 h- ~8 Z- r, b! A$ q
begin P_pick arriving
" }7 c  g% ]' K$ m. l  N$ Z+ _1 s    set A_i to procindex * 10 + 1
4 @0 [) E/ ]6 j! S( q    move into Q_induct(procindex)5 T+ G6 [4 J' p! d/ O. _* i! l
    move into pickaisle.induct(procindex)5 g; A1 T( l/ b
    /*check the type of pickaisle.induct(i), for your last problem.*/6 }( h( c9 [6 h  A2 c1 ]

. m: e0 [' j0 ]5 `& ?    while A_i<=30 do begin
  [) K; i" n, q5 M. p" `        travel to pickaisle.con(A_i)
6 {1 m0 O& G9 [2 ^% ^1 v# j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: L% E5 v) }. i% F1 N5 H        else wait for 10 sec
& t6 Z, D. l, Q. Q5 e' x4 r        if A_i=A_leave then send to die
+ u& f) h$ m) g. w% V& W8 Y/ u9 b        else inc A_i by 1! s$ M* D8 z/ V: w
    end6 f8 G% d( {! G% I2 X
end0 }- H) g, n' q

9 W: ~4 D7 \* ~: `8 P1 I5 o其中的procindex为整形,代表当前process的序号。( g) t& }/ `7 V5 d4 Y4 \
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-1-14 13:43 , Processed in 0.020410 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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