设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7799|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ I0 Q7 z) G4 g6 f/ l0 A

! r! E. U: P/ P' o9 I+ Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 J4 m: F# N) `% n$ [( a; _

; ?( R: w/ b3 x  i* ]begin P_read arriving
* A# W: T3 E' M! O# q% y( t/ i    while 1=1 do begin. h% P% k( t  u# t) n; a
        read A_tote from "data.txt" with delimiter "\n"2 X' x' n0 B+ s& _$ w3 Z) |
        read A_time from "data.txt" with delimiter "\n"
# J  ]2 l' X$ d$ x8 X. `# q        read A_leave from "data.txt" with delimiter "\n"6 J. V: B8 g1 ~; s; ^
        read A_picks from "data.txt" with delimiter "\n"" C6 o6 L* o4 p- x
        set load type to A_tote
9 i' _1 p: y9 w/ o  X. i        if A_tote="tote 1" then set A_induct to 1
* w1 y& i( t0 j2 w6 k( U" I        else if A_tote="tote 2" then set A_induct to 28 r9 D( }7 [+ U& n4 l
            else set A_induct to 3    ' }- S$ x$ u0 T. z
        set A_i to 02 \2 J2 k! G. g' i2 C
        clone 1 load to P_induction
. |9 `( G4 R8 ?! |        wait for A_time sec
1 U( |2 B' u3 l0 Z" W$ W8 r    end, i* I% {; J3 z2 T
end
) W! P6 v9 w& F3 S& @" U$ U! a  i3 C( D+ |7 b% ~* B
begin P_induction arriving
; t2 N8 V' D/ U    if A_induct=1 then clone 1 load to P_pick1
/ o/ q3 A0 o9 F    else if A_induct=2 then clone 1 load to P_pick2% X- f- m& `  g* X
        else clone 1 load to P_pick38 p2 i. t- |# W6 _3 T* g- ~# \5 P
end% O& W" x- j7 a6 g
# c' l& D9 _  t  ^* [; D% i
begin P_pick1 arriving
" d0 r1 `/ A1 M1 d3 E. y    set A_i to 1
0 g6 K, d  |$ d; m( H    move into Q_induct1+ W0 o9 q6 h4 u) P* a
    move into pickaisle.induct1
$ E2 j) ~: M/ p( O* a( d2 a9 L    while A_i<=30 do begin, L1 J2 k3 z3 b& M0 u; C# U
        travel to pickaisle.con(A_i)" ~  ^9 e, b4 B+ m2 \+ E. S+ ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e  @2 L0 C! ~* F
        else wait for 10 sec
( v5 K. [; X, C% m, h; t( i        if A_i=A_leave then send to die
( f8 @3 T2 Q1 }7 G2 u0 Z) _        else inc A_i by 18 L; P( |1 I' E1 L- d8 r
    end
& p$ s* c6 F7 Send6 f) j, N/ S4 L5 ~: J
- c# Q; e. B4 C$ Z9 Q* I
begin P_pick2 arriving
; Y* |! e0 P$ H2 H# D3 @* b% r    set A_i to 11
5 ?& T4 g1 O& Q4 F1 f; s    move into Q_induct2. {& R6 c2 q4 z1 _7 I
    move into pickaisle.induct2
. G& T/ ?/ V5 O4 r9 b7 G    while A_i<=30 do begin
; n  d) h! y& {  N/ c( k: E/ O        travel to pickaisle.con(A_i)" [- A, j/ Z. x; }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 t% T# \: Z/ r6 `- e# |3 K
        else wait for 10 sec! L+ I" X. A" W; a& a
        if A_i=A_leave then send to die
4 @" t/ p0 V4 `2 J# _, V0 R; ]/ ^        else inc A_i by 10 ^3 _7 S& u* P% H4 w1 w
    end
) l+ y# v4 ^7 Yend7 h0 L- A& x' o5 `  o* F) g. {) e- v
5 r, J' j  D  Z# K; c8 e  f
begin P_pick3 arriving
  E- R7 i; K! B1 [2 e& a    set A_i to 21
7 E! c& r6 y8 r+ J2 _    move into Q_induct3
: `; ^1 z, f; m" F) l, c; Z    move into pickaisle.induct3$ ~  \1 A1 r( w- D4 t
    while A_i<=30 do begin
9 }  K2 M' }! X' B  a& U+ c        travel to pickaisle.con(A_i); l' y. w  ~8 n- l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 i7 q) N! a. l6 f- T
        else wait for 10 sec
# L5 A, u$ T9 m        if A_i=A_leave then send to die
+ o6 L+ `7 f1 t' o( X' j        else inc A_i by 1+ h9 E. r' Z. a
    end
: c: Q. s1 A3 T4 e' aend

最佳答案

查看完整内容

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是个什么东东?; z9 v# _( Q7 m$ b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" \3 v. u/ C6 m3 d7 [, \0 Z% F' {3 B
' \# d* Y* W* y7 A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* f' c4 m2 x2 s$ n$ a# c& ?$ `7 ^4 |- H; G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 _( l4 g+ e) f( t; O' c
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' m) _+ b, D6 b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. L7 {- m( N; ?/ p( a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 O1 D6 A+ H+ t
begin P_induction arriving
5 A' _9 v! e5 y: o0 j. W    clone 1 load to P_pick(A_induct)
: M8 b* K  m( G; ]9 }* k: b; rend最大的系/ e9 Y9 b# X, f

3 W, x3 Q& s2 v% kbegin P_pick arriving
8 c+ P7 Y1 \9 }  X' w- l; u+ p    set A_i to procindex * 10 + 1
; S" [1 [- u7 m$ o+ h8 P/ Y2 p1 s    move into Q_induct(procindex)7 R: ^5 f0 m6 F2 B* [
    move into pickaisle.induct(procindex)
& L4 x9 a4 _3 M    /*check the type of pickaisle.induct(i), for your last problem.*/, O7 O# C. M6 D5 i, z

/ e( z2 `, f0 X    while A_i<=30 do begin2 I+ T) M0 F. C  F! X6 `
        travel to pickaisle.con(A_i)
) H# C( c; [# e! |6 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 I" @: i7 r5 c# z% j! _4 g6 u5 f
        else wait for 10 sec$ G: A8 G6 z/ Q+ a8 R. l* `9 f7 ~
        if A_i=A_leave then send to die
/ r& Z0 I6 ]8 [5 z        else inc A_i by 19 x' F  u  P' d- T0 G& D2 C
    end; C# n1 ?. N  f4 a
end
, j4 h1 \/ x6 ^/ C! V* g1 P5 l2 z0 W6 A4 O1 q0 h$ ~
其中的procindex为整形,代表当前process的序号。
' H* X! ]7 a$ c. K: [: \- qstation和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-2-2 03:34 , Processed in 0.019234 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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