设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14176|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 k& x! L2 ^; j. B8 Y

# R# v2 j: ~( H2 X, d0 k- I& U2 Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 d* t: _+ A0 Y; Y& D& `

8 ~  Y1 _  Y% C) e$ S/ A$ Cbegin P_read arriving" d/ P8 v% r/ Q0 I
    while 1=1 do begin
- \# b; a( C0 Q# C; b        read A_tote from "data.txt" with delimiter "\n"
# O4 x$ c& d0 H# T' o5 }        read A_time from "data.txt" with delimiter "\n"
3 \/ h0 i) P: ~. i: A! X        read A_leave from "data.txt" with delimiter "\n": ^  G+ ^6 K/ M& u9 G
        read A_picks from "data.txt" with delimiter "\n"% s3 ?) ?* k7 e$ `. q6 A+ }
        set load type to A_tote
# B, V7 G& |0 t: ?& S/ u        if A_tote="tote 1" then set A_induct to 1
6 b: g) `: [# u        else if A_tote="tote 2" then set A_induct to 28 P% M4 y) H+ C, d$ G+ X, @
            else set A_induct to 3    . B( c1 T' a7 P! s5 L
        set A_i to 01 `2 b% W6 @1 k
        clone 1 load to P_induction
- x# |* X8 F8 A3 x7 |        wait for A_time sec
& N9 w! S3 \. l  z4 t  r    end
7 }& [' I( H  S* N) Xend
4 l% e5 @$ O4 ^) J1 \
0 ]3 V3 C1 g# E6 Tbegin P_induction arriving$ Z( {/ p: q5 ?* D/ d0 K* ^& Q1 i
    if A_induct=1 then clone 1 load to P_pick1
" ]2 ~9 A+ ^- C) `( M    else if A_induct=2 then clone 1 load to P_pick23 a; l4 H) ^" q: K6 }" [% P
        else clone 1 load to P_pick3
2 _5 Z1 t& U/ M* D5 z: T* ?: yend$ Z+ m# d3 s/ w( K  F

& Z# b2 n+ K1 e1 h9 V' J2 H) K6 xbegin P_pick1 arriving
& t7 }2 y% ?. i0 {" P+ o& B    set A_i to 1
: P/ f4 `# E' [& k" S& `    move into Q_induct1# c( I/ E3 U, i% R
    move into pickaisle.induct1& n( G- C! U/ G9 |
    while A_i<=30 do begin: h1 \$ B4 c/ \! P7 r' W1 _
        travel to pickaisle.con(A_i)5 ]1 R& l" Q' M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X! [9 ~3 K4 V# d        else wait for 10 sec# i1 s& C, f$ T5 o) \
        if A_i=A_leave then send to die
0 J1 k( X. X! _- n( L        else inc A_i by 1
2 y  j0 g* K% B    end
. i+ p+ A1 C( L. _" fend6 ^) V: A2 Y$ [* f
3 @- c8 c8 S& h3 H% I  O+ i
begin P_pick2 arriving# d& C' K& U( L) o
    set A_i to 114 w! ^, q& m4 v& [" P
    move into Q_induct2" v. k# e% i* {- {
    move into pickaisle.induct2
& K+ h# D4 i. J) p' t; G% d) m) T    while A_i<=30 do begin
+ k- C# o  _, _- ~5 Q/ Z3 q# A        travel to pickaisle.con(A_i)9 @' O( }& A, m' @/ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 i  q) k6 W  J4 Z; A" U        else wait for 10 sec
' V: [8 g# }* [& F8 k" g4 s$ h        if A_i=A_leave then send to die
" P! v) H; r: v7 ~. X1 Y        else inc A_i by 1% V# P* M5 ^1 R$ Q- P
    end- G9 `* R# b( L5 j
end3 \6 O4 c7 N/ l* b. I8 s

$ O/ c2 `* n, O( |" E; d) c3 @begin P_pick3 arriving6 s8 _: X/ \3 H8 h
    set A_i to 21
4 |! X- u0 V" M3 Q$ ~; W    move into Q_induct3  v; N- J: i  A1 L
    move into pickaisle.induct30 p1 h" r: I! J) l
    while A_i<=30 do begin3 U- B% [1 X' F" W
        travel to pickaisle.con(A_i)
4 z6 H  H! x) W1 x( `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- z# f/ y" T/ ]  X
        else wait for 10 sec' X% L; Z* m+ I9 b
        if A_i=A_leave then send to die
% [3 w! s5 x, g5 b. R& w0 }        else inc A_i by 1% w# V! x' q- ]# j& P5 F
    end/ ?! l* e3 A0 c7 D! t1 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是个什么东东?, ?% h  G4 r, _" g0 K) |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# Q4 L) w& s7 n' [) ?, e

  T; P1 l/ d; e  m& ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 B9 n6 k7 k5 C, P$ N3 z" j+ ?) [
8 z' z$ s* c1 F, Q) T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ T* f8 H9 ]" v7 w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. H" O/ I0 A7 m
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 z- F2 @7 c  x% D* w$ H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ P5 [0 \; W  Q& jbegin P_induction arriving. t9 W7 L+ b6 ^, p0 b1 `; R  d, u
    clone 1 load to P_pick(A_induct)
$ N# i8 T# R( d" Q- ]end最大的系
+ H1 @6 Z% s7 ^, `$ k7 g. Z7 }' ~6 q5 \
begin P_pick arriving: V# @* U1 P6 C
    set A_i to procindex * 10 + 17 f2 l: O) B  `- f
    move into Q_induct(procindex)
6 I, P1 P0 j' V- P! T9 z6 O    move into pickaisle.induct(procindex)
0 M, k" Y& O3 v6 y8 C  A! ^6 V    /*check the type of pickaisle.induct(i), for your last problem.*/
8 E( n6 w. m3 {1 A' t# V1 K* K
, p. ?7 S) w6 S" G    while A_i<=30 do begin& L& z, A6 h1 p! l3 I; S
        travel to pickaisle.con(A_i)
# W( i- X" U  A% ?' n! T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 W$ Z* i/ m) J% r" M& h
        else wait for 10 sec2 e  H# |. O5 z5 c# l. J3 z  b6 u  K
        if A_i=A_leave then send to die
) C5 x4 w& T" S& Y        else inc A_i by 1
' y+ O9 w6 U1 {    end
  [6 M( r0 Q6 F& w  j  \; hend
2 R9 `7 s+ z8 I5 o& i
: Y. ~$ `* n) J* a; Z其中的procindex为整形,代表当前process的序号。. A3 r. U5 _# J2 y6 }+ V
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-17 16:02 , Processed in 0.014465 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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