设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15111|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* @- ~) M& p- U, Y5 B( K8 n' U6 q& N9 p/ j& D% w; X7 k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ ~; T) o; d. `( x# C" \& d

! o- f5 J; r, s% |begin P_read arriving0 ~0 J' t9 c" V' X+ I
    while 1=1 do begin( w$ x: s+ T- n! i7 o( _
        read A_tote from "data.txt" with delimiter "\n"# u9 }7 E) S2 D. K) N! d, H
        read A_time from "data.txt" with delimiter "\n"  M( E" E2 v( ^! y, z7 k* t2 B
        read A_leave from "data.txt" with delimiter "\n"' Q* o% ~. `7 m: C5 p: Y6 U
        read A_picks from "data.txt" with delimiter "\n"
4 x* o" |( A/ _+ O" W        set load type to A_tote
! e, u* N! c1 n! {  G( u7 m        if A_tote="tote 1" then set A_induct to 1
; J! z) `9 V, I, ^+ s* Q        else if A_tote="tote 2" then set A_induct to 2
- t+ P' S8 `% W; K' i2 k" f% |, y            else set A_induct to 3   
  k9 A! ~8 Q. u1 U+ ]        set A_i to 0
0 E% W# r2 `" D        clone 1 load to P_induction1 C* ?& j# j9 W* ^
        wait for A_time sec
. P, F- C' N# m- B* I    end- g  `# h: `7 o0 {2 h
end/ g; i6 o+ Q, x) c

- [5 J2 Y7 F" Z6 H8 K$ dbegin P_induction arriving
7 F, B/ [6 n  H* w! h' d    if A_induct=1 then clone 1 load to P_pick1
! \7 r( O" H7 u! M" B    else if A_induct=2 then clone 1 load to P_pick22 p4 |: X$ y- V
        else clone 1 load to P_pick3
( x/ T3 ?$ L" }; Y7 {end- S' u; p5 @; I1 N" D2 R* ?) O8 ~0 `

) d* B, |8 s2 m3 s. j% Hbegin P_pick1 arriving$ S9 W5 y+ B* _6 V
    set A_i to 15 s* _, u3 J1 b0 Z+ x, ]6 L
    move into Q_induct1
+ M, M: \/ W. p9 J! [  k4 u    move into pickaisle.induct1* v, ~# c3 s# b0 Z! ?: h
    while A_i<=30 do begin. I/ A% k+ B1 @* s' i
        travel to pickaisle.con(A_i)
6 g3 L. `+ g; t8 N2 `5 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  a' }/ l+ |" s( T5 l4 ^' R4 j  D
        else wait for 10 sec
9 Z; o8 ]  |$ Y2 q. U2 J        if A_i=A_leave then send to die" z- }' {) g8 `! x! k3 v# a) H
        else inc A_i by 1' ?6 i% U9 E2 i5 ^) n
    end
1 s& B) p% ~4 m& f$ e) _6 wend
: i! Z- A. m$ }; P5 |* u/ T1 d$ Q9 i; x$ B* p9 l5 |* e- Q$ T
begin P_pick2 arriving8 J# _& e# H  q
    set A_i to 113 u3 @# }' X  z% l
    move into Q_induct2* X. |) e. l- ]5 q8 }2 ~& U4 x
    move into pickaisle.induct2
- U1 B8 B1 d8 g- G0 g; Z" @0 H9 d    while A_i<=30 do begin
$ H6 k7 k' P. ~) W  \        travel to pickaisle.con(A_i)
! g4 F7 K0 z5 J+ X* V2 i# `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! E7 t+ v; K4 _+ l* X/ N
        else wait for 10 sec! R+ V5 Y( z4 ~: k+ ]4 U5 C, R3 J
        if A_i=A_leave then send to die- c& o* o7 O3 C9 v8 Z% f, A
        else inc A_i by 1
, T+ ~4 t: O% A! x4 Q& y6 e    end7 R9 Q  V, j, J! \+ Z
end
/ x+ }; t; O- R4 t$ i# x+ S
8 R0 z; j7 i  kbegin P_pick3 arriving
- l2 A% k* {5 O# t% p$ H; O    set A_i to 21! B. {; q- j$ {9 d9 y
    move into Q_induct3  J: K- r% V* f: A1 I
    move into pickaisle.induct3
& H9 D9 J1 Y% r) A    while A_i<=30 do begin" s# Z3 k6 u! R/ e+ m5 ^1 \1 ~% F
        travel to pickaisle.con(A_i)
" H6 M3 g8 z. r. A6 g0 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& x4 p: U3 x% T, S* W) H
        else wait for 10 sec8 n# x7 d& o, p! t  Z3 _  A
        if A_i=A_leave then send to die. k7 }! S/ t2 i7 {2 P! f9 L
        else inc A_i by 1
9 e& {9 C+ y* d; a$ l4 {/ e) l    end0 R/ T+ m, l7 e$ ]$ V* u5 o
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是个什么东东?& o9 ?/ x) J; v* @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 P( C6 Z8 T9 H  a, Y2 w& J9 J0 C( J+ S1 I# C9 b
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 P1 X, d3 p( y0 m3 N: ^7 K6 J  m8 b5 G8 H- i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" m3 L+ x' M% a: K/ u' o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 \8 t/ `1 b; W0 \5 u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 Q3 j/ w8 t. p( F3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. E. m' h- ^  Q9 }0 o
begin P_induction arriving9 K2 q; R6 n- j+ x7 s# h
    clone 1 load to P_pick(A_induct)4 j! ~; f- O% |- g+ S# b
end最大的系$ K! M6 n0 E9 G. _- v
! S  M; W( Q& r1 [. k; h# j
begin P_pick arriving# F' f/ J  i' ?9 S0 Y" p9 M
    set A_i to procindex * 10 + 1
. z  d$ w2 Q: V1 L    move into Q_induct(procindex)" v. a) G' n# U8 r( R$ c
    move into pickaisle.induct(procindex)
/ w# O, h/ L, b2 ?    /*check the type of pickaisle.induct(i), for your last problem.*/
- Q9 ]2 m# }' ?! n& X& G# q9 {. N
- V/ v4 h; e5 V- W1 J    while A_i<=30 do begin5 n! `, h0 G( a4 S$ q9 c! Q
        travel to pickaisle.con(A_i)
" V8 O5 l+ a$ r, y/ `9 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# E3 K; N1 [: t- ]: P, z
        else wait for 10 sec- M. E7 |5 K8 |* n
        if A_i=A_leave then send to die
: G+ J, I# j5 D        else inc A_i by 16 r2 K# ~( x3 ^
    end5 o5 y; A% R  `$ E6 c, L  |
end& V2 E9 c. p6 s) C

2 L. j7 M/ y+ i7 d- I+ l* F( j" b其中的procindex为整形,代表当前process的序号。
+ [' R+ f$ K' h4 L* Qstation和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-11 12:44 , Processed in 0.019019 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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