设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15044|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 j, i* Z  O) @1 Q& Y* J
/ h9 T8 t, t1 U我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 O/ a1 `! u8 H
5 x  f/ p7 ~/ l
begin P_read arriving
. s: c1 S4 c' X* T! u    while 1=1 do begin
# y6 i' J0 `: I# S7 ]. D        read A_tote from "data.txt" with delimiter "\n"
( m8 ^/ G5 e! r, ?) E        read A_time from "data.txt" with delimiter "\n"
  p; E5 B7 n6 _! U        read A_leave from "data.txt" with delimiter "\n". m. r* g( {& Q4 H3 U0 O: [* _0 D0 K
        read A_picks from "data.txt" with delimiter "\n"
+ ?: w9 K3 ], r3 a$ ~. ^% C        set load type to A_tote
1 d7 A2 M9 g( N0 S        if A_tote="tote 1" then set A_induct to 13 N' I$ T2 |- p5 A" Q
        else if A_tote="tote 2" then set A_induct to 22 d. ?& q0 u( ]+ A9 r
            else set A_induct to 3    7 r4 C4 f% w+ n; C6 I& u$ z/ E
        set A_i to 0
2 I3 g! ?  W5 F5 P- q- e        clone 1 load to P_induction
% t- p+ e  G# \4 ]! D7 ~/ d: A' t: W        wait for A_time sec4 S0 l# G  Z; E9 ?0 U8 j7 s% U
    end1 O& U2 C8 H% _  v* f
end4 @& v9 k6 c9 u# ~- ~. v
4 q6 X7 P2 H7 Y  ^6 h, e
begin P_induction arriving
! I% C3 R6 j" Y: r    if A_induct=1 then clone 1 load to P_pick1
0 M: _3 O* C5 R/ @# M    else if A_induct=2 then clone 1 load to P_pick2
7 Y9 A8 S3 x; l  L. T2 P        else clone 1 load to P_pick3: G$ P/ M) {: D
end
  K9 @5 Q: p! u1 z6 b; }) }4 n6 o4 R, f( l
begin P_pick1 arriving: R( ^- R& Z" @: L8 g% Q
    set A_i to 1
4 t' p5 E, j0 P+ z, d    move into Q_induct1
( V' y2 T1 l( q9 B    move into pickaisle.induct1
- b& ^. n% G6 L7 |  V6 @, N    while A_i<=30 do begin  K6 B- S# s3 N) Q8 C  x9 l
        travel to pickaisle.con(A_i)
3 v9 D: \! ~) j: O6 V( @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: P1 r' q+ c1 F
        else wait for 10 sec
- k. y, ^5 @6 r4 u# F; u+ R" I        if A_i=A_leave then send to die- F2 P6 `) t+ R1 Y
        else inc A_i by 14 n& P# Z- C. J
    end- f; B/ G8 K! ^# M; o
end
* f1 H2 k& d* T/ D9 k% t9 H3 O% w1 a9 x! y- h2 O  o
begin P_pick2 arriving- @$ S" b" m) T
    set A_i to 11+ @- W3 r+ j# o
    move into Q_induct2
+ T! B; M/ U3 |6 n; v, H4 A    move into pickaisle.induct2
2 a4 t# s0 ?, H2 q    while A_i<=30 do begin
3 F, W# f3 P/ i$ o; k1 U- \        travel to pickaisle.con(A_i)
8 Q6 W. h, G9 C! e, n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( P8 L$ {7 ]$ @, d        else wait for 10 sec3 L; L7 R# y  u1 V, M% `7 B
        if A_i=A_leave then send to die
5 U' ~. i0 V# r8 D% A. e( @        else inc A_i by 1& r" A0 a$ |; H( [; G( ]1 ?* T, U
    end
9 l  x' T; A: w# z' kend
) P, m- m2 f9 f" x6 n/ s( V. P$ N" {
begin P_pick3 arriving
; x% e# a- E" h; Y    set A_i to 21
+ ?# |( o3 E6 x. Z. @8 f    move into Q_induct3
: G7 ~; {0 X& {0 X    move into pickaisle.induct3
5 U) I& }: d) o- U    while A_i<=30 do begin4 W' g0 \/ s: c* l! B* Z
        travel to pickaisle.con(A_i)! T9 [* n. A0 v' e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" ^$ W) o7 H+ b) x        else wait for 10 sec
* A; p1 ]: h6 V+ B/ J( v        if A_i=A_leave then send to die! F+ j3 \* W1 v! }. h$ E; q& @
        else inc A_i by 15 }. P+ J; s) n4 p, t. ~
    end
  Q6 m* I6 o1 X4 O) f. yend

最佳答案

查看完整内容

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是个什么东东?
: {+ R9 v# P+ ~3 Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' {" [7 A1 G' M  Y! J! z
, `2 T' A/ @- r* ^4 w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& g: Z5 \" s/ U% F
0 p" m( `2 I) V; {! A! c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ V: `& J* f: P8 \( s* U7 P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 R1 U$ T/ d6 E, l  W6 K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" X/ h/ l" |5 ~1 R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 }! m; z$ {; {5 }7 \& m. V8 G2 X% Obegin P_induction arriving$ \/ h& `) t1 v/ k4 {
    clone 1 load to P_pick(A_induct)
# ?: R# F: ?' k; h: hend最大的系4 m2 x& e# X) L/ z" p

0 a5 h7 i$ Q( ?! hbegin P_pick arriving
: V' E8 W$ _5 I/ r3 [    set A_i to procindex * 10 + 1
/ Q" s- O- c% `$ q1 L& N    move into Q_induct(procindex)
6 }0 l+ O4 Y3 \' g) E    move into pickaisle.induct(procindex)/ e! n, s$ Z) N
    /*check the type of pickaisle.induct(i), for your last problem.*/
; `; [, }  i* ]- a1 G. p0 t, }8 w- g, {$ n; T! v% T
    while A_i<=30 do begin6 v: m! ]3 B9 j+ F3 P
        travel to pickaisle.con(A_i)
1 i) F1 M* s7 I" O/ R9 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [7 {8 t- m! W- n5 C
        else wait for 10 sec
) g7 B0 m0 Q: R        if A_i=A_leave then send to die. V! d9 w, p/ q8 Y6 \) F, _
        else inc A_i by 15 W, w. [' S! X* }9 ?4 p
    end. W, n* ~( E, D5 j
end
. _: e! t; X. M# M! d( Y* G* P( N; S
其中的procindex为整形,代表当前process的序号。) @, @( Q: F" u1 r- `
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-8-6 04:48 , Processed in 0.015931 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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