设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14131|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 u6 h7 \, m) h2 d) Z
& `! j* n+ Y4 `' O4 V. b$ H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 r1 ^$ D4 L  ~/ R' V  J
6 K" h' \/ H) N2 x7 b3 x2 I- Y& p
begin P_read arriving6 y$ u9 N2 S3 r5 V8 M6 t
    while 1=1 do begin/ C" O$ S0 e# a( x  P" V
        read A_tote from "data.txt" with delimiter "\n". N- A; k9 I1 y" Q
        read A_time from "data.txt" with delimiter "\n"
/ @: V8 m0 e" z4 d" \4 t  z; k& x        read A_leave from "data.txt" with delimiter "\n"/ N+ s3 W$ O1 b: Q
        read A_picks from "data.txt" with delimiter "\n"
3 S+ P$ A  h6 H1 w7 Z# a& W8 E        set load type to A_tote
# N" q  q8 J( x6 l        if A_tote="tote 1" then set A_induct to 1
/ f/ Y% ^% A# Y" j  C2 s, z        else if A_tote="tote 2" then set A_induct to 2* V) C: r! J* y7 c3 W
            else set A_induct to 3   
5 A, O! r' ?; _' ~        set A_i to 08 V* @7 P- y* o" I5 F' H0 N
        clone 1 load to P_induction
- m5 T( U1 d5 p, ~8 v* D- L. D9 ~        wait for A_time sec1 t% |" A' I# A; m
    end
9 O- _. |0 K) S& \8 g' @& R2 k, Xend$ h+ C$ q7 {7 o  t' X

, I4 w/ I; B# P3 {2 Q3 T+ j4 `begin P_induction arriving
& i. V" [* C+ V* {% w0 W& V. ?    if A_induct=1 then clone 1 load to P_pick1
* I# V# x, D. T8 w    else if A_induct=2 then clone 1 load to P_pick29 H' p7 h" }9 }2 a: Y5 m
        else clone 1 load to P_pick3
; w' v& A! b  Hend
( Z% \  t! D3 q+ l5 M3 Q
7 @" \2 Z' F6 J3 a+ [$ Y/ y$ n+ l9 Rbegin P_pick1 arriving; a9 L9 A0 H! H3 {2 }3 E7 A
    set A_i to 1
& {, Z+ U- S% Q+ N- u# F  ^! o    move into Q_induct1
! ~( [0 Y5 C7 g; u; U0 Y  @    move into pickaisle.induct1* P9 Q1 N- w- ]! {
    while A_i<=30 do begin
( B) i, B1 M' k  ^$ I9 r- f4 n        travel to pickaisle.con(A_i)! P8 B( v, e- x# v. S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; ~9 o% S: j9 q: s5 w' l/ N, `; ~2 l
        else wait for 10 sec  |5 s$ M, [" h: a- r, P/ ?
        if A_i=A_leave then send to die
3 {& T2 v, b0 _& d, @1 j; I        else inc A_i by 14 r- `) t7 _: i0 U/ R
    end: u1 M$ C1 t. `5 d
end( l! d+ q) A; m: I1 a) B- M
4 z8 l( C, Z8 @% X
begin P_pick2 arriving
2 y. ]$ r' w0 t2 f4 N    set A_i to 117 e; U4 I9 s1 R+ K9 Q! a( t
    move into Q_induct2
" F2 p( s  q3 `1 A# Y0 n    move into pickaisle.induct2
# P! i( s: Y+ M1 s# `2 H    while A_i<=30 do begin5 H6 Y- }4 C' U) y, g. q2 M
        travel to pickaisle.con(A_i)5 X/ u6 t9 A3 g7 u- n3 b# j! |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ _* w$ e4 G* w# |- L' s
        else wait for 10 sec) ^! M; e4 c1 W4 I
        if A_i=A_leave then send to die" q, `0 r! ]) @) l8 S0 u
        else inc A_i by 17 w& P; u7 |$ H4 g( U6 B/ e
    end9 B% v1 ~' k' f# r
end
4 j1 s7 P; l! [8 |- t
* z8 ^8 m+ r! z# H  cbegin P_pick3 arriving. f: q+ u; O2 \
    set A_i to 215 W* E7 w; _9 t! v6 v' Z, V
    move into Q_induct3
5 m$ {7 \- S  g- L4 A+ M! k1 D& ~8 S; x: Y    move into pickaisle.induct3% a7 }5 N+ c( `5 Z0 V" O
    while A_i<=30 do begin- D; p! u4 q& o6 g
        travel to pickaisle.con(A_i)+ B+ |. o+ V9 E- d/ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" z# ~. h- E2 }
        else wait for 10 sec& n; r. O1 [0 Z) I$ A1 a( s
        if A_i=A_leave then send to die
, Z% F' U8 t  Q  c( f        else inc A_i by 1
7 R# U- S4 I2 ~5 W    end
7 c. u0 T! p& Y+ s! b3 |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是个什么东东?& O) k6 ]" n" S8 V. O; }4 i6 h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 [/ k* _5 ?. J; p, v5 ?4 W

  [% T; I: P/ B! e( y5 R( {0 q5 wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 o5 d/ R" V  Y: ]1 y$ z6 x8 j
& L0 K. V7 u! r) D* h
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ E3 j( d) F0 I, y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# h$ G3 P; a- x1 w0 `, U8 p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' x$ U- z' D+ {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ C0 N3 z0 C* Q! K+ q$ ibegin P_induction arriving
- b( H6 ?- t) p; j, N  Y    clone 1 load to P_pick(A_induct)
: C8 D7 K0 p6 }end最大的系; d. O: s2 P( V' @

5 x" i! R2 g$ ?6 x' a% b2 ybegin P_pick arriving5 k- N2 ~0 e' {. ^) B$ g
    set A_i to procindex * 10 + 14 h9 P* y# L0 u. c& D8 F
    move into Q_induct(procindex)* i( \  M4 a% d1 f
    move into pickaisle.induct(procindex)
  V$ u2 R( D) Q5 c$ {5 m    /*check the type of pickaisle.induct(i), for your last problem.*/
6 S+ F) b+ p+ O6 ]* U
/ u8 Z& ]- Y# \  F9 Y    while A_i<=30 do begin# z+ t  {7 Z# L1 S: ?
        travel to pickaisle.con(A_i)8 R( Q$ O6 g% F. u4 R, i! s. f3 G& |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) o! {9 _0 ]  ^$ t0 s' m
        else wait for 10 sec
' ^+ b( _" r. b# }% Y! y7 Y" e        if A_i=A_leave then send to die
5 j1 y% ^. X9 M+ _        else inc A_i by 1
7 N7 P6 u9 |  E8 C* w    end
$ @8 k1 w) o1 q6 g% Send. T- b! P+ u0 y
; F( U: q) u$ q" ]2 o
其中的procindex为整形,代表当前process的序号。
, [' w, t: G1 m  }% _! Rstation和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-6-12 02:16 , Processed in 0.023418 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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