设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13944|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) K& d& c, g8 Z9 u4 }1 c) F7 u. x+ A3 W& 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, X. L2 R7 [" K/ C# ^
( {9 o! Y* m+ K/ i5 |begin P_read arriving3 C+ ]) q9 ~: I
    while 1=1 do begin: G  I# T6 w* q; J" [/ U
        read A_tote from "data.txt" with delimiter "\n"3 T( E. l; {3 s) Y5 i1 K) G3 I: Y
        read A_time from "data.txt" with delimiter "\n"
  J4 f8 c& |$ m. ]  v+ j7 Q        read A_leave from "data.txt" with delimiter "\n"
7 ~! x% M9 p2 f7 e1 `        read A_picks from "data.txt" with delimiter "\n"
. Y6 {3 O9 b2 z+ o; R2 U2 i# s        set load type to A_tote! Y  s7 W( @- b& m- ~6 E  L
        if A_tote="tote 1" then set A_induct to 1
% U2 m5 M1 ^8 l! O        else if A_tote="tote 2" then set A_induct to 2
, p: C; B, P# G& p0 p! z, s) \- U2 P            else set A_induct to 3   
; a) m) }6 V& G  I        set A_i to 0# y  ~+ |0 [2 R+ a
        clone 1 load to P_induction
% D- ?# Y! C) M0 z6 l; \        wait for A_time sec
/ b- \# ^+ o! E/ |. L6 c    end
. V! S' e3 x! W$ R( ^end
% S9 Y2 O, F( [7 X6 c8 R% Z1 R) `/ ?! a9 j: m
begin P_induction arriving0 K% k. _# o7 ~6 u" Z
    if A_induct=1 then clone 1 load to P_pick16 Q2 J. A. T; M5 H8 o2 M
    else if A_induct=2 then clone 1 load to P_pick2
+ B. i* x* p& v/ X" T- Y        else clone 1 load to P_pick36 I; R* q& `1 n8 {
end
4 b0 C) ^2 M/ r: |1 N: t
/ a2 z- D0 o' U" b" ~3 Ubegin P_pick1 arriving1 d: _& ]2 U4 L7 e( P. t- y9 u' f
    set A_i to 1& E7 K# D  z( i
    move into Q_induct16 M* S. h& B, Q6 J, q9 F
    move into pickaisle.induct13 D: t6 h. W- `  x" i: n
    while A_i<=30 do begin
. K- h% g8 F! @, ]. ~* ?* x" K/ }: n        travel to pickaisle.con(A_i); j. F* i5 h7 _/ u8 ?% X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 m( n; W& `" O- s: U$ H$ y  _
        else wait for 10 sec
9 E, x) P/ W) w" t        if A_i=A_leave then send to die
; w* a6 X8 g  F' P7 l4 }        else inc A_i by 1% g) r0 D% Y% i/ }% y# X
    end) y9 v1 e% w) F# l$ ?; K
end
" p8 ]. f# N4 J- o* W
  A& M1 P) ^5 J- A. _# ]begin P_pick2 arriving
0 X2 Q/ d% Z1 b1 v' {4 ^    set A_i to 118 F; j" Y6 j' j5 O9 T: ~
    move into Q_induct2! r% V; M& V7 P: c/ R
    move into pickaisle.induct2
' _6 K# a, ~/ w, `: `    while A_i<=30 do begin
8 h2 t9 T( I5 R7 q% L6 l        travel to pickaisle.con(A_i)
0 [: [; J3 t- a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 p4 L, B5 G: c" }# q) u* @/ W        else wait for 10 sec
/ m  m" k% r9 c. ^( P7 a( Y3 b        if A_i=A_leave then send to die
' o9 B5 W- ~3 S9 \( F6 j' t        else inc A_i by 12 n! {  Y" T2 F0 N! ^: B
    end5 U9 w3 x1 E8 N7 m0 }$ Z
end% ^0 B: S+ H/ q& b
, K2 B2 v( M; C* c4 O
begin P_pick3 arriving
7 k6 s! y3 ^, z3 @& A    set A_i to 21
8 I0 H3 _  a( a% S/ o' R3 L    move into Q_induct3
1 r; `7 E4 N0 k$ F    move into pickaisle.induct3  m* n- h" j  M( K8 y+ Q- |0 {& i
    while A_i<=30 do begin* f7 f" ]# c" h+ V! x+ B, {/ B3 N
        travel to pickaisle.con(A_i)
, m. A! b3 n9 O; n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! [9 h$ N! h9 ?7 j" x3 N( a* A: b        else wait for 10 sec6 c0 j4 i0 q( x
        if A_i=A_leave then send to die
5 I" W2 x+ H/ _" M- ?' G& I3 }7 l6 J        else inc A_i by 1
4 v* I- `0 U7 I4 N* r$ F! g2 A" j# V- I    end, t( G% h' s9 I, C( n$ e# F& Q
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是个什么东东?
- c6 W1 h; C: R1 g* ~move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# y; U" L; T5 N
3 w* v7 v. J; ~! v  t" NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: b, Q$ w% Q" _5 h+ v7 H: m

5 q7 l+ H5 u5 b* j: L% H0 y( `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 t, X$ k" G0 x/ Y3 K9 J; a1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% M/ \, t" Q" P1 C( a
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! ^/ z, a& f  i2 x) B3 U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 f0 f' m/ w+ }
begin P_induction arriving
) C2 K: X7 W; w; m# q; b    clone 1 load to P_pick(A_induct)9 {7 `9 j6 V2 y( u$ i! C
end最大的系! i+ f. a  y- t: H: y
7 e9 o2 A: c3 E3 D
begin P_pick arriving0 R) O, D* Y. c/ [
    set A_i to procindex * 10 + 1
4 q7 F" X; R. g. t( b8 j    move into Q_induct(procindex)- N% I, a: U# J7 z
    move into pickaisle.induct(procindex)% u; B8 |  a- e7 ~* e
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 l3 v8 f& q; J' ~" U; W* ]! o, O  \2 t. @; ^$ c
    while A_i<=30 do begin
1 Y, w5 _, W; m# B' v        travel to pickaisle.con(A_i)1 b2 w  H* Q& \9 e6 k* f0 _! }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. j9 y5 i) V1 v9 D: _: R        else wait for 10 sec
" v7 O- C6 \$ `        if A_i=A_leave then send to die+ X$ v; m  j" ?3 z5 ^$ F' U. W
        else inc A_i by 15 y7 S. s7 j9 E  x$ L* b
    end
5 Z8 U' C+ R9 [6 Z9 n3 Wend. U: A$ v" g# d; _1 V7 U

' x) s- \# |0 @" Y3 p+ |其中的procindex为整形,代表当前process的序号。
, ]& z, n, l0 r1 P2 zstation和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-22 08:05 , Processed in 0.018580 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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