设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12855|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ H: ?9 D) u0 U, U  {
( F! d8 W& b2 P2 L1 G# ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 d  W" F  d6 j( T

, a) a; p* `. k3 Y- V, b/ Dbegin P_read arriving
+ N' H' y% e: Q* I3 w$ ~( u' Q    while 1=1 do begin2 p+ z/ E. m6 W. {* d8 a
        read A_tote from "data.txt" with delimiter "\n"
- |9 `5 U3 Q$ Q5 c6 ~        read A_time from "data.txt" with delimiter "\n"
) a0 P5 K8 x" d6 U3 R* G        read A_leave from "data.txt" with delimiter "\n"
0 e- }# z6 q+ f* b. c5 a% v+ ~        read A_picks from "data.txt" with delimiter "\n"- z! K" Z1 w! R0 L* P2 {
        set load type to A_tote0 U2 B% [2 B" \8 ]' U
        if A_tote="tote 1" then set A_induct to 10 P) r' {& _& I( m8 R# p  c
        else if A_tote="tote 2" then set A_induct to 23 {$ n& }8 m+ q/ {) P" x# k
            else set A_induct to 3   
- [8 w6 L. J6 i) z  J; T        set A_i to 0
) Z$ W- R6 |" T3 {1 w        clone 1 load to P_induction
$ K- [6 {# Z7 k- Z. _  w! i5 K! v        wait for A_time sec
! q' S0 `( g+ L* x; ~7 G9 K5 c    end
0 o  c2 w$ P( iend
( x  ]5 D7 w( \2 x7 @; S3 [8 N8 y* u% I8 e0 W' @8 g+ ~: G
begin P_induction arriving
' \1 l9 A( g1 u, o    if A_induct=1 then clone 1 load to P_pick1! v5 a, ]' s: h' c! S1 ?
    else if A_induct=2 then clone 1 load to P_pick2
- D) H+ I$ T) }9 T        else clone 1 load to P_pick3
: ?% b' ~; ?4 G$ E, _0 Oend7 N( R+ o/ E% l/ }. H5 b% b

0 v. D' I4 P' g) @3 u1 F# D! ?begin P_pick1 arriving
4 R" A5 C4 W. E! M8 U9 |& }) }    set A_i to 1
/ c3 X6 F8 t! U; ]. z) L( z    move into Q_induct1
- X' z( Y; N  S. Z3 d7 t. |5 V    move into pickaisle.induct1. U2 K; N; J* H8 M+ a9 ]
    while A_i<=30 do begin9 F* W4 _* v6 J: S! @: i4 w& a
        travel to pickaisle.con(A_i)
) V! p) _  W9 A2 @' z, n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 P8 f' ?9 v) ~+ u        else wait for 10 sec  |! Q- g; A5 R6 o$ u9 t
        if A_i=A_leave then send to die+ |0 F$ E7 O- D; z8 U9 t/ s
        else inc A_i by 1
" M+ s" F- G* L6 _    end8 e3 @- G; c) p0 x
end2 C8 ~7 c% d! h& t( K: |
2 g" V% @) q6 |' j: ]; p
begin P_pick2 arriving
3 Y& U% f4 [& ^' r% b" p3 J; W    set A_i to 11
  M7 \3 C$ [$ d& n3 H    move into Q_induct2
4 S8 n) k: J2 b# {    move into pickaisle.induct2" |" ?% z/ W% z4 r' o
    while A_i<=30 do begin
8 I) X: ^" D# C" B* _        travel to pickaisle.con(A_i)5 \+ @5 o3 G$ `# [- @1 x1 T1 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, Q4 @0 {1 e: e        else wait for 10 sec+ n% x( l3 F7 t" Q' Q
        if A_i=A_leave then send to die: R: Q* s6 H! J- p2 f2 @
        else inc A_i by 1- S% V1 s, a$ Y9 N- w
    end# k) u! G/ V' g5 _' J, @* ?
end) Q, e* Y: a' J) o5 q7 x+ @$ t

" M' S2 T% o' T3 ^5 u2 obegin P_pick3 arriving
) \5 u) I) I  \8 P, i1 I/ d. Q/ G    set A_i to 21
& e% Y4 c0 [# u$ I5 B: t; d5 U, D0 r  {    move into Q_induct3# b/ Y1 J' l0 Z  |* N( W: ^
    move into pickaisle.induct32 g" g* a: w' q* X/ `3 m5 u
    while A_i<=30 do begin; D! S) c) E) D9 K9 i/ K8 O3 f
        travel to pickaisle.con(A_i)5 L, M8 W5 H: O4 @/ ]" a! v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 b. q5 ?+ S$ F" ^        else wait for 10 sec
; G0 \8 b  O+ }' K' }: f        if A_i=A_leave then send to die! i" |5 O& ]- F- X, r" `! d
        else inc A_i by 1! d. X# B" i8 x! _
    end
6 j5 O2 a9 R+ l/ hend

最佳答案

查看完整内容

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是个什么东东?
8 [# K5 i* E# ]+ e' a* b& F4 |2 v* r) Jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( ^+ m/ ?2 S+ o6 E5 k6 ^

/ K# \& W/ Z  R$ ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% ^& P: g: Q1 x# ~9 n
5 P; g" X0 G+ u$ F* m  X' }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ S, ^2 H/ v  @& l; O# X% i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ S# ?8 y9 y9 W/ n& M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 T* ~& ?2 W# ?# v+ }( L8 b, c: P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 d. H+ _! O$ A9 N# Q* T
begin P_induction arriving5 e4 C9 |. H" {5 _5 i5 r4 o4 P
    clone 1 load to P_pick(A_induct)2 c" l! _4 T2 t. l3 B* B
end最大的系
4 y& M; ?, {2 U% s5 v% {0 H/ N$ ?- C
begin P_pick arriving
# ?- \8 @5 c) u; A    set A_i to procindex * 10 + 1/ b$ E2 U- M& O, u% i/ h5 m
    move into Q_induct(procindex)
/ e* l$ |8 x2 A    move into pickaisle.induct(procindex)$ H" D; u: ?5 \* U- Z5 d
    /*check the type of pickaisle.induct(i), for your last problem.*/( z( ]( b% l. H5 Z. z9 z6 T+ w

. I  x5 l8 e0 i/ w    while A_i<=30 do begin& v$ ?( S9 z2 C
        travel to pickaisle.con(A_i)3 v6 m' @6 t) e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' U$ P) V' ?) t7 y$ @
        else wait for 10 sec. ~9 q0 i7 A; }
        if A_i=A_leave then send to die. d9 Z" R8 a% ~0 g" l
        else inc A_i by 1
( P7 t) a  d* X' i( M$ e    end! s* r/ S7 y) B+ w" k2 m  B1 ]5 \
end- Z7 b) g: h, b8 s; R: ^) [

/ F+ _7 M8 o/ }3 }其中的procindex为整形,代表当前process的序号。
! J2 V3 `/ b9 p6 N4 O3 U9 o7 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-2-25 02:53 , Processed in 0.016043 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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