设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12893|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ T( a/ f- s) d: C- Z

0 T+ K9 u2 A! v  E我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 K. v$ R3 S. R+ Y% w2 Y' v' t/ z

4 b) ?; q: j/ F7 y. v) v/ vbegin P_read arriving
7 B, e, }0 R7 d: T+ V* r# S    while 1=1 do begin/ D0 L8 i: g" {+ `. ]. o
        read A_tote from "data.txt" with delimiter "\n"
) ]- D8 T! w$ s( m$ ?6 @" G( w# G        read A_time from "data.txt" with delimiter "\n"
$ p3 p- |5 L, [# X+ W5 m* |) A        read A_leave from "data.txt" with delimiter "\n"
0 V) A4 T. _8 U3 y  s* t        read A_picks from "data.txt" with delimiter "\n"
: x# t9 o/ s1 g  Q9 r9 Y- z% d        set load type to A_tote
1 z+ N& ^- B, Y9 ]$ j! Z+ u3 ~- n        if A_tote="tote 1" then set A_induct to 1! ~: p3 t. J, J
        else if A_tote="tote 2" then set A_induct to 23 G: d& V5 J! j( J. \' J9 C" e
            else set A_induct to 3    8 F; _! a6 T4 y7 r4 |' q
        set A_i to 04 ~$ p9 Z9 ~; W) k
        clone 1 load to P_induction
; @4 o; J: U" E  ]' D' u        wait for A_time sec
3 W; e, Y' W5 P  Q) v  v. Y! P    end
+ g% d5 U5 s9 Z; K4 j+ r. Mend
3 x5 }" y) `- J3 Q0 q) Z
$ r; c$ u- ?! O8 a0 M) E' V  ^begin P_induction arriving
9 E( F7 K) N) l) |. h1 f    if A_induct=1 then clone 1 load to P_pick1
" x+ O# L2 N/ |7 F    else if A_induct=2 then clone 1 load to P_pick2
3 l3 t3 Q& G/ p5 V' v5 J) F        else clone 1 load to P_pick3
6 v: t* O8 `, ?8 y8 fend. [8 v% ]# \, Z, I

# Z8 ~! Y" Q0 e! I8 R+ E) R2 Zbegin P_pick1 arriving
" L* s. G$ }  m3 t    set A_i to 1
9 W& f6 S6 L- i" R2 S    move into Q_induct1/ T. D7 ?/ U! \3 f) C
    move into pickaisle.induct1
. v4 G) |* A" }0 {) T; s    while A_i<=30 do begin9 |- S. b2 j% W
        travel to pickaisle.con(A_i)
* E0 V0 j4 y9 O6 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 x4 v: v& @' S0 \/ a5 W
        else wait for 10 sec* `+ ~& X- Y3 x$ S4 K+ ^
        if A_i=A_leave then send to die
/ N5 ^: T* c( W! v        else inc A_i by 1! }7 R; I0 m* l5 e% P
    end3 Z; J$ z9 P! F6 l, O* e2 d
end
) m9 U2 m% i. ]7 @7 l
- T. K, ^* I" v$ W+ r' X+ nbegin P_pick2 arriving
( d' {; p! O( f. C% X& H' d  @    set A_i to 11
3 O3 ]% ~( E2 I    move into Q_induct2$ p8 E% u! S. G9 T1 t
    move into pickaisle.induct2
/ ?8 k8 w3 B# p, N& _  e& }  z& K    while A_i<=30 do begin
. w; o" Z- W5 f; l+ Z        travel to pickaisle.con(A_i): A# h7 O+ Q3 @% {9 m* `. i7 o2 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ U/ \* @8 H1 y# |, M* o$ S! a, f
        else wait for 10 sec7 U" q1 g0 T8 n0 F
        if A_i=A_leave then send to die1 V% t! R) s( W  x. S/ `8 z
        else inc A_i by 1
. K6 s( M4 e& u: q    end
, f( f) O7 s) zend, U9 J( h5 _; H% @( e
' D, J& U5 w' _* y' H# S
begin P_pick3 arriving5 P' q; k0 F. B% B
    set A_i to 21. Q7 O1 X2 d9 b# B# C
    move into Q_induct3
$ ?* _, k* I" w# y" q    move into pickaisle.induct3& H( }$ Y" \1 M& s: [
    while A_i<=30 do begin# E  n0 c% e0 |  R
        travel to pickaisle.con(A_i)
7 I( d# H! Q& A, c! W) A! i6 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 q- {" V: l) p9 G6 b, |+ C
        else wait for 10 sec
# n; T3 H& d8 q& W8 w3 j3 Y$ P        if A_i=A_leave then send to die
; Q$ \/ c( k$ P5 e2 G0 X+ i& r' u        else inc A_i by 13 F" C* a- R3 @* q6 ?, X7 K
    end
2 ~5 S) z0 e# |- f) b8 p2 Oend

最佳答案

查看完整内容

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是个什么东东?. l0 x5 |; t  {# e4 X9 Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ |3 X0 \3 u! |) `; k
% f% O: `5 d! D, f6 X- }: c
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  A4 H& J0 r, ?; I% k5 m2 i1 O5 s5 O/ t  P. c$ A% r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 V+ q- b$ ?$ Q8 E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ [( r' d# z; \% v8 T* Z  D( C+ y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: e6 @/ ?) h7 `- I/ X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  ?, G: h& q; }* Fbegin P_induction arriving5 H8 `! i- K0 }) b
    clone 1 load to P_pick(A_induct)6 G  s9 Y6 p+ v9 L  f( v* f* L4 J
end最大的系
- U; G: |  p2 k5 q
! S3 Q2 M+ F! o& J5 b$ [begin P_pick arriving
' S- U( l- A4 u: Y  R; D    set A_i to procindex * 10 + 1/ X$ E: a$ k6 e
    move into Q_induct(procindex)* c/ g) z3 N$ \5 I: w
    move into pickaisle.induct(procindex)' u4 q5 n: ^( e1 x& V0 X. }
    /*check the type of pickaisle.induct(i), for your last problem.*/$ B1 h5 H# P0 Z# r( X
9 P4 F4 i3 B' b) c* M, o3 G0 e
    while A_i<=30 do begin) C+ C& `' l( _9 H1 B' o& y
        travel to pickaisle.con(A_i)$ R4 ^! Z' a+ d) h+ I/ I& c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# W/ a, q# W6 E3 \! G+ n' x- b4 i; j        else wait for 10 sec6 d+ I) p/ b$ Q
        if A_i=A_leave then send to die/ k  D! a" M. U. S9 a- N2 Y4 a
        else inc A_i by 1$ r' T* K1 D0 Y: }
    end/ n' e  n+ L9 S# F' S3 l
end
9 c. L9 d) v: x2 M0 `1 {& m
! f! n9 w. O- g3 j其中的procindex为整形,代表当前process的序号。; C  J7 j* [# x- @
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-2-28 17:07 , Processed in 0.017469 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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