设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15393|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# j: I5 L) f; p2 b) m6 A; U, U: \. `2 ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% ^7 Y- o. x1 g2 P8 @/ V# n+ G: E6 ^0 @3 e/ U
begin P_read arriving  u0 E) E$ Q' `0 t$ R* ]
    while 1=1 do begin
! Y% X$ E9 M* v* ?" t, r  }        read A_tote from "data.txt" with delimiter "\n"
' j9 g, w. F2 l( L- o  v        read A_time from "data.txt" with delimiter "\n"
9 E( K) D) q+ F) X$ v  D/ b        read A_leave from "data.txt" with delimiter "\n"
% c4 N/ `$ D* ~        read A_picks from "data.txt" with delimiter "\n"
! B5 Y) Q. m5 ?6 t$ u        set load type to A_tote7 R& }2 u/ g0 c( y3 O5 A4 m% ~( u
        if A_tote="tote 1" then set A_induct to 1
: a4 ~) d) ~% q5 s2 k        else if A_tote="tote 2" then set A_induct to 2' J$ G* w  B( r
            else set A_induct to 3    ) t# _  m. D* ?; }6 x3 n' L
        set A_i to 0
9 L. q: \9 |# ^9 d; d( I        clone 1 load to P_induction' F* k) Z1 ~3 g7 x
        wait for A_time sec6 d+ d( i$ I2 N2 |" U" G+ d5 L
    end
+ q6 x# Y7 t3 r2 ]end) Q- d+ L' n" m4 A

# a- Y8 S! D" T' qbegin P_induction arriving2 H# i+ a+ T/ M3 C( S
    if A_induct=1 then clone 1 load to P_pick1) @# O  u$ A$ R; B* E7 i; g3 @
    else if A_induct=2 then clone 1 load to P_pick2) p, P5 r3 W) }8 X$ f2 p  ]
        else clone 1 load to P_pick3. C6 F. \' Q3 K9 ?
end
; e7 S/ [. b6 [& F6 K: r2 p& y
begin P_pick1 arriving
  z1 k1 Q* P. W$ {4 Y# [    set A_i to 1
" m8 u* @1 b: C9 j/ w    move into Q_induct1
6 G1 m" i4 `/ }, F6 R# r0 \5 s    move into pickaisle.induct1
5 |& F  P7 i- p    while A_i<=30 do begin  ^1 {6 }, z& X& N9 t* M. q) u
        travel to pickaisle.con(A_i)
4 Y. \' }7 ?. ~$ L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 }3 T2 Y3 d2 E  n
        else wait for 10 sec
# `- O/ H8 R  S; L! X        if A_i=A_leave then send to die2 h, X( F; ~- b4 L4 O. G& }7 F
        else inc A_i by 15 _5 ^' \6 h' m$ p8 k
    end6 v6 k, r0 _- P# n( A
end; c" K) {$ |0 o  p; X& t3 v
* f: v# I  u/ |+ ?2 c% |
begin P_pick2 arriving
9 ?; t1 |# O% p' {0 M; h    set A_i to 11- K( d4 f& c% Y: X
    move into Q_induct2
, C* F2 J4 Y( P6 d2 X8 m: {8 g  b    move into pickaisle.induct2
5 y- e# Q6 n9 t3 @6 e    while A_i<=30 do begin
& f( R5 k/ \% r& _1 L        travel to pickaisle.con(A_i)
$ R5 ?1 {6 i/ _6 \/ t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 J% ]7 @3 y: o( A        else wait for 10 sec" s7 v9 z+ ~: u+ _7 B
        if A_i=A_leave then send to die' f- c3 j# b% r, R
        else inc A_i by 12 d' Z# ~6 M0 ^  @, G6 L
    end
  s0 z; A: c4 iend
' |/ F3 F4 E% V( Q3 R& [- \
4 \  q; `, M7 M/ p) cbegin P_pick3 arriving
! B% o7 w$ i5 d, ^1 O2 P0 t6 @; r6 A    set A_i to 21% T9 x! c& R. d4 k
    move into Q_induct3' Y3 U) k$ v* ~# a& a7 R
    move into pickaisle.induct3
$ @3 m7 f0 u7 B( u" s) c  u    while A_i<=30 do begin
) w6 J; S' U- I7 i        travel to pickaisle.con(A_i)# h: Z" j1 v( ]7 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ d' k9 @* X( u1 e5 H        else wait for 10 sec
) i" Z  r: L2 j8 I5 u        if A_i=A_leave then send to die$ |3 i6 Z: f( ^5 D% x/ V: w* m8 n
        else inc A_i by 17 w' V2 Z! {$ v7 T
    end+ |% B. }+ s5 @5 a* F( b* d3 f9 P
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是个什么东东?
/ K% W: P/ l) e9 O- F) I9 @1 B" Umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: j! W: x+ m/ a9 c
! e3 n4 ~1 R( c* i6 }
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 F5 y$ S8 Q( q9 o. _# B( f3 j

  m; N+ a; c2 Z4 f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' d0 {, o$ a* @: M& t2 t4 N1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* Z. L$ f4 x; P  |, s4 c/ q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! a& r  D6 V  U; i( f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" P" y1 L8 g1 R* a$ d" U3 c
begin P_induction arriving
4 v; V$ V, {- E) S# N- M    clone 1 load to P_pick(A_induct)
9 k# l8 k" ^+ R' E) r9 A" hend最大的系
( r9 X+ d2 m1 q* @# L: K" y. G; B" ~' {' Z( E
begin P_pick arriving
: |( @" P  n, q8 Q& y    set A_i to procindex * 10 + 17 T+ {; S  Z; `& y/ p
    move into Q_induct(procindex)
) C6 t, a! `1 ~) [) y+ [    move into pickaisle.induct(procindex)
8 c. s7 a! b7 u    /*check the type of pickaisle.induct(i), for your last problem.*/" z1 ~$ s4 G" ^& b* `& H

+ g: S9 M/ Q2 l    while A_i<=30 do begin6 n$ @8 z" A5 l3 q1 M6 v. ^
        travel to pickaisle.con(A_i)
/ e8 D1 I6 m: @8 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% n4 D( J# W- _/ }' o. q
        else wait for 10 sec$ a' h5 b( q. c7 l4 l/ ~5 I' {
        if A_i=A_leave then send to die
9 X& \) ?8 Y% ~/ X, y$ X: ?        else inc A_i by 1* j) w" d* }+ A- g
    end
+ g% F2 Q6 X# {4 J3 }  t- v$ Bend
& t7 V6 {: M! s7 C0 ]# X1 c+ a  E$ H! a) n
其中的procindex为整形,代表当前process的序号。
& f1 h* I: g9 {0 B4 A* ostation和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-9-8 13:33 , Processed in 0.017042 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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