设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13465|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* K+ |" z1 c4 W( a( o$ Z& r

9 ^7 w# O4 l: a/ t我的问题是,在每个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中的数值,不知道会不会有什么不妥。; b$ _( B. |2 x$ X, F4 M- l

. V' I- Y% o. J1 D+ V) `9 D9 }begin P_read arriving
8 O& H; L: k, \+ }5 N' F. w    while 1=1 do begin4 ~) G* F3 V1 U5 a
        read A_tote from "data.txt" with delimiter "\n"
# @6 Y8 l. E2 w$ K/ C; w        read A_time from "data.txt" with delimiter "\n"
3 U0 [. p5 l& b2 k5 ]3 L        read A_leave from "data.txt" with delimiter "\n") F: g! |, O* Q# C3 a3 t
        read A_picks from "data.txt" with delimiter "\n"
6 G& v8 Z  s( B8 S        set load type to A_tote5 n! T8 n6 P8 s7 f3 m9 R* U
        if A_tote="tote 1" then set A_induct to 1
/ B3 P0 E: X5 ?8 q7 B        else if A_tote="tote 2" then set A_induct to 2
- i# A* N1 W* N  F            else set A_induct to 3   
8 w/ G% S' s3 `' O. t        set A_i to 0
  a' U4 C  k0 R* \        clone 1 load to P_induction) R/ S7 M. e; B  P/ `- e1 z3 x
        wait for A_time sec
! `( F% L; J2 S) I+ u  @; T& W    end
0 S9 B+ d/ n/ L* D$ Y* ^end
! \3 Z  P5 u" O. s( y5 q
! X5 m2 S9 y8 u" U$ f( obegin P_induction arriving
; Y8 t' ^9 ~, G" w* @    if A_induct=1 then clone 1 load to P_pick1+ W4 Q/ C' b' Y% L6 \
    else if A_induct=2 then clone 1 load to P_pick2
) _, i9 f! Z+ h6 q5 C        else clone 1 load to P_pick3
6 D0 n  T3 V' I% e: wend6 O# o. z4 a. g; h0 i

! o0 u' t% S8 W3 K, l2 i$ z0 Bbegin P_pick1 arriving
& W+ k7 V8 C2 A# z7 g# v7 h( C    set A_i to 1+ h: P7 w+ \. J" Z: `( f: |2 I
    move into Q_induct1
. K/ H% p" L1 d+ n: O    move into pickaisle.induct1
1 v: T. ~0 x+ Z    while A_i<=30 do begin
8 C# j& V. o! E8 |- U. N' `5 h        travel to pickaisle.con(A_i)) M5 [& T% l. B! |7 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  b* @2 {- P2 R  F. U        else wait for 10 sec2 N+ R0 y5 M3 E. K
        if A_i=A_leave then send to die# d( Y1 ~3 {9 k& W: A. t
        else inc A_i by 1
9 M* k; B! {: V/ F# |! F    end
7 u! i0 d1 r7 ^- J$ uend& y$ ~% f1 C4 H# s# u9 n1 g$ {

) B3 v9 e8 [: m8 x, [begin P_pick2 arriving- e) W3 |+ E5 H' F$ \; |8 i
    set A_i to 11
4 k3 j" a) p0 i) l    move into Q_induct2  p, P+ f) y0 j2 D; t  A
    move into pickaisle.induct2
9 t' ~5 A" b. w; Z    while A_i<=30 do begin
* F1 P5 t1 u; }0 F" Q        travel to pickaisle.con(A_i)8 F8 `( R/ X. V" \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) W! G5 A8 C# P        else wait for 10 sec8 v9 R6 W! L3 m8 J$ X
        if A_i=A_leave then send to die$ e5 h: t; v$ ?" H3 B3 m$ T' I
        else inc A_i by 16 d4 M3 {# n( l
    end) Q% \8 ~* ]4 u  k! R( S) L
end
+ l: r- _7 x. s+ F7 E. I0 k  w% h5 k5 ?5 X2 w7 Z% s
begin P_pick3 arriving
3 ?4 A3 U" U; s& Q    set A_i to 21
- z- u. L( [* q    move into Q_induct3
6 E& I) P4 s. R" e5 d6 v8 l    move into pickaisle.induct3. Y9 ^5 E& s" t% q& @7 \; A
    while A_i<=30 do begin
' ]2 F! e7 j5 z: q        travel to pickaisle.con(A_i)3 Y/ E3 A# l" l1 Y2 K( m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ^7 G9 Q$ n- C1 C        else wait for 10 sec
/ y: e. ^4 q: u8 W0 V# ~        if A_i=A_leave then send to die# k- `& @7 |  C, y" x4 X
        else inc A_i by 1* I( M0 r. c7 ~# d1 d  p
    end& W  B7 a# b# m4 N0 [  x( W
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是个什么东东?, B4 D2 }+ b# M0 f: Q% U5 l
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. z( P( O0 Q2 L( m0 l

) k# n5 o; O8 x/ pAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; ~. u# Z, f2 V8 X& ]7 r4 q. m
. B5 H$ k: d# w, ^0 s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 @$ A% ?8 E: Q9 o# X$ D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: R' @4 a6 g$ Z3 z, J
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) i) H1 Z& B) M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. Y& T; k! _' z" N" x
begin P_induction arriving
% E: t4 b" I6 b; ~/ c    clone 1 load to P_pick(A_induct)
  ^5 U  S9 o4 c9 g, z* c5 i) Yend最大的系
+ [- M' x" {6 h9 W! C; n( T! a, q' G
, k2 r- Y' j% i8 T( K' xbegin P_pick arriving2 Y) d# f4 q% u
    set A_i to procindex * 10 + 1
8 S9 Y8 {) L, L- A  J4 I    move into Q_induct(procindex)
* x" j7 n; a# R0 n- g2 T8 N    move into pickaisle.induct(procindex)
7 u) s! z! \, G, |    /*check the type of pickaisle.induct(i), for your last problem.*/
5 ^8 \1 j6 e3 F& J. \2 a( s# }" p* g- Q* h* m
    while A_i<=30 do begin
8 G* f, N( n) y5 a0 f        travel to pickaisle.con(A_i)
! f; ^) v5 ~8 ^  i1 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 S& i( V6 K2 x        else wait for 10 sec
4 |# k9 b  E5 s        if A_i=A_leave then send to die
& D' J; B* K6 W( t. F        else inc A_i by 1$ y' {0 }7 u# D: \+ o4 g
    end
' |: D8 d! J; `/ D% b. J' O$ Nend
1 J* ]- p. x! r
! @# w+ Q. ?6 k  a4 q+ t( ~* O其中的procindex为整形,代表当前process的序号。
4 ~! E# C  m- [& C$ Kstation和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-4-16 05:29 , Processed in 0.016980 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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