设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13948|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 X/ P4 K) d* x9 s+ }6 Y! X! W: D/ V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# e: O( ?0 G* {% N  _$ _( V1 }

, O' b. v( A+ d& ybegin P_read arriving
' K; U, N% d7 C* j2 A    while 1=1 do begin6 n& Y3 @$ m/ u* P
        read A_tote from "data.txt" with delimiter "\n"4 W7 K" i, A3 U  G- b7 o
        read A_time from "data.txt" with delimiter "\n"
/ Q" N6 B) ?  {* \. `! d/ l- p        read A_leave from "data.txt" with delimiter "\n"0 R' a) p6 k/ k" |  C
        read A_picks from "data.txt" with delimiter "\n"
$ c' l' n- j$ O6 b, J8 m        set load type to A_tote2 o2 g1 s8 V0 m- C5 O8 {( D: Q
        if A_tote="tote 1" then set A_induct to 1$ d$ M$ F! L- U. ^
        else if A_tote="tote 2" then set A_induct to 23 K# S# @  F/ O$ @/ t
            else set A_induct to 3    2 o/ ^& L! n9 h( n  s
        set A_i to 07 \/ P3 l4 a. n1 g2 `
        clone 1 load to P_induction
$ N2 W0 Q$ K0 q1 {        wait for A_time sec' ]! |+ c2 U4 w2 A+ Z6 X7 |; \
    end! R3 T9 R$ l) u8 m
end* a2 C0 R& o/ c7 l! ]3 H, _

, v# m9 i, B: ?begin P_induction arriving
# @6 ?$ n1 j$ V+ N* B    if A_induct=1 then clone 1 load to P_pick15 H! t% f+ B1 H9 s) @
    else if A_induct=2 then clone 1 load to P_pick2
8 T0 }2 q: P  G8 K: j        else clone 1 load to P_pick3
  G* k; j6 ]* kend
% I1 [) t# e0 Y" j, J2 J/ c2 }0 Y" R, F5 p5 m6 Z5 h2 P$ g# e
begin P_pick1 arriving
8 _+ O* _& N% v    set A_i to 1' q7 J4 c4 Y8 B5 i$ J
    move into Q_induct18 q( {8 D" j/ q
    move into pickaisle.induct1' k9 F0 j8 q2 N0 f) j" c
    while A_i<=30 do begin
0 {6 }* u7 c( b        travel to pickaisle.con(A_i)- u9 N+ T. M  }# j$ t$ a- P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 t3 M0 Y: y& n& Y2 Z4 ~
        else wait for 10 sec
3 K) L9 p0 \3 T        if A_i=A_leave then send to die3 v7 I- L, `0 {" ^
        else inc A_i by 14 G9 T" C) F2 `( u0 [: R! g8 c
    end4 e  d3 @0 a4 P7 U
end
3 \$ A2 b1 Q& r6 W: U4 L7 `$ _
7 d; f" |% |: a1 j- N& W" s! ~begin P_pick2 arriving- {8 x2 Y. w  D8 q2 ]. ^1 _
    set A_i to 11& H5 @% T% S2 B# H4 ~( u
    move into Q_induct23 d% b5 {4 [5 c# ^% P4 h: d
    move into pickaisle.induct2
3 U& t: u4 V2 t7 W" b    while A_i<=30 do begin
1 M6 c8 X& f- B% m        travel to pickaisle.con(A_i)% J: I2 X" D( k# V. T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ?4 [! p  y& g& L$ a8 Z' E3 A, x        else wait for 10 sec. w! ]  q* \, p" V" G) i, m
        if A_i=A_leave then send to die
7 m$ F  `3 _2 A' ]        else inc A_i by 1
) T) F7 e- b/ ^: V, P6 k0 o    end
& ^8 M5 N* N7 F7 @) Vend- W  ]; p. O9 o

. o" ?: G7 r% O9 u& [begin P_pick3 arriving
& l# r* l$ T) f2 O" X    set A_i to 21) l2 b3 h; M$ H* o
    move into Q_induct3& T7 G. H: z! {& b
    move into pickaisle.induct3
0 b4 o6 U$ c$ E/ c3 r7 ~/ q: V    while A_i<=30 do begin3 ?- R4 I) b: P' T+ s  V; j+ @/ h8 R
        travel to pickaisle.con(A_i)
, [$ H+ i: X0 T& f& K" F; n" u% T( e4 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 |/ w( u; P  ?        else wait for 10 sec8 U7 X8 ]8 }& ^0 O9 b( F* O
        if A_i=A_leave then send to die$ m3 U0 W* h) `) C
        else inc A_i by 1
! Y  J4 P2 O. J    end
* g4 l- A, t5 {/ ]  H9 B1 \1 Uend

最佳答案

查看完整内容

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是个什么东东?
. N! n7 V2 E/ Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) i$ Y3 U0 _, l" K" M7 \8 _' G
, B6 m9 R8 V! O( K7 @  o. y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ s  e+ p: y+ ?2 ?. Z
$ E; `& l# w% d: R+ @4 X; `* ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 R( Q$ x0 T( g5 j" N, B/ a. q: z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( W. k9 i2 c5 k6 B. i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 ~; O0 J' j8 C" c0 h6 j! t
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 }0 ^/ i2 p' @! H' T4 U2 jbegin P_induction arriving* Y) n. ?  w9 g
    clone 1 load to P_pick(A_induct)  h. T3 t0 F0 n
end最大的系
8 ~: T/ c4 I4 `% Y  |) r) G: f) L- c* X1 Y5 V+ h  \
begin P_pick arriving7 P2 C6 n( ?) h
    set A_i to procindex * 10 + 16 t: Y: Y! ~( N" d; T
    move into Q_induct(procindex)) c8 R+ G, k2 U  H& q' ]* I
    move into pickaisle.induct(procindex)
! N) a) _. C. S- Z8 F: \* T    /*check the type of pickaisle.induct(i), for your last problem.*/
, u+ t, `& C, v  f; R( y
' t/ c% O' @3 y$ }    while A_i<=30 do begin% T- f3 E1 f' H( h
        travel to pickaisle.con(A_i)
7 d# _# C- {+ @  @+ b. I! Z% ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 H! e& i5 A: n7 \' o
        else wait for 10 sec8 j8 p5 ?: ^. O: w+ R3 I* L5 x
        if A_i=A_leave then send to die/ ]/ s) T0 H6 n. v  Q0 v  P) {
        else inc A_i by 1% V0 E  K2 {8 Z  W" y2 w: @
    end
+ p! ~, Y. y' ?( Cend
% _9 ?* {* Y2 ~4 Y, }# p/ f, t$ o! {! r
其中的procindex为整形,代表当前process的序号。; M) r0 l' g$ t  O
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-5-23 00:24 , Processed in 0.019475 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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