设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14989|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 b" Q  @0 U4 W6 C0 _6 z, @
5 v$ e3 `& i: m6 Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。% P( ]  v, W+ F" B

1 \  q! E6 U! Q& p' ^; r! Q: T* ?begin P_read arriving" Y4 x9 I: _! h7 A3 y3 v5 y
    while 1=1 do begin7 O* }# W7 _: E3 y4 q3 W- N
        read A_tote from "data.txt" with delimiter "\n"6 m: @# B$ d6 d9 N; j  x
        read A_time from "data.txt" with delimiter "\n"
7 r. T2 ?- v  T8 K. H        read A_leave from "data.txt" with delimiter "\n"# g. }* i+ R& B  y
        read A_picks from "data.txt" with delimiter "\n"3 k* {8 L7 C& V/ x. w! t3 b
        set load type to A_tote
: P# G* i9 E7 h7 A" L        if A_tote="tote 1" then set A_induct to 1
  f' D  V$ ]2 [, j        else if A_tote="tote 2" then set A_induct to 2
  T# e5 y5 z) T8 V$ b' J) X8 s            else set A_induct to 3    . C* R" Q9 v4 G- q) Q$ B/ {
        set A_i to 0
! ]5 E$ l1 H* V! W6 @        clone 1 load to P_induction
( t- ^* ^6 v0 v$ I4 |3 l        wait for A_time sec% ?/ V2 I+ K5 {3 A8 l" S
    end# E+ S/ c6 ^6 O. f" Y
end
, M( w/ O2 f; B0 L, _" N( Y
  _7 t& }: p/ a) I% Obegin P_induction arriving
7 r/ r& W9 N) l+ p    if A_induct=1 then clone 1 load to P_pick1' G7 j8 ]5 T# M: @6 A
    else if A_induct=2 then clone 1 load to P_pick2
& {% h( a0 q9 V6 i6 t  O5 a3 |        else clone 1 load to P_pick3
) S" F: B! W! `* P: _end
1 {2 u7 J/ G: f/ w# a' y' g+ V+ |. y% M% S+ c7 z' `. m
begin P_pick1 arriving- ?; c7 ?/ X& b+ S: L* e
    set A_i to 1. t# s9 ?9 J- s# d# r& R7 g& J% ^
    move into Q_induct1
1 j" n: f+ \) z4 l4 ~  H* j  x    move into pickaisle.induct1
$ H( b; K# ~' l" J5 Y    while A_i<=30 do begin
& N" K) H5 G9 x        travel to pickaisle.con(A_i)
. n$ h- }6 L. o$ |* S$ F. `, Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 w" m( ^6 E* x. R        else wait for 10 sec
7 [" U" I) q) n1 T        if A_i=A_leave then send to die( D! F$ [8 H3 g
        else inc A_i by 1$ q6 g$ j# }9 ^4 G
    end
; I1 C3 k2 S  ?1 [end7 p: U: Q6 q: u7 J2 P
/ L# L" w0 H8 y1 N/ y
begin P_pick2 arriving
8 E1 J. A4 F( q  c: O    set A_i to 114 j& m& G7 }7 w! J
    move into Q_induct2- l/ r/ x- N. q/ V" g0 F
    move into pickaisle.induct2& o0 _* Z! u! C* \1 B' Q0 R# w* I
    while A_i<=30 do begin/ U! \9 g9 z; M9 H
        travel to pickaisle.con(A_i)" ^5 @9 E8 C5 ~! p3 e( z& w9 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 R) ~: |. {% G2 t0 g1 c        else wait for 10 sec
0 }- e8 E6 Q# h        if A_i=A_leave then send to die
) ^, S# o  K. V9 Q3 t( M        else inc A_i by 1' Y1 a- L2 W' m5 G+ r$ }
    end. V: t: p$ W/ y: Q3 U
end
$ g- P: c- Q" U6 \; |4 o* @; y$ \( s" y% Q$ h& W1 b
begin P_pick3 arriving
5 B' J: A6 k8 {7 j& j    set A_i to 218 U  {+ z" l* @, p" _" W* G% V
    move into Q_induct3
5 ~2 C" q2 `$ X    move into pickaisle.induct3$ b% h" N6 i, `7 l  g( [
    while A_i<=30 do begin
* l1 f6 E- }, T6 ]: B        travel to pickaisle.con(A_i)  c" ?$ ?. J5 K: }, ]6 i6 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 W3 R, l! N" {1 Q+ h2 P
        else wait for 10 sec: p3 c; S! u6 }+ N
        if A_i=A_leave then send to die
/ o+ M, u% a9 ~4 o  Y8 w+ u        else inc A_i by 1, |9 T: i4 W2 Q% A) @
    end' c7 ^' K( i: K! e# f8 s' i1 f. f
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是个什么东东?# Z( J. J4 M8 w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 R  z- h. u7 R0 }( U4 {$ v9 V, Y- @. ]" ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& s' e! L+ j# @; [/ k& j9 q! v
& k/ @7 ?% X* @6 I# l( q7 L$ D0 d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 D9 U8 ?# K( x' U) y% ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& S% F2 [; Z1 B! X1 u# p
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 [6 f' q% n4 f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( S% u* f: D; J# M& [- d
begin P_induction arriving
  N; ~! [& n3 W: d  ]& ^    clone 1 load to P_pick(A_induct)
1 p7 q* @* U4 G% z( f$ Qend最大的系- v8 p8 f3 f5 N) L4 t0 E" ?
& a) ^2 J4 X+ a; Y
begin P_pick arriving
, d& [* F. A, n! h, t    set A_i to procindex * 10 + 1/ _0 A' u% r6 _% I
    move into Q_induct(procindex)1 [& k* C: A) `$ U) K2 N7 a+ F
    move into pickaisle.induct(procindex)$ r% i: y. h6 t) k( u$ b3 f/ w
    /*check the type of pickaisle.induct(i), for your last problem.*/3 [* c/ K. h2 S/ \4 L
/ S& Q8 f) c, Q) W6 ]; a& q+ y0 C* K$ s
    while A_i<=30 do begin6 s! g& `5 p' v: O; P/ Q, Y
        travel to pickaisle.con(A_i)
! D! H$ I9 {) H5 r+ [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' F. C& _3 W4 j9 b" w. a        else wait for 10 sec
3 k2 k; M1 w" Y5 _        if A_i=A_leave then send to die( Z/ y5 G' \3 o3 J4 v4 K# Q/ d8 }
        else inc A_i by 1! ^3 w6 y, U9 L/ ]# [9 d7 H
    end
8 M9 u3 m# d9 B' nend- e/ H! g# |3 G: `/ F

3 J9 V. F; o+ Q7 @+ l0 s其中的procindex为整形,代表当前process的序号。( _( {+ X- ~6 t; M3 B# e
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-8-2 08:51 , Processed in 0.015112 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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