设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14200|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 K5 Q9 r5 ^2 b+ i; |

# w8 l) G% M# K+ U3 L我的问题是,在每个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 E/ w; d- e2 W! a, A" A+ g" K1 e' l
' m7 K/ ~" u. i: z! bbegin P_read arriving  m! s9 u( O9 Q. {
    while 1=1 do begin
" g- P! \* Y+ `# V, D        read A_tote from "data.txt" with delimiter "\n"
. c, T$ P( q& o        read A_time from "data.txt" with delimiter "\n"9 g# {* @. z+ q3 J+ x  k7 R
        read A_leave from "data.txt" with delimiter "\n"2 S2 x7 r# G+ ~8 O* O; a( z9 @
        read A_picks from "data.txt" with delimiter "\n". _4 ?$ W6 T. k
        set load type to A_tote
+ R) V& p; b( {- ^$ E  D0 f        if A_tote="tote 1" then set A_induct to 1; J3 A2 R* b+ U4 ^1 N3 t8 _
        else if A_tote="tote 2" then set A_induct to 2
3 t, D" ]- g( o. f6 V0 E7 A2 V" Z            else set A_induct to 3    0 S, C8 a6 n$ y' A! [$ m) k
        set A_i to 0, F1 {  k3 J! g' B( i
        clone 1 load to P_induction$ W' t  H4 G* l" ?' \# _$ h
        wait for A_time sec
" F/ t/ s9 j& S; p: b; W& n    end
; P5 O) s; V, w9 {9 d3 @3 b7 s  |8 ^end
4 x9 V3 j+ n+ r8 T4 M& W
7 a1 w' v* [2 ibegin P_induction arriving
# w" p& J* s/ v8 r# Z    if A_induct=1 then clone 1 load to P_pick1
: G/ m7 R, M. ~6 M# Q9 f( {8 X    else if A_induct=2 then clone 1 load to P_pick2! w, i0 m+ [! b
        else clone 1 load to P_pick3
8 k& y/ [7 Y; h5 Z6 B: T. |( mend
7 B( e' [) e+ j2 K
5 y* n7 F9 r$ c& y# J7 o! T& S& Zbegin P_pick1 arriving
6 s5 h- e/ U6 L% H. F% J    set A_i to 1
# Z2 h2 n% l+ c' R& u+ v    move into Q_induct1
* U) v) F$ M7 P& L4 Z$ r4 R    move into pickaisle.induct14 g4 r3 x& P; \, W% Q) {
    while A_i<=30 do begin
2 U3 H! y3 c! z0 \* C- T        travel to pickaisle.con(A_i)
, c0 J; V; [6 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 _9 g2 Z* K+ u2 a8 e        else wait for 10 sec% b- c# f9 e* `
        if A_i=A_leave then send to die! q/ n. n9 K! v* ]5 N! w1 p
        else inc A_i by 1  u3 Z0 f% B% I8 {3 H3 \5 ]$ E% K
    end$ N8 R1 b' D! u* \5 D
end
: w; p- H+ l3 M  [1 x. g8 N! x! ]+ @' f3 R8 J5 `' ~
begin P_pick2 arriving. T/ v. w0 {$ Z# a% S% s7 Q
    set A_i to 11
! B$ x$ W# ^: m6 ]' F8 J    move into Q_induct2
8 g' W& o6 h( O+ R: K7 I# g    move into pickaisle.induct2
  m$ y0 |1 R/ L    while A_i<=30 do begin1 r% x. M4 C% s, n4 z* Y$ H
        travel to pickaisle.con(A_i)
2 q* F. P/ O( x( e& M- b0 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, k/ }" @" g& Z1 C" G1 @4 k        else wait for 10 sec
; P" q6 w1 g+ j2 B        if A_i=A_leave then send to die
4 S6 s' N( w9 S( I3 ~# z        else inc A_i by 1
/ A4 l9 O, e& ]' ?    end& o7 C- o/ s3 w9 w- m, B. L
end
2 ?0 u4 l; k" [' P
( N* V0 ?8 I' f+ F8 N5 w( ~! j, Qbegin P_pick3 arriving
( @  p) E9 \) |: v* E    set A_i to 21
6 X3 X3 |( h7 D  |+ w: U    move into Q_induct3
: o0 S/ J& H6 z. T    move into pickaisle.induct32 n4 A0 R( d3 [' D, T( d' w; W
    while A_i<=30 do begin
8 J8 A* J2 j0 I        travel to pickaisle.con(A_i)
% k+ ?$ m* ^: M0 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# [/ {2 ?# H; z: L0 }4 W" h        else wait for 10 sec
) T* p( v  C" y, C  t8 F        if A_i=A_leave then send to die' W$ l! x; J  P' f
        else inc A_i by 1
6 S4 J! e3 P6 u5 G" u    end; i. o) h2 M# H
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是个什么东东?
7 L' l' j# S! \) rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ i8 O% G6 Y* z. r0 ]

  Y+ i% V0 Y1 H# _AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' Y! {: f, P4 j& Z

' _$ l/ h  x; \$ {1 O$ t5 Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' M& _1 c1 \% N% F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 c0 \% }  j. P9 l, X9 D8 T$ g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% |; I# W+ k2 D4 K+ O- O7 O& `* `
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% o7 ]" D( D0 b5 Z1 N& T+ [
begin P_induction arriving& H+ K+ V- _/ a/ C
    clone 1 load to P_pick(A_induct)
  s0 {1 {. q- Y8 send最大的系3 }/ s* Y! R' h

, x: x- F  G: q, p7 L. vbegin P_pick arriving* W4 i* ?: v+ M( f8 k3 L9 v
    set A_i to procindex * 10 + 13 d, l" n( o% i% x4 ?7 d" b
    move into Q_induct(procindex)
5 i. n6 A, z7 v& `: _    move into pickaisle.induct(procindex)
) P! I( a( R" x8 P7 b+ A    /*check the type of pickaisle.induct(i), for your last problem.*/
7 K& s; P+ G+ h) ~1 |7 B  h: j. U) m2 ~. W
    while A_i<=30 do begin# x: z8 V% b6 `. C0 d$ r* g! Z
        travel to pickaisle.con(A_i)
+ }+ i! b8 _) t( N! d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- Q+ u* q/ d% `) H0 j2 ~        else wait for 10 sec
+ [% P0 W( ?) K5 i" z" }8 [4 H        if A_i=A_leave then send to die
+ u+ _" f  Z) F5 t" `8 |6 r        else inc A_i by 1. ~; u2 ~  L* ~
    end
- c* A% m  K# s* z- r( nend
! k- f6 F" m1 J$ L, f% c: d. ^" [( n: M
其中的procindex为整形,代表当前process的序号。& v' `& L$ D( `! o' o2 g
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-19 17:34 , Processed in 0.019977 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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