设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13799|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ ?" x! y! ?9 F( P: ~+ a
" X0 a) O  }3 O) Q* I/ |我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. r+ F$ Z0 w3 i
! |/ e6 @7 }/ X$ D& _begin P_read arriving
3 {/ y; B. ~  O$ U9 h* J    while 1=1 do begin+ Q6 b8 W% V6 m8 c, M
        read A_tote from "data.txt" with delimiter "\n"
/ p; J! K6 }# l$ Z4 a        read A_time from "data.txt" with delimiter "\n"
: X  B( h' p( l9 P+ U2 h; g4 A        read A_leave from "data.txt" with delimiter "\n"
( r4 D2 U' h" E4 L: y8 Y        read A_picks from "data.txt" with delimiter "\n"
% U' N$ u+ h! y: c        set load type to A_tote
. W- m2 C- v1 W" g2 g/ n        if A_tote="tote 1" then set A_induct to 1( C6 e6 w# o+ ?. O2 r
        else if A_tote="tote 2" then set A_induct to 2
3 X! r; a3 y; l* n) k* \+ v            else set A_induct to 3   
( c, h: D8 o1 D6 Z3 w) b+ A) y( m        set A_i to 0
& M) Y7 z( \; O1 |7 M        clone 1 load to P_induction; _8 S8 z/ o# ^& P* E! n2 E
        wait for A_time sec
" p- p- t. e6 Y5 Z- A' }  g7 Q    end4 b1 Q1 H1 C" d% r* `5 h' b6 [, ^
end
0 \; Q/ Q# C5 A9 c7 }; G
/ {/ [/ M$ E0 hbegin P_induction arriving. e) j( z- Y; }. B& j( h
    if A_induct=1 then clone 1 load to P_pick12 Q  q8 l: i5 w% X6 ]/ ?( a2 k
    else if A_induct=2 then clone 1 load to P_pick25 C  t. f% _" k; ?/ g
        else clone 1 load to P_pick3
5 o0 I' r) }/ w( m) X2 A, N% [end
; V/ V4 n& ]5 M9 ^: E6 m0 I' w0 r) l5 d: ^. Z
begin P_pick1 arriving5 q! Y& B& T: K6 O# z
    set A_i to 1
/ p" D9 I4 d; m$ C& g2 q$ z    move into Q_induct1
0 S2 R) c9 n6 z. B  d9 y    move into pickaisle.induct1
7 J- h. _8 j' C. U    while A_i<=30 do begin
+ G* w, B# T; ~        travel to pickaisle.con(A_i)
- b3 Y4 y+ o4 n$ A& [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% p* G" r0 l* ?8 N; Q1 Q        else wait for 10 sec
% Z+ N2 J3 G2 A3 ]        if A_i=A_leave then send to die8 c! Z# V( `5 ]8 {9 L( J
        else inc A_i by 1: _# H1 L$ j8 i/ O! E( G
    end  h( w# Z, {! |/ l- c% ^" v) M, ]
end
! t/ X& ]* a" c9 P# i( _) k" b
4 U* j! y# |, qbegin P_pick2 arriving
: w7 @1 ?5 H8 l9 ?- u+ o6 }5 |" K8 F    set A_i to 11& W6 s  k/ A, L, N1 }' G
    move into Q_induct2
0 i2 n5 Y; k  V8 ?( z7 V6 ?    move into pickaisle.induct2% r! A( O' `) v* S, i/ y
    while A_i<=30 do begin
% Q: d% l: E  _  @        travel to pickaisle.con(A_i)
! @4 O: @" U7 |1 }3 R6 u3 T) e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 o* d+ c* b3 X" p/ e        else wait for 10 sec/ J! s( A( q( l, n
        if A_i=A_leave then send to die
- M3 E+ B; U- M) w  m        else inc A_i by 1+ k  q) t; q8 D* [& j# Z
    end8 l. V5 N+ ~6 R, U' T1 \
end
- x2 q. m* K* S- g0 g! e5 b' j0 z2 O8 l) i" h0 Z0 a( K
begin P_pick3 arriving
" s7 t2 M- j5 t0 r    set A_i to 21
8 g/ _' c/ a5 v: R/ ?1 ~    move into Q_induct3
4 c, G" _$ z7 V0 \5 s    move into pickaisle.induct3# L% \  Y* h/ F+ h0 O# f
    while A_i<=30 do begin) S3 y8 R$ S( D) W2 J
        travel to pickaisle.con(A_i)2 R6 C1 M1 T$ r1 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 m' D* |* R7 W9 V' i$ O. c$ p        else wait for 10 sec7 l8 {6 r& U: b: h7 C3 y
        if A_i=A_leave then send to die
* l+ T* M5 {+ }1 P' t, S$ Q        else inc A_i by 1
7 {; e3 F( m) b1 \( r    end4 b0 {  \  J) i4 ?  I
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是个什么东东?% L" |; k" k1 B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' V+ P1 N5 t! G# a% i9 c
1 p5 K: ^" D6 h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& f  m$ R7 r; z# R1 N9 M
+ E* T5 v( B9 ]2 u9 L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 \0 P2 |2 X* O% ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 T  @) B: W# B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 M! G* G: D4 \9 o) |6 [: ?8 c/ i
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& f% K5 r! s# L/ }+ l) B
begin P_induction arriving
1 X% h9 _$ X; b% A0 U- s0 s    clone 1 load to P_pick(A_induct)4 f8 Q% o7 b) a2 ?7 U& c! p7 v
end最大的系
, F- ?4 j2 J4 ]; Q* g/ e* R& K
8 P% x: |# W1 P7 X& Dbegin P_pick arriving
5 m3 a6 c6 I' Y+ y* `    set A_i to procindex * 10 + 1
, h1 S: Z  _$ [+ f    move into Q_induct(procindex); {6 c# f" r) K4 s- v  ^
    move into pickaisle.induct(procindex)5 C, u/ v0 `6 T2 _: V
    /*check the type of pickaisle.induct(i), for your last problem.*/
- Y7 h. J; u4 L' _0 p
1 z2 \- j: L( b2 q8 J5 C    while A_i<=30 do begin
! t  I  u1 {! N7 X& ]        travel to pickaisle.con(A_i)" H. j  O, l9 K* q9 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 \  b# o* J( o4 P% ?8 q* T$ w+ J
        else wait for 10 sec
0 Y) y6 G& O' I% M# I& p5 Z        if A_i=A_leave then send to die
" Q! Y) Z& O4 M4 D        else inc A_i by 1
& ?" E! ?* ^1 T  Y/ g    end* H6 e2 p3 ?* Y3 c
end
4 o! Q1 r9 u6 w5 K3 @7 t1 \) m4 p  E9 W; }
其中的procindex为整形,代表当前process的序号。
9 H: ]/ s. L, wstation和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-5-6 06:15 , Processed in 0.014813 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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