设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14758|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! W  E: {! F1 o, I7 ?
( X$ h) V6 L) T, k! a- L4 \' `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: ?0 h% u4 r5 }' [6 y0 q- u8 P9 c3 p* G2 ]+ `
begin P_read arriving( S; O7 \. i4 I4 R# E$ b
    while 1=1 do begin
$ D/ p) P3 r  K, L5 G/ u5 u! R0 X        read A_tote from "data.txt" with delimiter "\n"/ _9 `. t" f. {- }# f
        read A_time from "data.txt" with delimiter "\n"
7 J9 c( B5 n! N8 @        read A_leave from "data.txt" with delimiter "\n"
4 i, F" W* _5 F* B9 w  C; ^8 j        read A_picks from "data.txt" with delimiter "\n"6 `. L3 \( |+ U! W0 g
        set load type to A_tote8 c" b3 L$ n* ~9 G3 l
        if A_tote="tote 1" then set A_induct to 1
+ T- Z: ]5 y( f* h& |  h' g. H) q        else if A_tote="tote 2" then set A_induct to 2' o+ A9 q" C% F* x
            else set A_induct to 3    " K' H+ D' B$ E
        set A_i to 0* g, U8 C0 O/ ]% L4 s. }6 S4 K) g
        clone 1 load to P_induction
, B* e# }. s" r6 a; o9 d        wait for A_time sec
/ m0 x% d" N' e3 ]( l7 v5 J; x    end; ]9 E, z$ q; d$ }" j
end
+ J% _' d8 u5 `9 `5 b0 p
  M0 k/ Q% e* u$ {- k8 S& e7 U; O& ~begin P_induction arriving
2 |3 E* o# Y& C% V; {$ ^    if A_induct=1 then clone 1 load to P_pick12 G" \; w# S, s" g
    else if A_induct=2 then clone 1 load to P_pick2
$ e( T: N& s9 Z# n- F        else clone 1 load to P_pick3
; H& A4 G- K* L' Fend9 v' ~5 m+ ^+ P) l; W" p

5 {2 z  e: T- K+ O' ]5 Sbegin P_pick1 arriving5 `7 _7 i# Y* i: V
    set A_i to 1( I5 ]1 `7 x* ?8 ~) Y  [% |
    move into Q_induct1" K1 r: N* A+ j
    move into pickaisle.induct15 s9 S+ T( M% U! B' {
    while A_i<=30 do begin
9 D9 C  l5 c' K& j        travel to pickaisle.con(A_i)
6 z" w4 c6 Q- H* Y4 @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* f; a! j5 d4 m! x( b  u
        else wait for 10 sec1 }% c: c$ R( }, ]) _: [
        if A_i=A_leave then send to die
5 ?+ k2 S5 \# s7 J5 l' h        else inc A_i by 1
6 _! q$ _3 G: u+ K4 Z5 M: e3 f    end
0 d8 U; v/ D# h- x+ ^( ?end
( U% W, \1 d/ i- w  ~* _: G, Y. T5 ?8 N/ H+ _' T1 }
begin P_pick2 arriving9 w- X0 M5 H% ?& W$ c" z* b
    set A_i to 11
" k* ^8 C5 Q8 ]" F% X    move into Q_induct2
7 R/ g( \, b/ ]6 Y9 ~    move into pickaisle.induct2
0 Q# f, S% e; [$ W) M    while A_i<=30 do begin% H/ `* K$ \) F: [$ p6 B
        travel to pickaisle.con(A_i)  t* J0 K! _2 W! O( m' K, ?' u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ @. k" Y2 g% W" h5 V5 }$ i) X        else wait for 10 sec2 C  p3 t. v+ g  _8 Z' B
        if A_i=A_leave then send to die
- c( V9 D5 S6 Z6 z' R/ V6 c) {        else inc A_i by 11 T' W, f1 `8 L  K: {* k
    end7 j4 k$ W" j" w" ^- m2 G& c
end
& k% ?# m/ q: l% m! D$ W! L
8 }& T5 o+ C; r" @- Zbegin P_pick3 arriving
. f, N0 n9 j0 o  ^: @    set A_i to 21
. u% \, S0 l6 S6 a. _    move into Q_induct3; D. b4 K$ F! V
    move into pickaisle.induct3
; E+ r0 Y/ P  S* c# k) [& B    while A_i<=30 do begin8 D( o' Y7 t9 q" p
        travel to pickaisle.con(A_i)
9 ?; M5 k/ f0 r  e! r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* o) m+ q+ r0 w% L' c
        else wait for 10 sec* x; E- y5 m$ i: E
        if A_i=A_leave then send to die3 J$ {6 X* B; }+ o9 s6 @  m
        else inc A_i by 1
3 ?% A- C0 R" v$ N, \( |: R! C    end4 I5 y! F0 H4 W8 G6 h- q! n. F# ?: D
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是个什么东东?1 u8 i* S! e# x  |: U2 B& _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! G' R) t: E& P. W4 e* C: `) m
& @' u6 V& n: Z4 Z3 X) K2 s, U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 ~6 Y: D# B7 N
$ o) j2 p0 i% k3 [  L# R2 |( {8 m9 P5 |( [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) i/ i* E1 T3 r! L% j% b) i1 U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. s& \. v2 r  B, @: F- O( u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 _8 Q/ v: m: c3 c0 {' i+ S) h  ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' b2 p8 h/ n0 Y. `begin P_induction arriving
2 s5 {4 X8 D" m6 G3 M1 `    clone 1 load to P_pick(A_induct)
5 [0 {0 `1 c, t6 \& Z9 ?' r+ uend最大的系
- d! ^2 T8 J# ?4 R" @# S0 O+ @1 [& r, E7 G
begin P_pick arriving5 }: F) |/ q; x* Z
    set A_i to procindex * 10 + 1& d5 f: v! P3 _/ W: P
    move into Q_induct(procindex)! P8 B6 T8 u9 n
    move into pickaisle.induct(procindex)( @8 G9 g9 d( o2 E  Q+ A; L
    /*check the type of pickaisle.induct(i), for your last problem.*/$ s0 w9 B" j) o0 j, V
" c  `; _; j4 g4 k, r
    while A_i<=30 do begin
! o( R. ~" c  x! P  ~. e        travel to pickaisle.con(A_i)
$ n! X' X0 p! t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Y' K- _7 F+ H6 r9 y, `
        else wait for 10 sec6 h( C7 V6 S/ ^, h2 G- E% q+ t
        if A_i=A_leave then send to die8 l) k, a! n% k# P- P
        else inc A_i by 1
4 J* Z9 g3 r7 b) n5 P    end
. z/ h* x% k) a1 I+ M+ W1 I8 Y8 G, send
' U3 M* Q6 ~" t8 o" }
6 {+ ~4 i( k# |3 I& A4 c' i其中的procindex为整形,代表当前process的序号。+ Y) B" k- X$ E% j2 g
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, 2026-7-25 18:48 , Processed in 0.019049 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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