设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14533|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ w% _- v9 ?' M4 }& X- _
2 e; r1 w1 W+ x6 f  ^; I0 G
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% t8 [/ h; a/ X' v0 N
3 |% S  P6 N) X* K9 b
begin P_read arriving0 x+ e+ L6 B! X( u! K9 ^
    while 1=1 do begin
( s  s/ D. d7 Q( A* t2 L2 C        read A_tote from "data.txt" with delimiter "\n"
- ^, r( L/ S0 t, B8 H+ v        read A_time from "data.txt" with delimiter "\n"; Q0 d: q$ g! J
        read A_leave from "data.txt" with delimiter "\n"
, R# H+ r. l( o. d8 r        read A_picks from "data.txt" with delimiter "\n"
/ d. P( B" N7 I* [' j& i; z" A        set load type to A_tote
4 {, V4 S' U2 P8 M1 g& j        if A_tote="tote 1" then set A_induct to 1+ E! i' e/ d  Z3 T/ ?6 s
        else if A_tote="tote 2" then set A_induct to 2$ D. u# e7 h1 ?3 A. B( y4 b
            else set A_induct to 3   
1 ], W, ]2 r0 v1 f; q8 i! x        set A_i to 0
" p* U2 C0 ?4 ^4 q2 `+ M2 w/ ?$ p1 a- E        clone 1 load to P_induction$ x. @- J3 R: h
        wait for A_time sec
7 V- R3 m+ l/ T    end
' L* l3 u+ w5 fend. S" Z" A2 N6 C8 S
% @7 \2 }: J1 P. o3 r" L$ {
begin P_induction arriving: J; M2 h4 G7 Q9 m/ u% e; |$ C) k
    if A_induct=1 then clone 1 load to P_pick1. a% r3 ]5 q; U# G& C& D; `* a
    else if A_induct=2 then clone 1 load to P_pick2
5 Z7 `- f7 j# Q5 J2 N% [9 w        else clone 1 load to P_pick38 |4 S3 W9 Z) X  _1 x4 c+ s2 v+ q
end
0 Q/ W% i. R: w9 O7 U  \8 l  ]
6 w4 R: Q9 z" W6 Abegin P_pick1 arriving) {( y( u' o( L) \
    set A_i to 17 G1 c3 z, i4 @2 X$ R4 p& Z- G
    move into Q_induct1
2 J+ k( M$ D. K2 P    move into pickaisle.induct1% j* M! n# t5 H7 S; y' V
    while A_i<=30 do begin4 O- }& P+ Y( J$ ?& t6 N% m9 A
        travel to pickaisle.con(A_i)
; O# x7 v$ k" \: V8 @" d3 R& l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. A# D7 C5 P4 T% R        else wait for 10 sec
) q1 ?: }: w" d( D- i  ^        if A_i=A_leave then send to die" \( f6 |1 a9 |8 J  b
        else inc A_i by 1& Q, y2 K3 \8 V
    end
$ _1 h+ V) a) o, ?( L' R6 P' _end+ [$ e/ r# p* u# o8 @$ e

3 x5 M: C+ f+ {0 t# v& h* xbegin P_pick2 arriving8 [2 C% Q, M* H: v2 `
    set A_i to 112 `. {& x% o# h. U: v
    move into Q_induct28 ~& [) T8 p1 {0 ?* g
    move into pickaisle.induct2% m& @- I4 d0 R
    while A_i<=30 do begin. X& {$ O8 Z2 Q2 h9 j& F
        travel to pickaisle.con(A_i)/ N0 _& U% \; w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ O$ [& D/ y, y
        else wait for 10 sec
% ]; |' m! I* V0 S% d        if A_i=A_leave then send to die
3 v4 p4 O0 p0 e8 W; J        else inc A_i by 14 m$ r% b% R% \9 _/ p% A
    end  `( Y# D8 a* i
end
* E- \! x- G1 _: j9 t; d/ ]4 R+ r' p( j. z8 z
begin P_pick3 arriving
  m3 W* B. y" m3 Y  u2 p    set A_i to 212 s( w6 w0 G# g3 ^
    move into Q_induct3
; l" Z3 ?$ T; x    move into pickaisle.induct35 ~6 q- j) @. E0 v* K* F- K
    while A_i<=30 do begin5 a) G1 B4 {3 F* @
        travel to pickaisle.con(A_i)) {- a4 ^$ m; L* F! ?# ~7 w6 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# R& I0 o7 S# R8 ?& x/ D        else wait for 10 sec2 P( k$ @" J6 g1 W: ]" y
        if A_i=A_leave then send to die
* D$ m3 i( _3 p/ c, h' ]        else inc A_i by 1: ~/ E4 j) h0 o* `( D* C8 C
    end1 h$ A% w4 \$ S5 y$ r
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是个什么东东?, C. V. J0 E7 B3 ~+ F: _! Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 F; r  I0 j' ~
# K" [& J/ m+ P4 x" C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 V8 T1 c( ]( q0 B3 G
' S- ?: n) r* k  S8 q2 c' x3 K# j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' _5 c8 b6 K& G- g2 z; T- o$ t' X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ h' x/ [! x' m; f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 [) Y7 W8 X& m1 D. ~/ E7 V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 T- `# I2 N3 x7 ^# t: `2 g
begin P_induction arriving
) l4 @* m! Q9 E% c1 h    clone 1 load to P_pick(A_induct)
( s7 T& l4 C3 B! y" Bend最大的系8 z0 ^4 d, M- r* |4 ?9 t. C

. T4 z, x$ E1 T3 V* x& \/ xbegin P_pick arriving
! o% O9 R8 E! W6 E% j7 Q" i    set A_i to procindex * 10 + 11 o- Z( [2 r' h& Z. w0 ?
    move into Q_induct(procindex)
: V# f. a, B9 L8 b( Z" Y3 y    move into pickaisle.induct(procindex)* P1 }# `- i* r
    /*check the type of pickaisle.induct(i), for your last problem.*/
, p! e4 p( s8 |( A
: y/ E% R8 N: u8 v4 E8 B2 x    while A_i<=30 do begin4 {7 B: w2 w- M1 c0 S
        travel to pickaisle.con(A_i)
7 b: ?1 h$ P. A) C. T" l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  V: L! n  ^+ s9 B9 q  h
        else wait for 10 sec
+ G1 R& B" b( O5 c( p7 g( I        if A_i=A_leave then send to die
7 S; }. i( N+ Y        else inc A_i by 12 a0 I0 u, n) T  h5 T$ W+ v
    end
4 r0 J9 T* f* H( Z* S" bend8 Q/ w  l- D0 L% _' m% N$ }
, D7 l2 h3 |4 T
其中的procindex为整形,代表当前process的序号。9 c" R. _( l% p
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-7-15 20:48 , Processed in 0.013344 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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