设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12823|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* C7 N. W4 J! |6 X# e4 `
% r5 s2 B8 u) K7 Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. |2 E( s! @6 C$ i0 a# |- W: E0 U
! B/ X% e) A/ T* B" p
begin P_read arriving$ L% H1 I' G6 l8 h
    while 1=1 do begin% n! I- T( q$ |# B; U2 f8 }* p
        read A_tote from "data.txt" with delimiter "\n"0 |3 {$ d) X, ^8 o
        read A_time from "data.txt" with delimiter "\n": c: \4 S& K2 C' }. _9 r  P
        read A_leave from "data.txt" with delimiter "\n"( C. d& J8 ^5 k$ E0 g/ ]3 \
        read A_picks from "data.txt" with delimiter "\n"! W5 U, Q! p. r1 @
        set load type to A_tote
; K9 b: t$ T5 o* p9 v        if A_tote="tote 1" then set A_induct to 1
- d8 ~- L2 \  b        else if A_tote="tote 2" then set A_induct to 2* p. Y, P0 f& i
            else set A_induct to 3   
# G3 N$ K. x5 T5 z( n5 ~/ G        set A_i to 0; v2 c- K2 L2 o; ^+ i, n
        clone 1 load to P_induction: ?* J) P, l' Q2 H8 ^$ K6 t
        wait for A_time sec
+ S1 R3 s: D& ]2 ?6 z    end
0 Z+ _4 w6 K/ ~# U& x  O2 Rend2 E* N: {- O& f- ~+ E; U4 k
8 j( Y" x! a8 U; k& q# g' n5 j4 ?" D- i  ^
begin P_induction arriving
# d$ ^& c  x( c: U. k. Z    if A_induct=1 then clone 1 load to P_pick1
' v0 r$ f! ^% F( S    else if A_induct=2 then clone 1 load to P_pick2) z4 f( x. S) L7 l. ^2 ]
        else clone 1 load to P_pick3
6 y5 U- d, x* p6 zend
( O- y8 S; ]6 ~9 Y* ?
) S9 K$ C" _6 I! }begin P_pick1 arriving/ Y3 m1 m+ c4 n" L2 X* ~8 \; [9 n3 H) i
    set A_i to 1
+ K$ P. i! q6 Y7 L; k* T    move into Q_induct1. y! f7 [* B5 v3 B
    move into pickaisle.induct1
% W! O! g3 D0 c3 [4 f  k    while A_i<=30 do begin
  c* j" s, y3 m6 b0 o        travel to pickaisle.con(A_i): \9 b+ F( A) W. v# {% O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( o, g0 L( ~) m6 j7 ^1 Y
        else wait for 10 sec( j* ^  I  W, J
        if A_i=A_leave then send to die8 ?$ J8 L1 B" c0 s/ P7 K+ U4 D1 A) O. ~
        else inc A_i by 1+ E" A( `! o" C# e' k& Z
    end2 V) O" h9 F8 x, n3 }, e) B
end
- z: f3 d  [2 g: Y; q% U4 X0 k$ w5 N- u; a
begin P_pick2 arriving
4 j. R9 C% ?- |; J# p! \    set A_i to 11
! {5 D, ^& Q( b; U  h    move into Q_induct2
- X: S* i' A8 f2 o( J$ E- Q" G    move into pickaisle.induct2
5 i; k, U) r% h$ V    while A_i<=30 do begin- @' C6 q  H9 z4 S
        travel to pickaisle.con(A_i)
* T0 ~. T7 A9 n* m9 H" e$ e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 ^3 s+ f0 G* _9 n
        else wait for 10 sec
2 U5 E: |) Z6 @3 Z  z        if A_i=A_leave then send to die
. ?# O8 E: ]9 ~. Y; y" D: c! _+ s        else inc A_i by 1% t" D1 `( v8 T
    end
2 D/ }* ^1 ^, eend
, a' R( Q0 o- S$ v, a$ v0 |$ ?
5 Y8 [% j; `9 i0 K9 [- ]& [begin P_pick3 arriving
8 v- Y( u5 u" I( f" q    set A_i to 21+ a" Z/ p- T7 K. d# @
    move into Q_induct3& _5 ^, J) k" T9 D$ l! K
    move into pickaisle.induct3' t  _2 e7 T$ i+ \0 d+ V( o. B
    while A_i<=30 do begin
- k/ l) B5 K" r0 s* w! `        travel to pickaisle.con(A_i)
) a5 o) f7 g& g0 e/ ~2 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 c1 K5 {/ N* }! k" j        else wait for 10 sec
( ?  }) }  b+ f1 Y- x        if A_i=A_leave then send to die8 F- S3 a0 A; o$ M7 V2 w
        else inc A_i by 10 J$ L( T- e" c
    end8 S" m1 d) }: g+ l
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是个什么东东?
* }2 [) r( O0 }0 T; nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; n+ V" W' c8 z9 ^! O( u
7 `  H! h; [9 ?  H( s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- k) V; s1 r6 D; s0 Y- R6 N: S: j+ G+ x& o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ h& X* ?  V2 \, n3 Z/ G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 t+ u" t4 D+ Q* e, K2 ^' |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 }: G" r) T% }( a. r7 x1 }; e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% |6 T0 V1 X: v4 n- W# K
begin P_induction arriving# g5 v6 E. V7 ^- g1 B- h- [
    clone 1 load to P_pick(A_induct)* C/ K9 a6 T" g1 h1 E6 w2 k
end最大的系
3 Y9 f7 |& M. ?, P/ ~: N! C- I5 e6 i3 K& m+ W* X
begin P_pick arriving
: |" N+ [4 C) l    set A_i to procindex * 10 + 15 j" L0 P2 E& \: k- q$ A& b
    move into Q_induct(procindex)# j6 x6 X; s% }6 l% `% J
    move into pickaisle.induct(procindex)
. J$ e) T. _% r. X6 Y. @& n$ s    /*check the type of pickaisle.induct(i), for your last problem.*/
: N8 ?' Q5 H6 f
* g2 l% q4 v! R6 p( r; x) [$ X    while A_i<=30 do begin
) `7 z& I8 j1 i! O: r9 k) R        travel to pickaisle.con(A_i)7 G% g' E4 r: V: S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 X' g- e% B5 m9 R2 }# B3 ^& W        else wait for 10 sec
: a* R4 M9 ~6 {  O7 V( d; y& ^        if A_i=A_leave then send to die
9 n5 U3 ^  h3 w        else inc A_i by 1! G3 B1 q1 q$ _; p* }0 }3 Q
    end# O- l% A9 K. |( b" n& N
end
) A$ k; z0 W3 B8 \4 p( p/ n8 G
其中的procindex为整形,代表当前process的序号。
# t1 H: ]4 Q! H" d, Gstation和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-22 18:39 , Processed in 0.016476 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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