设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15083|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 N& V+ g( O: n$ v/ C! ]

# c: L. Y7 i) K- K" A我的问题是,在每个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. e) L" \/ L5 X
: @7 E5 k$ h/ Zbegin P_read arriving
* H9 ~4 R; Y6 k3 z; E    while 1=1 do begin$ K0 |8 f! F2 _  q
        read A_tote from "data.txt" with delimiter "\n"
; s! l/ x8 M( }8 }2 D! R        read A_time from "data.txt" with delimiter "\n"
; L5 j- ?/ {& J" p' Z2 E0 Q        read A_leave from "data.txt" with delimiter "\n"
; o' L" O7 L: P5 C1 x& G# `        read A_picks from "data.txt" with delimiter "\n"
% \& e$ X" h- d) s; Y: M        set load type to A_tote, x1 k2 H  t# y7 {. F+ `3 E, z5 k4 R
        if A_tote="tote 1" then set A_induct to 1
0 D/ `4 p# K7 T$ L        else if A_tote="tote 2" then set A_induct to 2* o) |$ [' K- Q3 E6 i
            else set A_induct to 3   
# f: p* w# G! L( }& j        set A_i to 0
  R0 x; H& C! u$ k        clone 1 load to P_induction/ f6 b3 E- p* v+ e2 K; U
        wait for A_time sec1 w" D; m5 P$ v3 C( |
    end
' j* b/ t) l' I! dend
# _  ~1 p* R# s8 w, M9 n0 @. h2 |- F2 K
begin P_induction arriving- |9 n1 F- u5 x' V/ ^
    if A_induct=1 then clone 1 load to P_pick1
3 z1 r4 L& Z4 \1 g( U/ A$ F    else if A_induct=2 then clone 1 load to P_pick2
2 P. Y) `( _1 z+ y5 I        else clone 1 load to P_pick3
. }3 }) z* p: S4 Aend# g9 I; j/ S" q5 D- A# v3 ?) W
+ q9 Z& D" N$ |, H/ F& d
begin P_pick1 arriving
6 m& ^" M) `$ _6 W; W    set A_i to 1
* Z& P( a8 @- z4 Z: @+ c; w/ z0 L    move into Q_induct1
& ^) Q" O$ w8 S2 @1 U/ `    move into pickaisle.induct1
, T3 O* z6 X6 ~/ Q4 T3 k, Z    while A_i<=30 do begin) w9 l) Q' m- B  d/ s
        travel to pickaisle.con(A_i)
1 t1 V8 J, K; z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ?- j5 F9 B8 U; p4 `
        else wait for 10 sec
- Z# r" b+ f1 a$ `        if A_i=A_leave then send to die
# q- \7 \& L- y1 [; h) o        else inc A_i by 1
* C5 ~. |9 _- E& w$ `& Z4 i    end# f1 U/ z2 |& Y+ A  U3 ^1 i% }
end
% m! t4 s9 A) m* t( ^% |. a0 ^3 p- f! K3 C9 G/ ~) m
begin P_pick2 arriving
+ g( h! t8 v2 x/ r6 n    set A_i to 116 }1 `0 [* T+ y/ P
    move into Q_induct2
1 [1 ^# l0 L3 C: K$ j( B" c    move into pickaisle.induct2+ e/ g( V' A" W# x! U
    while A_i<=30 do begin
! s$ `5 c+ c0 e( A7 D5 ]        travel to pickaisle.con(A_i)
, p5 i5 F% l9 g$ K2 b* |9 y3 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 Z1 h# ~2 ^& |& H6 ^/ s3 R
        else wait for 10 sec
. {0 E, A. G& O. E        if A_i=A_leave then send to die: H6 J+ N$ U8 m
        else inc A_i by 1
4 ~2 ~4 C6 V: N% d! o+ |& N    end
" Q, p+ R) }5 ^/ i; dend6 V5 V8 Z! x1 a& c9 S) ]7 v- r  c

+ ~( x4 h; D! M' }1 Lbegin P_pick3 arriving
2 `) u3 ?0 R: l; n; d, n    set A_i to 21$ r8 F1 l! w/ e1 p
    move into Q_induct3# J6 e' |8 J: w+ U
    move into pickaisle.induct38 G1 _6 V5 ~. |4 @! J8 K5 f4 j
    while A_i<=30 do begin! Y4 P, b* x4 |* a+ \$ w
        travel to pickaisle.con(A_i)+ A7 q' A7 ?  s6 `+ `! b5 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& O9 x: q3 S% p3 x2 s( R6 g0 u7 n
        else wait for 10 sec4 D3 \* X* j+ L" {! I  H# @
        if A_i=A_leave then send to die! m. E" I. B- E' P
        else inc A_i by 1
3 L' _1 {- X# S: W3 x    end' Q1 a" P8 B8 g9 r' H
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是个什么东东?
5 c( h: W6 d; @/ A# {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 T( R; N3 E# I: f, {' f, \

9 l- z4 y; ?$ HAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% S, d, ?  j& B5 [# ?
2 u) F! e$ p3 @( i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 M0 Y! b9 D$ X3 o! `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! i, W3 a( D! G& t8 c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- Q; D  G' N) t8 R0 _) Y9 \3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 |, _7 x  \) O) _, v% p/ cbegin P_induction arriving
' H- M# U( L+ ~9 y9 `/ U    clone 1 load to P_pick(A_induct)# B7 x% b% E* Z  I( M' [$ M( t
end最大的系
! {7 [/ ?3 ~. S) K8 F2 b
) U, i- g' I' X: \" }! ubegin P_pick arriving
8 r3 p$ U  M4 j( d7 H- x9 ]    set A_i to procindex * 10 + 1
. G  T! |: V% d' x8 N- O. D    move into Q_induct(procindex)6 @4 ]1 [& }, q4 a6 `- ~
    move into pickaisle.induct(procindex), p- Z% @! {* H4 e. |
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 V) a- E: P$ y& H' O+ S0 Y$ k5 ~! O: ~1 _) k/ G! Q: F/ H
    while A_i<=30 do begin9 d6 n% C, ?. H% I/ f2 A! V$ `* x" |2 U
        travel to pickaisle.con(A_i)
1 `4 ?8 A  m2 d4 W8 e$ m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 w( p' ~; W5 y7 V% o3 w# @6 L        else wait for 10 sec4 A5 I6 ?3 {" H% _& y7 D& Z8 j
        if A_i=A_leave then send to die' Y5 Z8 W: l+ T6 X, v+ U+ b! v
        else inc A_i by 1
( p5 \: j7 V( L" ]. q    end
: f, U1 I) {! r. M* Zend+ ]7 J5 m8 @8 |" @
* D( @) |. m6 r- o3 d' n
其中的procindex为整形,代表当前process的序号。
& M0 u/ ?4 _- O" Ustation和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-8-8 21:11 , Processed in 0.016914 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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