设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15641|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& e- i" F/ Y" V# R! ~
( B4 U  E" ?- ~, Z$ V4 h/ W" `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ Y8 C; r0 C$ A- k5 t/ g7 @
" e  `" R; H1 k* Qbegin P_read arriving: M  u  o) p# S: V6 I' n7 |: Q  `
    while 1=1 do begin! ^: ]. m* M* U- ^' s' z" j" H
        read A_tote from "data.txt" with delimiter "\n"( X. `8 m* }8 T0 {
        read A_time from "data.txt" with delimiter "\n"8 z) @& |& s; j  A( E9 v2 q* I! a1 c4 U
        read A_leave from "data.txt" with delimiter "\n"4 K+ ]1 c# a6 T0 n( x# B5 D
        read A_picks from "data.txt" with delimiter "\n"- c4 d1 @7 k0 D! F
        set load type to A_tote
8 N; f9 G5 ^. v/ T. g        if A_tote="tote 1" then set A_induct to 18 a9 T) d; ?2 W9 c7 P. C, z
        else if A_tote="tote 2" then set A_induct to 2' O$ ~6 j. s$ Q' \+ ?6 @
            else set A_induct to 3    " a7 V: h/ J- A0 e; D/ f; l
        set A_i to 0
' I% X) E8 L5 L* _; j        clone 1 load to P_induction' B; j0 I8 i- F: f) n
        wait for A_time sec& Z6 t, K% A/ c# G& j
    end
/ \, p0 z, Y& |- Q% ]end( b. m1 m% n0 U1 u5 h2 t6 h) h) ]

$ i/ q3 o" U- p) F& Y) I/ Obegin P_induction arriving1 C6 Y3 o" }- ^* Q! K7 D( B
    if A_induct=1 then clone 1 load to P_pick1
. M6 p: h% X6 c0 ]: W* v* z    else if A_induct=2 then clone 1 load to P_pick2' V# ?' U+ D  B1 D! d6 U- B
        else clone 1 load to P_pick3
/ L& k$ h( p5 fend
  L$ n: v2 h  A" R
8 x6 Z) Z2 s& ~5 c/ u$ lbegin P_pick1 arriving7 R; D, V! f: m, u0 ~. O
    set A_i to 1& p4 ?. N* g5 I. z
    move into Q_induct13 z  p, Q6 E( t/ ]
    move into pickaisle.induct1
, [4 r0 Z0 @- {' c: v( Z    while A_i<=30 do begin8 t5 m0 Q) m! V
        travel to pickaisle.con(A_i)
2 m" }8 a( P! J( ]* [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- \6 M0 l" @8 N7 J; I        else wait for 10 sec
* C& Q. I- a4 D: `  d        if A_i=A_leave then send to die3 V* l" x2 F& {0 x- g
        else inc A_i by 1
. @3 `, O% h# {2 X    end( l( f- }6 K6 d2 N9 _
end
4 U$ _" Z* N: [7 t* _: l# o/ B" R+ V- M
begin P_pick2 arriving
# y# o' y" a; T7 g1 y    set A_i to 11$ R6 I5 M- U3 {' O7 y
    move into Q_induct2
( {: u7 _5 y) K5 r    move into pickaisle.induct2* w* k6 m1 ~/ w; w
    while A_i<=30 do begin
7 d6 ^8 ~: N" b" c+ B4 ?7 g        travel to pickaisle.con(A_i)
" u9 x! B# ]: K, r& s6 H! y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 f4 a! l) l& W1 L2 W
        else wait for 10 sec/ {6 j: s: c6 }5 C/ @" x6 C
        if A_i=A_leave then send to die
5 I% D: o8 n  }! m" e, y        else inc A_i by 1
1 x, Q" I4 L. m$ m    end
/ r) v" n& |+ |9 h8 P- y0 Yend+ I  N$ U9 p( w  g

8 `1 e: }" ^5 f. l2 C. Ubegin P_pick3 arriving
9 M! I0 v* R0 T6 y( Z    set A_i to 21
' i  z  q" V  N' l    move into Q_induct3/ ^. z- J* p. q( c
    move into pickaisle.induct3" E3 m! j* F: I8 i- I
    while A_i<=30 do begin
8 Q' U- o( ]7 F0 u; e        travel to pickaisle.con(A_i)7 [) \9 H8 W9 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" o0 ^" Y2 A) \, B- P
        else wait for 10 sec
& ~2 ]; M6 w7 s0 Y0 d- I; m& ?        if A_i=A_leave then send to die
5 P- H, c3 x' i        else inc A_i by 15 r$ S! n1 v4 H# }, K1 ^$ f
    end& q% R) _$ r) q4 H$ l% z+ e
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是个什么东东?
" ]" f( Y5 M: I  ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 }* m# V6 U( E: g: ?4 n
' g4 T6 K% D  c+ L- E9 P" b5 F# lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# F, b' m, q* M, \. }
' ^; j  ?( \) P7 C  Z% Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' y8 R6 c0 i* N, K; N- H: H  M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& G, G: K% k5 \( y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 ]* Z) }- R+ k& `+ l3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. h' _+ C$ \3 g  o" Q" e6 X, ?begin P_induction arriving5 b) N0 w" ?/ U6 x7 o9 \6 M
    clone 1 load to P_pick(A_induct)
8 @: U/ N0 F! V2 Pend最大的系
# P$ x2 n; G) r7 z! ?: l) h/ E6 u3 g- f
begin P_pick arriving* A2 y1 f% N& I  w1 R% c, @6 A
    set A_i to procindex * 10 + 13 Z4 A/ n, {* a! {! S$ ~
    move into Q_induct(procindex)9 W( O+ D$ P9 z5 [6 F! Y
    move into pickaisle.induct(procindex)3 y% b" G; j% u
    /*check the type of pickaisle.induct(i), for your last problem.*/+ b5 c1 F9 B' X, ?. H* \4 j% R- r

) u) \/ u) S3 \8 n    while A_i<=30 do begin
" J! U  x5 u& Q2 Q& W; m9 O        travel to pickaisle.con(A_i)
9 {, n4 c+ I+ Y" l* H# c% O' G7 N! ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) P' i2 e( l1 T! x& S( o9 a. H        else wait for 10 sec4 a" R5 b7 a( g! g& g' M
        if A_i=A_leave then send to die
- A. p8 g+ M- A5 `        else inc A_i by 1
& A' t5 F5 g$ d; R& a7 i$ I    end
$ c: g" n2 d3 o, Z( K& P1 ?end5 j8 Z: e  o- ~+ c. u4 f
- F5 n) b4 N. n
其中的procindex为整形,代表当前process的序号。  J9 C% z+ \% A# z/ z9 u# ?
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-9-23 20:46 , Processed in 0.018845 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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