设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12178|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 n/ c; y) S. E9 D8 f! F$ `
- \0 g5 T$ W, S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. T  C: D4 E  {6 A+ O7 E
# ^4 f$ q2 ~+ M$ D6 h  g
begin P_read arriving5 X8 A( q( f4 w9 F) M
    while 1=1 do begin
" h# {, r" h2 l# ]* V8 d- E- `        read A_tote from "data.txt" with delimiter "\n"
& n% S1 C6 p+ o        read A_time from "data.txt" with delimiter "\n"4 f: @  A$ m$ D$ W9 `
        read A_leave from "data.txt" with delimiter "\n"
$ ?5 I8 I+ p8 r, W; C" V        read A_picks from "data.txt" with delimiter "\n"
  g5 d8 B8 i6 p! b0 u        set load type to A_tote
! Z3 E$ e8 s3 \+ l% B        if A_tote="tote 1" then set A_induct to 1
  R1 n, f. z8 m        else if A_tote="tote 2" then set A_induct to 2
* l. V* I5 X  j3 [            else set A_induct to 3      m8 p, \- D7 O* t+ k; C
        set A_i to 0
5 |/ J" Y% y5 R8 B4 P# \        clone 1 load to P_induction0 a2 X! z2 e- j; q) a. |' f
        wait for A_time sec  c$ A" [- Q, C3 D# x
    end' d% p' S3 Z: ?
end7 ?& F  o  L: H( ^6 f* [' V

2 V3 H; A# h' }$ ?& ]begin P_induction arriving2 I  f* }' u0 j$ o! }, `
    if A_induct=1 then clone 1 load to P_pick12 H0 g0 v; G; N! }& I; B; z1 C
    else if A_induct=2 then clone 1 load to P_pick2
5 }( r  ?6 s; y9 u' K        else clone 1 load to P_pick3. Z/ V( ~6 ~# v# h6 E9 {, S
end! E( `; [0 f2 h: S) r

9 R* N+ U( X$ e7 `+ D, j2 Qbegin P_pick1 arriving
$ S6 W' J' M% x! R6 p4 N3 w    set A_i to 1
4 w# h$ }: T; e/ Q: E" o5 M: @7 w2 T    move into Q_induct1/ P- c/ D; s$ e- W9 }6 Q3 z) o
    move into pickaisle.induct1
3 ?# r2 l( A! ^& p6 w% ]    while A_i<=30 do begin5 O3 l6 Y$ W  b
        travel to pickaisle.con(A_i)
" u4 M5 y0 i% p( e) h. ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ~+ @8 b+ K+ [" A+ q. H        else wait for 10 sec
6 B6 c0 W7 T! L        if A_i=A_leave then send to die
2 {( \- u& _6 `/ P# V2 @( k$ Y1 Y        else inc A_i by 1
/ s: y" r% h8 d: `; _5 R    end# Q6 T7 s- a5 Y5 U
end1 w2 F# J/ I" [& N, P

2 R- b, l- y) o" L( `. e  rbegin P_pick2 arriving
6 y% G& R+ G$ a( B7 N    set A_i to 11
* N7 A0 b2 x3 f. R% V    move into Q_induct2
9 G' N8 a0 o; q( L& n    move into pickaisle.induct2  ^  T+ g& s; S
    while A_i<=30 do begin
3 f! ?* n; m$ p: ~; [  s$ R  \& _        travel to pickaisle.con(A_i); F, y# F; U' h# X5 G9 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 ?7 a. `" U* J) I  k4 N, i6 e
        else wait for 10 sec
4 w. ^2 k' f6 K, {1 @/ [  T1 a+ M        if A_i=A_leave then send to die, j% l3 x( O8 N$ e; p
        else inc A_i by 1
6 z; ^. e% ?# @4 G  D' _; E; M, ?  e    end
5 L; C% P9 z$ l' Y" }end
, O' H1 W/ e$ a+ \' Y# C# x1 G7 b4 K1 J  N2 n$ X
begin P_pick3 arriving
- D5 q0 `- Q# k5 U2 y# g    set A_i to 21
5 b% T  w* S2 m  j6 H8 t    move into Q_induct3- W4 ?* U. k% ?% I; h  Z
    move into pickaisle.induct3( b5 Q) N: H# j
    while A_i<=30 do begin
# F7 R% y' I, U- H        travel to pickaisle.con(A_i)6 T. b% r0 e! O: z/ z& l, G! L/ N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ G) d2 h0 P( i+ i6 z        else wait for 10 sec
2 A1 N/ a; _- v) l4 d* W, }" e! I        if A_i=A_leave then send to die$ u6 m% x. B! _2 h
        else inc A_i by 1
! P0 s# o9 V& y( X# T    end
( K- ?% i% [6 f$ Dend

最佳答案

查看完整内容

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是个什么东东?
* ?2 z( ^4 m  x& g3 |$ Ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 ^5 A9 u6 E3 v7 _$ L( l
3 Z5 P( ^# w) n! J; Q' cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( K" |/ R) n* W2 w2 r

- l7 Z. r8 I6 m7 N另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  [( @) f/ R. j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# w. F4 j' }. q& Y# n+ b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( ?: p3 J# ?" P% Z) |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* g5 H3 V- S: J' j, G
begin P_induction arriving
" c6 ~1 E! {- V* ^    clone 1 load to P_pick(A_induct)
+ d" ?* k5 T1 k( Uend最大的系
0 r- _. U; d; Y2 B( p  Q4 x" s6 U5 I1 X
begin P_pick arriving
& t# z- a1 P: G; w! `    set A_i to procindex * 10 + 1
* J" N2 [/ H) y# x* R    move into Q_induct(procindex)
4 e: ~# V! |* _* m    move into pickaisle.induct(procindex)
, O8 L1 Q* [7 ~- u* p4 w    /*check the type of pickaisle.induct(i), for your last problem.*/, @+ z6 `( D/ w7 I4 i# p3 I+ R
8 s# D, ]# F: g+ _7 ]
    while A_i<=30 do begin
* L: i, h" C, F3 w; }        travel to pickaisle.con(A_i)
0 S3 F, a+ p: N4 N( T! p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ l0 _- W+ V& U1 j/ s6 R" o  C/ a
        else wait for 10 sec
/ B  b- `  w5 {: B; g, n        if A_i=A_leave then send to die
0 Z' A* S, L, L* X7 e8 }        else inc A_i by 1
  Z  D- d; E3 g9 ]0 {) }    end
5 y2 W: ^, v4 W5 L! g- F, Q: gend7 n7 _8 f3 I9 I3 |
. L% d, m4 A; L' q/ J. Q# P
其中的procindex为整形,代表当前process的序号。
$ G8 J& V! \) zstation和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-1-2 20:03 , Processed in 0.020944 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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