设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15231|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ ?3 a9 l) k! W! N2 Q4 A, p1 {/ q% Z
$ p/ K/ V" Z( S$ t: P3 d% p! ~# 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中的数值,不知道会不会有什么不妥。  m  m% [4 S) d- F8 {" q2 s

" x. ]6 L, H% B) Xbegin P_read arriving" H# m7 D! }( n2 q" |
    while 1=1 do begin
  V1 T; z) E- X/ k+ |% j7 v( O        read A_tote from "data.txt" with delimiter "\n"
( G) q, `4 R1 F- A, M# x; J        read A_time from "data.txt" with delimiter "\n"
- v7 s2 e5 }9 M, Y0 w6 E* B% D; B, I3 m        read A_leave from "data.txt" with delimiter "\n"! W7 J1 n( a5 d: R" h' z5 T
        read A_picks from "data.txt" with delimiter "\n"
6 y% j- ]& U+ b2 a        set load type to A_tote  \5 W" W# w/ o" e9 E' L& z* ?
        if A_tote="tote 1" then set A_induct to 1
5 ]. N# }6 |/ R8 a* O! r        else if A_tote="tote 2" then set A_induct to 2) _) J# X; j+ Y* H3 i- u" e( I" U
            else set A_induct to 3   
+ n: n- c1 U+ V6 B, T* z$ Z        set A_i to 0
6 _+ ~+ Z$ u) O4 ?2 [        clone 1 load to P_induction' s4 h" I: N- I5 t  {
        wait for A_time sec
) k& a8 H0 O! i' L    end, [" l2 L' m) ^
end5 ?: P) H6 {8 |* c5 j: h
5 @7 r) a% Z6 {- l  ~) G
begin P_induction arriving2 x1 @. W/ Q! n  U8 s$ e, c
    if A_induct=1 then clone 1 load to P_pick1- H1 l8 y- A1 t3 V2 U
    else if A_induct=2 then clone 1 load to P_pick23 y, z" h/ O" d/ X: V
        else clone 1 load to P_pick3
& |8 z; n1 I+ L$ D/ Lend: h' F2 z9 ]$ k9 \! ?
% Q: [0 X! @' q: H) Q+ P' Y
begin P_pick1 arriving% O2 A; S, H' {3 ]) B9 _; O! u
    set A_i to 1
* t7 s9 N  ?( n+ Q0 t" U( o" k    move into Q_induct1
& }' q5 M+ m1 i" \' K    move into pickaisle.induct1/ N. x3 ~( a) z4 `( J
    while A_i<=30 do begin+ _1 H; T/ d  ]3 T7 B* ]: j& @
        travel to pickaisle.con(A_i)
+ f& n& ]  i( x5 o! v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ w: s1 O) H, ~* Y) O6 q/ S
        else wait for 10 sec
) X  |8 ~' F, T6 D+ }9 b1 B        if A_i=A_leave then send to die4 s, B. Z8 Y$ F( Z" f
        else inc A_i by 1
. D* O$ t) u# A3 \% K' b9 G    end3 a& K* F3 [# F; G
end
* l: g3 H: G$ I; K7 A% @8 e% v5 h$ e/ d7 R8 l# q" B" A0 t5 K( `8 a
begin P_pick2 arriving7 r$ x$ o) Y8 Y- i& h0 _( i( K+ h) q& i
    set A_i to 11& C- T  {+ P! P9 V0 j6 }" ?
    move into Q_induct2
1 R) `& c, Y8 Z2 i' l3 g% X  [7 A" Q& ~    move into pickaisle.induct2
; A' |- x6 e7 H    while A_i<=30 do begin/ R, ?; z' E, g1 N, ~* I; |
        travel to pickaisle.con(A_i)( f" K# N& @# J. G% e) O7 \) f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 [2 ?8 r! A, N9 u# C1 A
        else wait for 10 sec
; C# z! @2 j$ d% p+ b        if A_i=A_leave then send to die) n- i% ~. }3 b& T" L
        else inc A_i by 1
1 ^6 g. P6 V$ d3 H    end
3 G, l$ q2 s3 o9 ~end$ ]- ]) T3 _/ T( Q$ _
2 d9 y" D' q2 P6 g4 [
begin P_pick3 arriving
6 m" r+ @7 M( y( [2 d* W. v    set A_i to 21! `4 t- o. r, ^( j, t
    move into Q_induct3
8 Q7 j" V' D3 \' w3 a! T% \    move into pickaisle.induct32 C. @, `4 p' c) U/ U- S3 b0 U
    while A_i<=30 do begin3 ~2 ~. k% a# d" n9 d( ^) s
        travel to pickaisle.con(A_i)
( O, E' Q6 T3 Z/ Z% c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 _) S, i& z/ s$ d8 ^4 U% ]% [        else wait for 10 sec5 j; m# h1 e4 {6 S* a8 t! _
        if A_i=A_leave then send to die
9 U5 ?  m! q! B- n" {        else inc A_i by 1/ W6 F3 ]( f; U! D6 x
    end  X( n: o0 C; T! n: h9 S1 S
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是个什么东东?- U5 U8 P) [# D4 M) V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# }7 z3 F5 V) v

. Q" R$ Y9 E( H1 D4 F" g; g3 W: zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 i  Y3 y; b! h/ R
" t' L" @! c  X/ z5 X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 Y* f: B$ B3 n3 P) _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# w0 R$ O. m: `; @1 D- K1 M. t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' h; U2 a, \6 H& A* E5 u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) o2 b' {! R+ r0 D& ?9 f
begin P_induction arriving
" q( [9 s( y! f2 H" b/ z3 K0 A$ E    clone 1 load to P_pick(A_induct)
' ]6 d* T9 h! A) s8 H7 G! W0 j. T" lend最大的系
& O* Y: i% @; z2 O) {' g! x# j
1 c- c+ H& V) w8 T# H9 Obegin P_pick arriving
3 ?/ f" g+ R) k' P    set A_i to procindex * 10 + 15 b4 Y  p! h! A
    move into Q_induct(procindex), W6 M& o3 }" P5 R$ U4 w
    move into pickaisle.induct(procindex)7 J0 t8 u! O8 b- Z& _3 {6 [
    /*check the type of pickaisle.induct(i), for your last problem.*/- R8 ]! ?7 d" Y# M1 j7 s+ e
( G6 D$ t# o7 H3 {; E
    while A_i<=30 do begin- P. n5 [4 y( |( H% E
        travel to pickaisle.con(A_i)
" S( D' @$ p; Q0 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- I0 {9 W/ Z1 E4 d: g
        else wait for 10 sec0 B4 n4 f4 R* i% x
        if A_i=A_leave then send to die
3 q" p  {; C$ i4 |+ v2 W% r        else inc A_i by 16 _7 e9 T% k" u7 [4 {6 A( c. A
    end
: E- S- n/ I& n& \end& W. b/ \% {$ s! g0 V+ y: `  z
9 @2 T$ k3 W% M; W. n+ d
其中的procindex为整形,代表当前process的序号。
" u  f/ Q1 [/ }0 y! m6 q2 cstation和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-8-25 23:23 , Processed in 0.019715 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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