设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11501|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 j9 _- k9 L1 ?" x: A% E) A

" @$ Z5 N1 d1 d& }+ @' K我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' h! P$ `. [, U- V. ^; }
8 f6 E" ~5 M; X! y/ o+ g) q; k1 u& D! _begin P_read arriving# Q) T6 ^/ p+ F. g! W+ R
    while 1=1 do begin
# Q# \0 C" ]. L4 L& w2 r! m& @        read A_tote from "data.txt" with delimiter "\n", R2 n) N# I5 q3 g+ |
        read A_time from "data.txt" with delimiter "\n"* D' v1 d, Z% g$ z6 t+ [$ y
        read A_leave from "data.txt" with delimiter "\n"
0 Z) ~1 r4 x  N7 C        read A_picks from "data.txt" with delimiter "\n"
4 p7 c7 k' s/ ^8 Q9 f4 J        set load type to A_tote
! R' ]2 k3 G- n# V+ B1 O        if A_tote="tote 1" then set A_induct to 1% j# |. ^! I- z* o* H
        else if A_tote="tote 2" then set A_induct to 2
( H/ ~* {6 o: S$ K1 o            else set A_induct to 3   
* K9 R- `) W" ~5 s* s& f        set A_i to 01 W; T( S3 s9 S, R6 E
        clone 1 load to P_induction  [/ u- ?& @7 e& s% f
        wait for A_time sec% e1 `! @/ j- a0 J+ w- S' |
    end
* \) A$ l- l; oend
! c# E7 Y$ E+ A; N: l
4 l& Z2 s1 ]# B/ A- d( O% Ebegin P_induction arriving
9 O+ f1 J- g3 n+ l; T  t    if A_induct=1 then clone 1 load to P_pick16 b+ H9 k/ y/ t5 F
    else if A_induct=2 then clone 1 load to P_pick2# z( M( G; [0 q3 l
        else clone 1 load to P_pick35 w5 ^3 X! _: d% k
end7 c8 N+ q1 ]' v6 ]& r8 t" w
: f! f: C+ e1 i: F7 b" _- ^5 S
begin P_pick1 arriving2 i& D. S$ Y% v3 `$ {* R) s2 s* c
    set A_i to 1$ a, c9 s2 K6 [. ]
    move into Q_induct1. D3 s& R" n6 J5 d) b$ @1 W  e
    move into pickaisle.induct19 r! H0 s0 A* H  g
    while A_i<=30 do begin
& J' J& f7 J- y# H  {        travel to pickaisle.con(A_i)
: m' M( a1 [5 V$ `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 r: }% \2 @: I9 u9 l        else wait for 10 sec; o2 a: {  ?! i! \. c% t
        if A_i=A_leave then send to die4 J! ]) S7 e# h" p% Q2 b2 ^5 {; H9 f
        else inc A_i by 1
" |4 @  C! P) Q    end7 E! Q% m; g. P8 d
end( X" n9 v+ |5 \- N
! n4 a0 N/ B; l3 `' H
begin P_pick2 arriving
; C+ X0 t* _6 c2 k# ^- e8 [2 q    set A_i to 11
0 M2 a: ]4 E1 t' b# b0 R, A    move into Q_induct2
4 q8 b3 Y0 `9 ]( A; q: f4 x    move into pickaisle.induct2
2 [9 C8 b9 D$ r+ U; x/ z    while A_i<=30 do begin2 z8 h# z4 Q! j
        travel to pickaisle.con(A_i); z6 y+ }  p7 j3 f$ b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ^% ?4 o6 d# Q3 T: d+ h        else wait for 10 sec4 h% B$ F, S- u/ Y3 n/ w
        if A_i=A_leave then send to die7 C# H0 |9 L! L: l5 ^, f2 j. S
        else inc A_i by 1+ X" U! J& k$ L' Y+ w- z
    end# x$ `! J6 z2 W& K9 Z; \' k
end
) n6 x! I: D  I9 Q" I" Z% }' M+ Q2 c5 C3 B4 h
begin P_pick3 arriving0 v3 P8 [: ]; O4 r
    set A_i to 212 ~; w/ L% h# [, N: x
    move into Q_induct3
' F3 M% ]% N  l. h" X1 ~# h    move into pickaisle.induct3
4 P5 }" R# f  Q2 g) o( Y    while A_i<=30 do begin) J3 Q% U+ T5 E9 K& X+ l" E
        travel to pickaisle.con(A_i)( A& H# ?5 ^3 A% ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# V+ M; r) i1 W3 U        else wait for 10 sec
: Q4 O: D% ^) t4 e        if A_i=A_leave then send to die
2 v" A" y1 i8 G) T- s( D' a        else inc A_i by 12 j& P4 i" R% }7 F
    end( `& c( R3 [2 B3 u* j
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' \" s1 Z0 [, U; K! @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ r8 P; u1 o/ L7 Q( B  Q
- C, g) E3 W9 Z, r
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: ]5 q+ @4 Y% \/ @
5 s! g# H$ v+ n$ G! S& d7 i- l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* B- P7 d9 T5 Z/ _, _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; B1 s- O6 p- U& ~  y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# r4 p4 O$ i8 T! }$ U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( h+ B  U9 C# `  E  b
begin P_induction arriving# V% y3 b: ?$ s: o& C2 }
    clone 1 load to P_pick(A_induct)( v" j. ?  v: V
end最大的系
- D8 y' O( t0 y% |5 N: i
; u" a' T! E' d4 {+ d& ?6 g+ K. k* {begin P_pick arriving
5 c. N+ {; ^4 p0 @$ E- y: w; S    set A_i to procindex * 10 + 1
, W2 v! V6 X) S/ }& q* H/ V    move into Q_induct(procindex)
$ L: k* `" i3 @: Q& B3 a3 i    move into pickaisle.induct(procindex)
/ I6 B* q7 Y7 i; S$ z    /*check the type of pickaisle.induct(i), for your last problem.*/3 e' p8 g# I6 u. V- e9 ]  X, w! A# t0 G& k

7 o: k7 }- Y1 p6 F+ ^% e7 e8 @! H; Z    while A_i<=30 do begin2 x  \2 \( J6 u- T  j; B' T7 w
        travel to pickaisle.con(A_i)
; `, ]* p8 _- c1 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) W3 {$ q. x, j* g: L. j* `; S" \        else wait for 10 sec8 P+ w: Q+ N  h. p4 M
        if A_i=A_leave then send to die! s' G/ ?( f7 T* X3 \8 S
        else inc A_i by 1
6 |6 K, F! |/ m1 Y; I    end! P" X% `' I6 P. _; @
end6 h2 t& L; J8 P7 n, l5 f0 c" H
; R7 w, U: o) V1 l) y  A
其中的procindex为整形,代表当前process的序号。
' h/ h& C, r# O0 A: [* Ystation和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, 2025-11-16 21:33 , Processed in 0.030099 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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