设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12715|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' k" y7 ^8 l. D5 B7 h8 D6 W* n; q0 Q% X/ ~  W3 {! y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ?) Y4 a- R; }2 z+ }2 z- _, Z3 [; O! k
begin P_read arriving
  B1 j! \: r6 W! ~9 E5 U    while 1=1 do begin/ i0 g$ c$ z& ]& r/ ~. a2 f" r
        read A_tote from "data.txt" with delimiter "\n"
8 N& J) ~3 q* K! T! z        read A_time from "data.txt" with delimiter "\n"
" O  d3 f+ R. K7 \+ i0 _        read A_leave from "data.txt" with delimiter "\n"& S$ M) q: u# i. ?+ J  N& Y
        read A_picks from "data.txt" with delimiter "\n". i- j& m6 `5 x" |9 r6 m$ i' I
        set load type to A_tote
0 E7 ?4 x7 P; g0 l        if A_tote="tote 1" then set A_induct to 1+ b% Q6 O9 A' R7 @6 E
        else if A_tote="tote 2" then set A_induct to 2
* H/ [; k5 T8 ]( Y+ u/ o2 M            else set A_induct to 3   
1 [9 T8 @  d* H" h6 C        set A_i to 0/ g& N3 C8 |) g% V
        clone 1 load to P_induction' j* I$ b. l# a8 Z; J$ p- F- M* {9 D
        wait for A_time sec
- D8 S9 b; }) ^    end
3 m, K! B+ ~1 M/ `end/ ]) r/ w5 O# z/ e4 a
6 Y) Z8 `, D" B( J8 ?& }
begin P_induction arriving4 N# p2 h' h- F7 d% `& p
    if A_induct=1 then clone 1 load to P_pick1, ~) _- j& q7 s9 e) V7 e8 e
    else if A_induct=2 then clone 1 load to P_pick2
3 j0 x$ L% f' t% J3 `( Y8 A        else clone 1 load to P_pick39 e0 E$ S  P/ g
end! R0 r" |4 o; Z( ^

+ t/ u! B3 V/ {! S/ ybegin P_pick1 arriving
8 D  f( r2 m* \! x    set A_i to 14 V7 ^) t4 W% t
    move into Q_induct17 [0 s3 e5 Q! `1 k7 t% F
    move into pickaisle.induct1# F5 A$ @2 i# |1 L' e2 S
    while A_i<=30 do begin
) k0 b4 K5 t. d$ D0 I0 J' J9 z+ u        travel to pickaisle.con(A_i)
# u. K0 o& L% s, n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 E& [( @8 T. Z7 I9 W( V3 M        else wait for 10 sec
! ?/ e4 D) R9 D; H1 Z        if A_i=A_leave then send to die
8 h6 ^2 o6 Z% y+ P        else inc A_i by 1, N3 R4 `6 Z' O1 a" A# A) {5 w
    end
8 [: s/ `; T* M1 m- X1 c7 Aend
/ b, Q- J' B+ k9 a
; Z0 l! t3 Y9 |begin P_pick2 arriving
3 E) ^3 F. E7 G7 e    set A_i to 11
+ q- r: F0 T' q+ l    move into Q_induct22 r# P) {2 _. z) j
    move into pickaisle.induct2
$ c4 J: \- o) z& W1 |    while A_i<=30 do begin: r% r4 s* {1 d+ }+ P, V
        travel to pickaisle.con(A_i)
! D% O0 {6 `$ m3 ?9 a4 p! l. n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 R3 j& Q7 M' d$ G* g
        else wait for 10 sec
, O6 u) h% N* o- j: Q5 Y8 s6 r0 ?        if A_i=A_leave then send to die
# v) j- }: D& V5 H. r4 T* d4 g        else inc A_i by 1
# _$ Y  H& X; W$ f  s1 R$ w: B1 _    end
5 ?% Y& x+ T( B" fend) k) ~8 q( c0 A. L0 P* P- L& P$ P/ [* f

' O3 Y0 T& F' k% O5 S- |$ Ebegin P_pick3 arriving
; R3 {8 V9 y4 a3 @; P" h" O1 ~" @! E, ^    set A_i to 21% k" q+ I4 I1 G- u
    move into Q_induct35 w- P, c4 d$ D* Y/ _
    move into pickaisle.induct3
- w" Z/ D, e$ L% k. n" b0 x    while A_i<=30 do begin
0 Y9 E: r/ k+ p; J* A3 }7 |        travel to pickaisle.con(A_i)
" `+ N9 t5 `( D" E+ X3 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, @8 E3 A6 F( l; U        else wait for 10 sec& V( c/ w' }/ @; M
        if A_i=A_leave then send to die0 c- P3 R  |6 Q, w- p
        else inc A_i by 11 b7 Y! c$ G) @2 D
    end* T5 s9 d9 d7 `) D6 e( W
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是个什么东东?
) y; B- U+ d7 `, amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  a7 S+ R; {4 m3 _" j* B( |* f7 e& t" d/ [: Q' P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 S. O' ~6 C" P: z8 J# V) k5 L" h. v: ^+ R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# B2 M1 S5 G6 Q+ ]" j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 O% T. Q- B( E$ ^* d% Y# C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ _" }/ ]9 v6 J+ ~+ `$ i: A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 ~3 O# s, F+ o
begin P_induction arriving
! ]# Q0 D0 L4 m" ^( W: W3 W- \    clone 1 load to P_pick(A_induct)7 F# G/ H3 U5 }- K1 P
end最大的系& d* t+ G, v$ T8 n

8 \8 U7 X' _4 T) C1 w5 T% i7 ?begin P_pick arriving
8 y+ ^. V/ G3 n; K6 l    set A_i to procindex * 10 + 1! M. p+ R" t" i0 @7 C
    move into Q_induct(procindex)
; j8 }+ r9 k9 G" Q3 @    move into pickaisle.induct(procindex)
1 c! g/ c, \$ m1 f6 ~, r- d    /*check the type of pickaisle.induct(i), for your last problem.*/
6 T* i1 y7 O+ N+ M5 d6 }. g4 o4 E; O0 C/ c& E; T
    while A_i<=30 do begin
7 G- ~" w& F' v: P# Q0 {        travel to pickaisle.con(A_i)
+ {2 w5 x- O& M9 I4 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- p' @5 g4 L% k3 G' R        else wait for 10 sec
6 y0 Q5 s# G7 `9 c# ]7 i        if A_i=A_leave then send to die
7 g1 X- q4 _& ~1 I; _- _        else inc A_i by 1
! {- D$ ~* k1 l1 I6 D    end
5 Q7 {, D! ^" E+ g, Pend
7 p# }$ [: _/ o# `! f
& C2 h% m5 k8 E5 J: ~$ X其中的procindex为整形,代表当前process的序号。. J; N  l8 t( J% N2 ?& X9 x2 G
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-2-13 18:36 , Processed in 0.021957 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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