设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14917|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. t) j( n$ v+ l3 U3 O4 ^) V% U
5 [/ d7 q! z9 M3 c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 i, W  D7 ~2 b, M% |0 L+ H
2 N& h7 j$ u( l+ abegin P_read arriving
  A7 K) Y8 r$ c. N$ f6 {    while 1=1 do begin) U! k8 ?, l/ j0 ]
        read A_tote from "data.txt" with delimiter "\n"! w5 K2 U$ c" S) ~
        read A_time from "data.txt" with delimiter "\n"- _* d' ?' o  q6 F9 N
        read A_leave from "data.txt" with delimiter "\n"2 B; V5 W' |& A* {/ l+ C: p
        read A_picks from "data.txt" with delimiter "\n"3 R  z: D7 C2 _! x
        set load type to A_tote
. e1 m9 O0 v2 O        if A_tote="tote 1" then set A_induct to 1
, f, A+ ]9 N$ Q& I1 k        else if A_tote="tote 2" then set A_induct to 2% h" w) X! n  \6 e+ T* v
            else set A_induct to 3    , e( Q* ~: u5 x4 l: P& ^
        set A_i to 0
0 Q0 b  L2 T! h/ M. p% m        clone 1 load to P_induction& H, i# N1 M5 C* J: T
        wait for A_time sec
9 B- B4 e4 x! c0 F7 O    end# H4 r  k1 n" j2 h1 {2 m) L. V
end1 R& [1 \4 h/ r3 g6 `

  W$ w& D/ E3 K; V1 k8 t) Ebegin P_induction arriving1 D  T' l  w) g. f
    if A_induct=1 then clone 1 load to P_pick1, D0 D. ~* z/ b* g4 i
    else if A_induct=2 then clone 1 load to P_pick2
; k! u4 T: U- p! X; t0 z, i        else clone 1 load to P_pick3% ]$ Q* `( P; L) d
end
. `7 E% E! ?# \4 X: c/ i$ Y0 m) [9 _1 e' n+ D5 g7 ]$ L( m
begin P_pick1 arriving! R- m. G8 j3 N
    set A_i to 1" [0 S- g1 O- [. [$ d1 `. s
    move into Q_induct1% M- {( m5 v. B2 R' \- D2 a9 F
    move into pickaisle.induct1
, J8 @5 m" \9 z    while A_i<=30 do begin
$ u8 S" w& J  C% c        travel to pickaisle.con(A_i)- V# I! @2 Q5 ?0 [" E& G6 u2 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P) {( e7 ]; U1 N( j
        else wait for 10 sec
* H+ j! D% _5 l, C, V" m        if A_i=A_leave then send to die, H; [  [7 m9 p, ?
        else inc A_i by 1
8 K9 Z3 K9 y" x0 G8 Q7 C9 \- |    end
9 x7 k; Z2 b/ T1 A6 c- `end8 g0 E! d0 c- v# a

* f  H3 @. {6 a0 T3 Y6 dbegin P_pick2 arriving
' W3 E' p% h! ]    set A_i to 11; c) ~( l$ l- u5 x5 h$ X8 G8 Y
    move into Q_induct2# p* t( ]3 G+ F2 j* Y" V3 z' g! h6 z
    move into pickaisle.induct2
" a2 q' l, D' r    while A_i<=30 do begin
( E! V3 e7 F) k1 p5 d        travel to pickaisle.con(A_i)8 E( c9 r# x7 D& r# k  H8 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 s9 c- r* E+ _: y" `4 v  H
        else wait for 10 sec2 \- T( D' P+ e5 i9 v# I" v/ n' e
        if A_i=A_leave then send to die: d) C& U7 j/ @+ c) A
        else inc A_i by 1
+ q, a  j" c- d3 _) {* `3 y    end
" ~  ]( ]; y3 t2 y8 t0 v. ^end
2 A' K( J9 v; @* n: Q0 Y5 O8 K) ^, k6 v$ {6 e$ E! M4 `1 k* ]& }
begin P_pick3 arriving
+ \4 d0 X3 z1 r" C* V  s+ G/ ]* D" _    set A_i to 21
) D. |2 g& |/ ]1 K# c, ^4 M    move into Q_induct3
1 S( {# T) m4 S+ c( w4 H7 W3 T1 [    move into pickaisle.induct3: g/ v! g+ Y/ k8 L& k. S
    while A_i<=30 do begin5 ~$ K: x3 W! f0 P
        travel to pickaisle.con(A_i)1 \6 E; ^, |; F4 I7 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& ?. R  p/ S$ a+ a        else wait for 10 sec
& B5 Z* g; D% q5 \9 m& x$ z        if A_i=A_leave then send to die! o* {: p% ?4 y! Y
        else inc A_i by 1
# v! R: A+ a' h. G- R" e    end
5 Y2 _( n8 d# D6 h  }# j! z9 }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是个什么东东?6 M9 a' }% l0 `* J' C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- c* }4 Y6 I# t9 H- g, ?; g% Z1 g$ `5 Y9 N# _+ F: P. O4 `, {
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& k$ r6 ]+ L5 O! l( Y0 Z8 i! L& V7 k  `5 C% }9 K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! }( _) [. T  w& i1 r# c. ^+ R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. h1 w- A& o7 Y, P: }+ s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 i" }; n3 Z' D+ q0 T9 x- U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. [/ k" ^" {& E- I, q1 v
begin P_induction arriving6 d4 V  A+ j3 e8 z
    clone 1 load to P_pick(A_induct)6 U+ u$ ^4 P; h! F
end最大的系
% S6 x( f* a) @: E
  A' b; U" w! t4 a1 n" {1 ~begin P_pick arriving
! D1 l7 Z: K) m( }3 [    set A_i to procindex * 10 + 1
" `1 `5 t" Z+ A. r9 p+ |    move into Q_induct(procindex)0 }: l, w) Q5 c4 C7 H9 \
    move into pickaisle.induct(procindex)8 I  D5 U; e2 z& N
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 y5 F9 i, k8 H- ?3 V& [8 B
5 }. Q) R9 r% u, O5 r: `; X/ P1 g    while A_i<=30 do begin
5 W+ X  G9 P. E- K. d8 x: ]2 x        travel to pickaisle.con(A_i)
. x! {6 w0 b7 {' O$ c% f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- ?. y$ ?3 I, I; |+ u0 u        else wait for 10 sec
4 p% c) P8 F* Z9 k        if A_i=A_leave then send to die
& y* J' L( f1 J  A  x2 e7 z  @        else inc A_i by 13 d8 {6 g4 x7 Y# `
    end
: M! ^3 L4 e+ ^: Xend
' y0 w0 I6 s6 ^5 z5 \$ X; u  I0 ]0 |8 \
8 m7 P5 _' ^: P9 A4 Z其中的procindex为整形,代表当前process的序号。
" G/ [( m$ D. z8 I# r) p8 Lstation和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-7-31 10:26 , Processed in 0.019687 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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