设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14094|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( F1 M4 C+ s+ t/ r
- L3 I4 ?: x! J8 B6 i& u
我的问题是,在每个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 ^% a! U6 Z1 @% |; e9 ?( L& N/ |
( P. t! z  J1 M3 xbegin P_read arriving
: T1 t9 J& J+ l) e7 c- _( F( M    while 1=1 do begin1 ~1 R+ U& z* D% |1 c# l  U
        read A_tote from "data.txt" with delimiter "\n"! w* ]! U$ S/ H) H- B$ n4 |6 g, f& s
        read A_time from "data.txt" with delimiter "\n"
4 h6 G" K$ Y+ ?+ j+ p* l+ \        read A_leave from "data.txt" with delimiter "\n"
' O# B5 r8 v) P' I& L% R5 [        read A_picks from "data.txt" with delimiter "\n"
% X$ o3 c5 C2 Z! N        set load type to A_tote& i7 R: r5 r; v9 [; A0 d
        if A_tote="tote 1" then set A_induct to 1
  E: c+ v0 e! }, u/ r        else if A_tote="tote 2" then set A_induct to 26 W! }* K6 o- P$ L! p
            else set A_induct to 3    8 V2 }" R7 z- p8 ], x9 e% ]2 g
        set A_i to 0& [/ J9 ?" q6 \  e- `$ N
        clone 1 load to P_induction
2 n3 S) v; m0 ^8 R& @$ l+ b4 E        wait for A_time sec! @$ l- P+ R: S0 m# `, y& A0 @
    end
9 ?, N& ~) e( p7 ?end
' f% {9 o7 r( W5 ~1 u2 R4 W4 {
  Y& u2 N6 a. \$ }begin P_induction arriving
/ O6 F( s3 J* O. \( [    if A_induct=1 then clone 1 load to P_pick1" H9 a/ W) d5 g
    else if A_induct=2 then clone 1 load to P_pick2
/ f) P3 |+ t! z* M' ?7 C2 ^        else clone 1 load to P_pick3
6 m; r$ G1 r! nend
8 m7 Z4 G. m9 S2 j% ^- O
. l7 {9 }3 v  Fbegin P_pick1 arriving' \. H6 f; @8 x! s4 Z( v. E
    set A_i to 1; _& ?& K- E$ Y' i/ D5 k8 u( G
    move into Q_induct1
; e' `( v0 c; M. w6 s' b( Y    move into pickaisle.induct1; F$ i" ]7 g- U/ {/ V, }
    while A_i<=30 do begin
0 J4 Q5 K( d( ]/ ]6 B        travel to pickaisle.con(A_i)
1 S- ~' P7 K+ ~6 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; n2 w) H0 E# T0 C7 p        else wait for 10 sec% L0 n& e& y3 w. l( d- }
        if A_i=A_leave then send to die
9 Q. L# H9 Q, x  ~8 m        else inc A_i by 1  p/ E. X0 y4 V
    end; _1 T: t& {  L0 L
end7 Z2 s  L# U, T- D% F& V: @

0 s! a; M! `+ o. Y6 R  _begin P_pick2 arriving2 V/ D' E) J; a+ h0 O5 u
    set A_i to 11* V! Y: e! g0 p% B! k( i& H  F7 v; r$ Z
    move into Q_induct2
, K* {1 n% G) H. g1 w    move into pickaisle.induct2) r- f$ X9 m4 J6 |& M
    while A_i<=30 do begin
/ [- [! L5 ?* h& ^        travel to pickaisle.con(A_i)
2 c3 _: n* D: u5 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' }3 m. }# U: W% V+ X        else wait for 10 sec
; n  k( b0 t# r+ G+ [        if A_i=A_leave then send to die
; F/ m: l" ?2 B! ], _& T8 v        else inc A_i by 17 N3 ?( e. A# X, R) f8 w) u$ q
    end; E3 ?4 _6 O7 C) q& g+ A& w$ N
end
; P; _+ v# f; I$ ]4 E2 f2 q. Z% I& X! c' k' D& D
begin P_pick3 arriving4 ]. ]2 f9 ~8 S* u) b
    set A_i to 217 c% ~6 G/ J  ^1 `* U
    move into Q_induct3
& d5 Z) Q! D% V1 L! F) V    move into pickaisle.induct3
* o# i2 _) S" ?# R$ u; ^: E/ e    while A_i<=30 do begin
, F+ R  k: I# f1 P        travel to pickaisle.con(A_i)
9 M. Y6 M3 V  \! N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ M% C. @  D' e2 `3 E( C        else wait for 10 sec, g8 h6 \; L' ~+ B" z) K
        if A_i=A_leave then send to die* u% n0 D3 `$ q. C& r
        else inc A_i by 1
! U4 c2 n( ~, i1 X    end; j( H1 a+ d6 ^7 G& q+ {# {
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是个什么东东?4 N9 t# J/ m9 [2 s* C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) r) n( ^& h9 Z! l. S9 ^7 V
' \6 P3 a4 s5 ]5 @- B- LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- i  B) @1 r1 f% C
! o" G8 F- z( ?# x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 k3 s, }7 L& _  Y) ?3 Q. x
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 }! V! \# v$ t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' a, S3 T+ s5 ?' Z9 O) ?! F3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% E) k2 r" ?) L3 f7 a; I! }3 w; ]begin P_induction arriving
4 X% v# a( T) U6 q9 Z# K' M    clone 1 load to P_pick(A_induct)
. G. E0 X6 Y4 R- ]' S3 z( uend最大的系3 g3 C) B1 D2 }& L) J
" `3 G3 k# ?% W; v# s( W
begin P_pick arriving
! C  i, H3 R& [    set A_i to procindex * 10 + 1
& B4 k7 O0 Q! F* n1 n9 i% D% Z    move into Q_induct(procindex); D. a0 _$ Y6 ^+ x
    move into pickaisle.induct(procindex)8 K5 `2 Q; q. B" Z( C
    /*check the type of pickaisle.induct(i), for your last problem.*/% h3 z8 U+ l6 `
' v8 K( B1 C4 f! T' @; c  @1 G
    while A_i<=30 do begin
# u$ Q3 U  W$ U" ~4 x6 ~        travel to pickaisle.con(A_i)
( `1 n" O3 `/ K0 q$ s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  Y1 v% w3 G% e2 p8 N, N1 f6 z        else wait for 10 sec% D" j4 T# R, s. }& _3 H( D
        if A_i=A_leave then send to die+ s: ?% E  I9 c; J; j/ V8 ~7 J
        else inc A_i by 1" V6 J6 X2 p- x
    end# u; Z8 u* ^- b2 t6 P8 m2 e3 W
end
( F) k' Q* l" q' V
2 |* r, s0 G: D6 _; m; D8 f& {4 x其中的procindex为整形,代表当前process的序号。$ _6 T  [- S) D# g+ l0 {
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-6-8 06:42 , Processed in 0.014019 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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