设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11625|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 ~' H5 J( F8 Y$ @- S! z0 J' t2 k8 w9 ~' }
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. B9 d; r' j- D% r3 e9 J

" j1 x- I- E1 G% O  Y$ C, Q$ K$ I: xbegin P_read arriving
9 j0 {3 Z$ {& |5 D8 J/ D4 J% w% e    while 1=1 do begin# Y8 h8 d& Z, F
        read A_tote from "data.txt" with delimiter "\n"4 V$ }3 g, b$ L. Q
        read A_time from "data.txt" with delimiter "\n"
7 Y( O' ^8 M) ?( X6 ?: V2 [5 r        read A_leave from "data.txt" with delimiter "\n"
& w( T6 \% t/ i0 n        read A_picks from "data.txt" with delimiter "\n"
7 Y) c8 x7 c8 Q+ Z" Y        set load type to A_tote
( V6 L% |7 u3 b0 o/ U/ t        if A_tote="tote 1" then set A_induct to 1
* j( s8 H6 b0 G        else if A_tote="tote 2" then set A_induct to 2
9 N: s! S/ a9 {            else set A_induct to 3    & U1 M  I9 n+ ?. g; Z, Z
        set A_i to 0
% K* G4 |" p& m' @3 e( D) p* C        clone 1 load to P_induction; }( b' I& r  [7 a# [
        wait for A_time sec5 w6 A. {* p3 k3 D2 m& z
    end
  b5 C' }6 k: G7 G2 V+ uend
/ y. `& X+ T& Q/ I( c$ j1 P6 U1 R- x0 n
begin P_induction arriving- I% ^9 ?) O2 R8 H
    if A_induct=1 then clone 1 load to P_pick1
) w7 u/ S( i! C/ [) B3 K9 n& e9 B' z    else if A_induct=2 then clone 1 load to P_pick2
  N+ o$ ^9 j) a% X1 b+ q4 a        else clone 1 load to P_pick3
8 M) H' H5 ^( Vend
( v% l8 |, g! R( h2 Y' S  G9 `" n/ Z" }( A% t+ b' B
begin P_pick1 arriving
4 H& D& C; I# F    set A_i to 1
( F3 O% [. b6 o+ y$ X' I; ]" ]- s5 o    move into Q_induct1
9 A4 `1 S5 E* i6 K8 ?. o1 M    move into pickaisle.induct17 T$ W- x* q. ]2 Y" y6 B3 m
    while A_i<=30 do begin0 p/ V1 K/ R0 h2 C8 o; \
        travel to pickaisle.con(A_i)
! ?  E7 O% |2 Y3 n: v4 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 }) O: I. Q6 S! b" L/ u9 L' }) g        else wait for 10 sec
9 B  p. j. S" e+ M1 e        if A_i=A_leave then send to die
+ [* U, A! _/ e( r# J: h        else inc A_i by 1
# ^# K+ A4 I+ {% Y. i+ g    end
" S- p9 ^9 M4 ^2 kend% Y7 ]. G/ l5 R" M" f  _

$ J6 I9 k, H) u' l! |$ W7 dbegin P_pick2 arriving; y" q" L/ m( L+ F  W8 J
    set A_i to 11
! E6 Q$ e3 E+ x0 o' K) V" b4 ?    move into Q_induct20 s3 M, u' @: k/ ~: q
    move into pickaisle.induct2
( n0 a; j$ i0 H- n0 K* o    while A_i<=30 do begin6 i1 h8 {3 @1 w5 m" |
        travel to pickaisle.con(A_i)- [" j  n; j% ~  I) K+ }: w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" z4 G* I# E- q$ ~6 W" m, l        else wait for 10 sec/ }& E! R! j4 a0 \9 g  B
        if A_i=A_leave then send to die
; D0 I6 w7 V( l% M2 @) E: z- m        else inc A_i by 1
* |9 H( f' i/ g- `1 j0 ^7 i$ n    end, X& Q: w* w4 v+ w$ U
end  R8 X0 G. m) b) C. u* X/ F) O- A
' f" @/ b1 l) \
begin P_pick3 arriving9 T7 a5 s  m: F" s
    set A_i to 21
+ o, M' |/ R9 X. J: }" x    move into Q_induct3
- Q# h5 v: p9 A  k, b    move into pickaisle.induct33 X, ^) q8 i- K7 D3 Y
    while A_i<=30 do begin7 \3 g3 d% l8 k( c$ |% e
        travel to pickaisle.con(A_i)
* k0 {+ {8 U  b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( {! F3 n/ X$ K* |7 l# s
        else wait for 10 sec
. I: P' M! ]) W; Q+ J        if A_i=A_leave then send to die8 u9 Y1 T* T1 C9 J' f/ J
        else inc A_i by 1! j' [: V5 V  {* R
    end* m3 E- P6 L) g+ l& J. V* N$ A
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是个什么东东?! E$ Z5 U6 k7 Q# x9 V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  a1 n3 N  G5 ]+ J  t

' R1 `3 r4 C  D# ^( k" J' zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" ]3 ?. \; m' o- f% v
4 k" h+ n8 \0 W5 s: T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 N) m) ^9 S  m0 X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ U: q. M: E: m! S# v2 k2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# t/ o) V2 ?( u  r+ w  k- e  A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. a7 D, e% K- ^, W" |begin P_induction arriving
/ W3 G) v, a# T2 V0 l, r4 |- \+ z    clone 1 load to P_pick(A_induct)# J8 u' Y* g/ y2 O* |9 e9 k4 v" u
end最大的系
9 t8 }3 F# W3 z& {
* J5 Z. K. f6 M4 t" R. b6 h: rbegin P_pick arriving
7 d) Z5 T5 S. ^    set A_i to procindex * 10 + 1
% v' U4 S4 o7 @) x$ s2 n* h/ P% V8 B    move into Q_induct(procindex)* \/ G7 @9 |8 d* a' X3 f
    move into pickaisle.induct(procindex)2 |2 x3 w0 ^3 [' {4 w
    /*check the type of pickaisle.induct(i), for your last problem.*/
( l* V2 M; N; ]4 N/ X4 E
* M, j% j4 }: o* X' m    while A_i<=30 do begin! r8 w# }$ E; d5 C) |" K
        travel to pickaisle.con(A_i)
0 O. T5 B8 K% }% z* ?6 \/ w' {4 [# ^) P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ \" F  e9 A6 ]$ D6 [& y
        else wait for 10 sec1 Z3 q" q, V5 x! w2 p
        if A_i=A_leave then send to die
; C4 j4 `: i5 v( A        else inc A_i by 1
- J, r2 `! L0 U    end8 Y) v' U8 G1 J' B- e
end5 O! U, o5 O& h+ |
5 J( ^$ B7 K2 _9 h8 g: q& B
其中的procindex为整形,代表当前process的序号。
( Y$ P/ g& ~% B4 q6 h6 C3 Qstation和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-24 12:36 , Processed in 0.018664 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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