设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11597|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! ^4 q5 J& m8 i: p6 W
# j  x2 M; x6 f8 @4 f1 g我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ m0 v/ m% h* Q* u1 Q" j+ I$ A7 i& p4 w0 w
begin P_read arriving
/ \- W* O/ K( x; Z    while 1=1 do begin
2 s2 o) V& }+ \. z        read A_tote from "data.txt" with delimiter "\n"3 G9 Z) J) x- }0 i& R9 p8 l  T6 A
        read A_time from "data.txt" with delimiter "\n"& y0 k. T3 @! P, E  q) x# i3 O2 H' r
        read A_leave from "data.txt" with delimiter "\n"
4 G/ r4 G6 c: Q- G3 j5 l  o        read A_picks from "data.txt" with delimiter "\n"
. S- B2 n6 h5 R3 J5 i        set load type to A_tote  X) w$ y# ^+ S% g; p
        if A_tote="tote 1" then set A_induct to 1
1 H: m* L6 O$ R$ b5 z3 R. F        else if A_tote="tote 2" then set A_induct to 25 Y9 a! r( }3 o$ e
            else set A_induct to 3   
/ M3 |6 S+ w7 G* U        set A_i to 02 Y& d7 A* \( g
        clone 1 load to P_induction
7 \5 D" @. Q9 X* W! D( a! @        wait for A_time sec
$ |2 _* a! B0 K/ {: M2 T    end  G" w  K  ?  [& Z& _. Q% t6 K
end; k  S! j2 d5 e, z
6 @. n2 E* m' B  P' |5 h: F1 [. ^% \9 A
begin P_induction arriving5 }$ s. L3 G, @
    if A_induct=1 then clone 1 load to P_pick1% }7 o" O2 q1 f: S# }1 P
    else if A_induct=2 then clone 1 load to P_pick23 J+ F- J7 ?! U- ^( u2 V/ x
        else clone 1 load to P_pick3
7 G) G' `, y: Tend8 @# |2 ^2 u; f' w! B) s

9 f6 a1 x; ^; Y8 hbegin P_pick1 arriving* D* `% J0 Q9 B+ I; N! s, e0 _
    set A_i to 1
, J' F0 i3 h" N: i0 K9 i    move into Q_induct1, j' w9 _; J- m9 i
    move into pickaisle.induct1) [9 \# r. w2 @9 S
    while A_i<=30 do begin4 Y% [5 i0 F' E5 L- i& s
        travel to pickaisle.con(A_i)
% f8 k( w/ G5 S. v2 z0 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 U9 S/ \4 b( H+ W: a6 q- W0 P! q        else wait for 10 sec$ X) M2 W3 @* ]4 H) j. o
        if A_i=A_leave then send to die
" B' T& n! F/ i- P7 ?        else inc A_i by 16 a: X) E. \. N1 ~6 F% w
    end
& ?# p( Y: s9 j1 lend
7 p' `0 x2 U+ m% k* x& |8 h3 \, M/ |0 n3 q+ [5 A. G* M
begin P_pick2 arriving. `" A$ X! C' C" L5 R. W- @( [
    set A_i to 11
/ p3 X' L' y  ^- ]    move into Q_induct2: E& v4 z4 o& ]) n3 U
    move into pickaisle.induct28 t) p+ J, F( u" i
    while A_i<=30 do begin. [& P' n! S8 Z/ v5 g  O& T! a
        travel to pickaisle.con(A_i)+ X0 ^% H0 C% W  y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; L  H5 F8 S1 M5 C1 P8 ]+ W9 L4 M0 V
        else wait for 10 sec9 R( `( s& n: e3 Z
        if A_i=A_leave then send to die# r6 Y6 j: w7 ]; h# V
        else inc A_i by 19 Y$ b9 q, u; X* X* s! `. R  U# R/ Y
    end
4 P6 f5 h4 ?& Y% E' s% I/ {& K$ }end; r! c5 R% r- l$ G: A

; y. s' |! L5 d% H/ R0 Gbegin P_pick3 arriving$ K5 e! e- K) w, ]
    set A_i to 21
8 O7 W8 A/ e  F6 ?' M    move into Q_induct3
1 r! P) Y5 G  W" ~- \! {( J2 G. `+ ^    move into pickaisle.induct3
+ T: e" A+ X5 r9 W5 _    while A_i<=30 do begin
4 S* F* j9 C, x        travel to pickaisle.con(A_i)
& Q6 n$ l; \, l: C6 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. c& \& u9 p6 |* s  I4 S" U" Y
        else wait for 10 sec+ t& H1 J$ z6 C
        if A_i=A_leave then send to die/ v8 F7 s# \. Q8 y7 O8 N
        else inc A_i by 1
& a% b; ~" I" e3 i4 ]    end
3 N0 b& q; Z% R* _' rend

最佳答案

查看完整内容

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是个什么东东?
6 S$ r+ ~+ j( q2 n3 dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: Y7 ~* N0 D6 B6 r/ E- U" \! L3 N* ]" |, D8 K$ i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) a2 d- g3 i9 j3 t
5 Q6 ~; u4 H* c& Q( g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ c( Y  T, h  X' U. o3 Y4 v5 x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 L; j5 ?, {/ P: ]5 ?+ N) s$ {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 t0 g  g/ x) B5 e3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' U8 H( _$ b: H
begin P_induction arriving6 v$ R: h2 j0 {5 r; U0 P
    clone 1 load to P_pick(A_induct)6 ~" g. O  {+ b! s
end最大的系8 L" w/ Q1 d4 ?; t$ o0 I% S6 w
9 z- j$ `( A) H. }
begin P_pick arriving3 h3 c! i- {* g
    set A_i to procindex * 10 + 1, E; }1 F- L5 P  @5 u% X
    move into Q_induct(procindex)! }) i0 j/ }0 Y  {( g
    move into pickaisle.induct(procindex)0 P2 i# _  V" ~# f
    /*check the type of pickaisle.induct(i), for your last problem.*/& ~$ n5 J, b( x) E7 Z3 R# W, @

9 k, u- O1 n* A* s1 g- p    while A_i<=30 do begin2 F4 S) z; W2 o- J: A. @6 A
        travel to pickaisle.con(A_i)
& j4 J( M; B, N/ X+ r0 B/ X" I$ [, ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ e$ J0 L# ~5 E- Z
        else wait for 10 sec
& s5 a( U1 r: J/ M1 R' B        if A_i=A_leave then send to die
4 A; n8 }+ n1 L        else inc A_i by 1
. x5 W3 i* E# f+ j    end
* {2 W) ]4 V1 S) y$ R' }end" P7 j% I" B3 @% g+ A+ b/ E

' F* a) o* v. |& B1 |其中的procindex为整形,代表当前process的序号。
7 c/ D1 P& x: \" [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, 2025-11-22 20:30 , Processed in 0.019668 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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