设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10677|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  i/ @( c# b- F2 k7 W8 k0 i
# Q- L9 }1 u7 E! a/ N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" V2 g1 H0 f9 w; Y

4 w' Y1 N) Y1 c8 i: p* Fbegin P_read arriving
1 A- V% G( ^. m' `; q: p    while 1=1 do begin
# R3 L" p. l" k, B; ?        read A_tote from "data.txt" with delimiter "\n"7 c0 f* C8 z- k% b8 x$ t
        read A_time from "data.txt" with delimiter "\n"
, \8 X4 O# M, D: r& ^  F. n4 ?        read A_leave from "data.txt" with delimiter "\n"
9 O9 {' Y0 y4 M( C1 i" E" T        read A_picks from "data.txt" with delimiter "\n"
1 X4 K" ]1 D! A3 F# x        set load type to A_tote
: d; y: q% B" }" B5 f  `3 d% H        if A_tote="tote 1" then set A_induct to 14 C. y, H( V2 ]+ P/ z& K& i
        else if A_tote="tote 2" then set A_induct to 22 e9 y* g; q+ V/ A: B
            else set A_induct to 3   
& d% w6 G9 f7 p( F        set A_i to 0
- Y5 j% T$ K+ q( u3 F2 x4 j) F& }3 Z        clone 1 load to P_induction
( U/ e! n: l! A4 W1 y) ^        wait for A_time sec
7 f+ q! D) `# ^! x5 x% V! w" ~. u    end
+ `1 m2 o( ^9 @5 Gend9 J  n' V& k6 k  v1 U! B7 W
" Y4 S, ], H& k+ i1 r
begin P_induction arriving8 K9 E7 v2 ]* U, M# _
    if A_induct=1 then clone 1 load to P_pick1
/ z& d* \( K3 d0 z7 z    else if A_induct=2 then clone 1 load to P_pick2
* s+ T0 ?8 L5 y) |        else clone 1 load to P_pick3
7 C+ f  v- f! L% f( tend, s& L  `0 }. {2 w2 N5 a

( A$ q( r: _# }- _0 Kbegin P_pick1 arriving' o6 [  a0 w/ z9 r7 L
    set A_i to 1
1 W+ Y5 f5 `& i  W  o: ?! e& v    move into Q_induct1  V, z8 x' b: b. p5 U$ H
    move into pickaisle.induct1; k& T$ S5 M% u8 o; }
    while A_i<=30 do begin
0 l# N* i  r9 V        travel to pickaisle.con(A_i)
8 B8 B# R* M) W4 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" F8 L; ]- [( w; b, O        else wait for 10 sec+ X! m5 b( m! {& E  Q
        if A_i=A_leave then send to die
  }5 V4 w! ~( t- g' ]( h        else inc A_i by 18 q, K- |$ i8 i$ M# u
    end, e- A& ?3 m4 _# X) |: K" m) z
end
: |3 g# K- }0 D% U
! ~' b0 R2 u" @  r& v% W* ~begin P_pick2 arriving1 j! D9 V2 R' O5 m. r( X5 F1 }
    set A_i to 11$ L4 {  }& g. L; h( m
    move into Q_induct2
5 c( u# `* E! G9 A    move into pickaisle.induct2
4 R8 K! c4 }, n. ]& x    while A_i<=30 do begin9 n0 {  B) [& C$ M, ^
        travel to pickaisle.con(A_i)* Y' [1 o$ j% r& |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. v! H! Q3 m4 w) F        else wait for 10 sec
7 E- e0 X/ b4 t' ?) |0 N        if A_i=A_leave then send to die  Y2 ^0 o1 t* H% O& t; f' L
        else inc A_i by 1+ g+ L) i  {5 B% u, T
    end; Y7 }8 n  R+ k
end9 F1 X. x8 m& p( i- S
6 r0 h& j2 u3 A: `
begin P_pick3 arriving
) r6 x* i! X* x    set A_i to 21
$ I  M! y1 N' D# e% E; S    move into Q_induct3# n7 [9 L( J3 \' c" r) C- |
    move into pickaisle.induct3
" Y' o$ }  _& T5 T$ v& b2 S/ S    while A_i<=30 do begin( ^* M3 U6 a9 x+ E8 |
        travel to pickaisle.con(A_i)
' o+ }1 ^6 z4 L1 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# g2 Q% m6 j  J& X, ]  x& ^
        else wait for 10 sec: I1 _0 j. j* N5 b# ~/ H
        if A_i=A_leave then send to die9 F! ]- k& m. ^# ^" @+ g3 n, M
        else inc A_i by 1
# D2 h8 P  `# ^0 g( b" }$ N( G    end
  {! B% D' N! `0 }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是个什么东东?
; ^$ t1 {4 W8 J0 D0 omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 U: K% a% w: {1 l7 Q
, L: m, V. V- ~7 v8 g8 @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 K5 U- [/ l9 y
9 e- r, Z1 a5 S2 ~8 M8 z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, \& C! A" S4 B' ~- H) Y* v+ i4 z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 }* k/ u, z( {& g. U- N5 V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  T+ u8 R2 O6 o# d7 M, J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ n" n+ t/ Q& U+ i5 a; M% g& zbegin P_induction arriving- h2 }, n6 G, w: n- Y* q1 F, A  M
    clone 1 load to P_pick(A_induct)2 A5 y, v$ f: H
end最大的系/ X- T/ s8 {8 Q* D6 }1 _$ b: i' I9 m

" q' D5 f6 p# R3 l3 h  k& y% dbegin P_pick arriving
1 J7 d4 o. O( q0 w& d- }9 B4 m    set A_i to procindex * 10 + 1
6 u" F$ k) Q0 |+ H- W' V    move into Q_induct(procindex)
/ Z' t# ]) i: l/ q$ D7 O) B2 w9 g    move into pickaisle.induct(procindex)  Q5 v6 P/ c$ X
    /*check the type of pickaisle.induct(i), for your last problem.*/% L0 N1 q) V/ W# ~4 Z; s
( U5 @1 N+ e6 }8 [5 `
    while A_i<=30 do begin' |0 ?" u  A8 R% y; C/ x
        travel to pickaisle.con(A_i)0 q: \8 Y3 m% @; h6 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. W. u8 s, A+ K. T- A& d+ A        else wait for 10 sec, Q! q! x; x" {2 k! M" v$ `
        if A_i=A_leave then send to die  O% d9 J( L. @  K
        else inc A_i by 1
' i* n. U, t" X    end5 R- A/ @! N3 y
end/ ~. ?! a# ]5 h# Y

: Y6 |  J5 F* S* m1 w其中的procindex为整形,代表当前process的序号。$ a7 t: P' P# s% m( M
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, 2025-9-18 22:22 , Processed in 0.016522 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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