设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13240|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 J) C8 f" Q+ I, b8 i' V) w" {' P3 ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' p% J  p( N6 w& h5 q. ?! U

, w, b7 T$ d7 o- j! `begin P_read arriving! w. t0 H' h4 W" R( w' x
    while 1=1 do begin
5 {  X* T& K. O9 `: h/ P& F. x! [        read A_tote from "data.txt" with delimiter "\n"
  L  ]. Q6 r! R$ w        read A_time from "data.txt" with delimiter "\n"
/ `2 M# \# s) r# Q! n( h6 e        read A_leave from "data.txt" with delimiter "\n"
! X# F: f7 L& M' X3 d        read A_picks from "data.txt" with delimiter "\n"- Y( t) v  B3 _
        set load type to A_tote. V' n2 K7 k$ j" E2 x
        if A_tote="tote 1" then set A_induct to 15 n8 e7 n: ^3 c- w
        else if A_tote="tote 2" then set A_induct to 2* b9 [+ {: X* r
            else set A_induct to 3    " g: p6 B( Y* ~( j- x% m  O
        set A_i to 0
1 Y/ r% S! P, u2 h4 R$ o/ m2 v) B        clone 1 load to P_induction2 w3 T; x: [9 p6 a5 h$ H2 _# y: j$ s
        wait for A_time sec
& {. f4 x5 k8 L0 Z3 Z9 A5 w8 v    end7 V# k; C. `- W6 K- h* H$ ?/ r
end9 i. |, y9 P9 @1 \. I0 r& Q6 G
. S2 l; t4 H6 q+ C! `
begin P_induction arriving
& J( A' R: Z" }& ^    if A_induct=1 then clone 1 load to P_pick1! y- u2 R2 L3 O5 d- @) k) x& o
    else if A_induct=2 then clone 1 load to P_pick2
+ u, t, ~( h/ d2 j( x        else clone 1 load to P_pick3
% S, _- k1 ]3 p+ R8 e- iend
% a/ y3 n$ o8 y1 B; w
  E' |. W! N/ Fbegin P_pick1 arriving
& N2 g2 V1 C6 V    set A_i to 1
7 ?  ?4 A: ]$ M8 ~6 R) _4 u    move into Q_induct1
+ P# r* N7 S+ w    move into pickaisle.induct18 `% j( @# ]5 o/ e2 ~: L% V
    while A_i<=30 do begin
  {' @9 K- K8 f, L2 ]: }# l/ e        travel to pickaisle.con(A_i)2 s: |3 z+ a/ c! Y  {" `! R! P* I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; b; _( L3 [; y3 u8 \
        else wait for 10 sec4 H* W- `8 f) ]; [/ `, _- s
        if A_i=A_leave then send to die
9 y3 o# T2 j: |2 i* l2 v) M7 D3 V        else inc A_i by 1
. h4 x! Z0 k# g. p2 L& D    end0 W2 C! l$ R8 |, G: b
end1 _/ L; r* \0 s8 {

, q9 R; m: P8 w' L; X- m( `* a% cbegin P_pick2 arriving% m2 |0 P+ I8 D% C4 W
    set A_i to 11
* i9 r5 H' n; Y    move into Q_induct2
# ?/ w9 ]4 P+ M+ _" e    move into pickaisle.induct2
2 T- {8 P7 O" `* F    while A_i<=30 do begin$ D& w& F) B2 i8 L2 \; x/ r
        travel to pickaisle.con(A_i)
. y5 W/ {+ G" d" B/ Y6 c% r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" x+ ?. K9 `1 q, U        else wait for 10 sec
1 j" t1 H; p$ U        if A_i=A_leave then send to die8 t# t+ D6 d) G+ _* m
        else inc A_i by 1
5 W- A+ p1 F+ Y    end& |4 q( V$ b/ @) L; p5 i" c
end
6 \8 x& S' b, w9 H6 t$ l) r: ]5 X2 _
begin P_pick3 arriving7 y6 s: |. y  @( D. `* E
    set A_i to 21$ E2 q' H# `: @: e
    move into Q_induct3
0 R9 [- M% R! E    move into pickaisle.induct3. e2 E/ _$ {8 P; {
    while A_i<=30 do begin
& A: O% j7 _2 N: ^5 x: V        travel to pickaisle.con(A_i)1 o; f, ^% i' x5 q) E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 z$ ~8 @) Y) ^% k- t6 w" j4 k
        else wait for 10 sec$ Z' X% @3 j7 j& X$ i7 S$ h0 @
        if A_i=A_leave then send to die; v+ e5 F4 A: a% g& C" t, F7 R
        else inc A_i by 1
) B  L& o8 X* X3 Y/ J/ j    end
& ^/ K# ?# s$ L8 bend

最佳答案

查看完整内容

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是个什么东东?& Z6 `2 B. \# s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& ~5 x$ D6 {* b+ \
) s8 A! L' l5 m& u7 \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: e) P6 U  Y6 a% X
) l. _+ |$ x  ~; g/ \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. W& V: R5 |' N: y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. |! X% L4 ~) e( E, A. Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ h" Z- U9 W4 d3 g- L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 M" [3 l: ^) g* f& I& O* d2 x
begin P_induction arriving4 ~, V9 \0 I, p0 {! u0 V
    clone 1 load to P_pick(A_induct)( c' ]1 ]( J  |0 B3 v
end最大的系
* U8 \( ^* V% v2 h9 v
) I1 N3 P" i  }. e4 Dbegin P_pick arriving
  Q7 d1 ^" v, S' S    set A_i to procindex * 10 + 19 M/ C( x3 Y. C+ T$ ?. l& M
    move into Q_induct(procindex)7 c. G' P" Z8 `: b& J9 O) b0 ]
    move into pickaisle.induct(procindex)
  T" I- Q9 J5 c3 [) ]* c- G: W    /*check the type of pickaisle.induct(i), for your last problem.*/
1 m' _/ M1 Y) A: M8 r7 e8 \1 h0 L( g8 ^, I! I2 @7 G+ i0 l
    while A_i<=30 do begin
: |4 ?. p$ W/ W7 @% \        travel to pickaisle.con(A_i)
. {1 V1 Q; E% D& C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- V- |, H' X9 [" i. {/ Z) S        else wait for 10 sec
, h4 S& o. F5 q) {% H2 t: ~0 g        if A_i=A_leave then send to die
1 E, ?- L0 A! g4 f4 H$ d! z9 b/ c        else inc A_i by 1$ I& P4 }( P& B8 f! p+ p  g+ s9 V
    end
0 U& F$ x' b( S7 O: B* B0 Aend! ~: c2 H: q, W; r
, b7 x0 S2 h% J& d" t
其中的procindex为整形,代表当前process的序号。/ B. e5 V+ [3 b  d7 i
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-3-29 11:53 , Processed in 0.016422 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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