设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13619|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* i3 y" k9 b# C2 b7 }$ J2 S
! D% q9 X5 |! z# Q7 K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- Y- B7 }  v# Y% ~' p# u# u6 `; T8 I- x8 z5 t
begin P_read arriving# d+ j7 a8 \$ d8 l
    while 1=1 do begin3 i* g) }7 R2 g& W
        read A_tote from "data.txt" with delimiter "\n"
5 t9 N  A3 p+ [/ f. x$ [        read A_time from "data.txt" with delimiter "\n"4 G# n! [4 g7 Y4 T& \$ P
        read A_leave from "data.txt" with delimiter "\n"/ _! w- J  A7 B- D
        read A_picks from "data.txt" with delimiter "\n"
# F0 y5 C$ R+ G        set load type to A_tote+ |8 i) s4 `7 ~8 {" U: F
        if A_tote="tote 1" then set A_induct to 1
3 u% ]5 j. {4 ~5 g9 q+ O! I, ^        else if A_tote="tote 2" then set A_induct to 2% ^% d+ d4 k( z& C0 Y
            else set A_induct to 3    # e1 e  K; N- P" V8 H& D9 ?' G( ^  X
        set A_i to 0
/ D# `, R, V5 S- U        clone 1 load to P_induction4 g1 ~& m4 A4 _5 w2 C
        wait for A_time sec
3 C  Z$ `8 W# |2 _: z2 u    end
4 Y  J: D. _6 J9 p& O* E1 `# Qend
, g. S- V' y2 a6 ^0 X, y; k% h) j8 _
begin P_induction arriving1 d1 L3 E6 p' ~; H! W+ i3 J7 c* M
    if A_induct=1 then clone 1 load to P_pick1% b7 w6 Q5 W. Y4 o! o" U
    else if A_induct=2 then clone 1 load to P_pick2
8 Z! b9 q* ?) Z5 M1 w9 S        else clone 1 load to P_pick39 M. e5 s; z: ^. y; \3 T
end
2 F* Q, s( I, g. f2 B4 P6 Z4 I
, o  j" W0 V; [6 ~9 @  Gbegin P_pick1 arriving8 e7 m% _$ h4 n' U3 X) l* X8 z/ f
    set A_i to 1
/ u6 V4 n% ~' n* p* E9 F    move into Q_induct1
$ }( c; T: o. {. Q6 k, @8 e    move into pickaisle.induct13 i, X* I$ r0 }1 D/ {6 ^9 O
    while A_i<=30 do begin( _, I- {, d+ u" K
        travel to pickaisle.con(A_i)" B9 S, g& I0 m6 Y& a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G* @* {( C; D# `. {- C
        else wait for 10 sec0 g$ V) o$ l  t+ O8 F0 c
        if A_i=A_leave then send to die
6 z2 j6 o9 N5 e; `; P# v; S        else inc A_i by 1
. T' p! t4 n# g8 h. x. H7 n    end5 N6 o# K- t, o
end) r  X7 [/ J6 O$ k! b
& |" R! D( D& k; R, ^* U9 P
begin P_pick2 arriving5 V* T# |% x2 @. g. O& q
    set A_i to 11
5 A  S0 F9 h* U4 K- S. U    move into Q_induct21 @5 ~0 p7 u6 N* U
    move into pickaisle.induct28 A" k" b" g" p+ Z- E5 v
    while A_i<=30 do begin
* i3 y' G/ i+ e6 r: x1 H7 [        travel to pickaisle.con(A_i)1 e/ g9 M2 U9 U1 G, @& p2 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 C+ m- `2 L# u4 L% E8 ?        else wait for 10 sec# y8 _4 u* t7 @( V$ `8 M3 P) X
        if A_i=A_leave then send to die
8 i; }& X% z8 B0 M+ P        else inc A_i by 1, Y7 p: y& r% d. v7 @) p
    end
- G9 Y/ U, \  O' L& E. ^" Fend. b! a. }2 F' _

) i6 o$ x; A2 E. M" q( D9 H0 Cbegin P_pick3 arriving2 l& e& {! s% d. J% V$ _
    set A_i to 21
4 s( x" S7 v8 C) N4 B1 C    move into Q_induct3# r  q3 }, Q+ t
    move into pickaisle.induct32 G$ x) v2 C( A+ u$ c
    while A_i<=30 do begin! I; U/ |7 K  n0 v/ a" M
        travel to pickaisle.con(A_i)
7 q4 l/ A2 _8 \! _9 z$ |" c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 n6 Q& e5 e- H+ E) B
        else wait for 10 sec
. p) j- s8 O( ^  `        if A_i=A_leave then send to die
, y% F% k+ L- N# I9 V5 k. k        else inc A_i by 1
0 q1 ?/ p( n' q. L    end0 _* J* M! P- J* u. N* F
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是个什么东东?
# r& E6 Z, c5 Q+ u0 k, [2 ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 ^; n' C% {3 V3 e
2 Y8 y! H& ^+ {3 o+ sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ i" [# S! R1 Y: f( w- a2 O2 H( R+ ]5 [, ], q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 @4 s0 U" }. z. E0 x
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 Z2 h; f+ G7 d! K  n5 Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: h7 Q4 \  Y; l- ?9 j3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" T( G3 u: b4 B( H/ ~8 A$ gbegin P_induction arriving0 z# D7 r5 B" X% O
    clone 1 load to P_pick(A_induct)
6 I  ]- N- @7 Y- Hend最大的系% W3 C$ U, _0 d/ D5 Z
7 O6 [" f' t- z6 b" ^& I! ]* T
begin P_pick arriving1 [( k- N" U' O. X* [
    set A_i to procindex * 10 + 1" n( P, O: H" e! b
    move into Q_induct(procindex)( @# b5 w+ F/ A0 p4 N  L4 T
    move into pickaisle.induct(procindex)
8 c( |6 t# j6 h6 v' x7 x& `    /*check the type of pickaisle.induct(i), for your last problem.*/' V1 H! z4 g1 @% d
3 d5 |8 O: Y% j* {; u+ A- Y0 t
    while A_i<=30 do begin/ ]6 k  Q# i. q  Q! W! ]
        travel to pickaisle.con(A_i): S" W4 P! h  U" v) J; M* s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 o5 V& j1 A" R% N- g8 A        else wait for 10 sec& v  [4 y- Y/ }2 Q6 {6 W) n) z
        if A_i=A_leave then send to die/ m4 z+ G' u' E, L" p8 X+ \
        else inc A_i by 1
3 u8 R% }( F$ @8 T( M    end
( q5 t1 O3 E/ N" send) o1 X! R( z! o4 u- s

. b" n6 Y2 g/ t0 L9 n其中的procindex为整形,代表当前process的序号。
' F# W5 `  _6 ~/ N5 F/ e  Bstation和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-4-24 16:28 , Processed in 0.015627 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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