设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15651|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* s% E9 L1 X% G/ j% m9 I( w6 {- U" Q9 N" m5 {4 \" @" D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ Z; n% K5 |9 ~# U4 W9 E% N+ y% F
begin P_read arriving. O6 b8 Q# e: A0 O# e
    while 1=1 do begin
4 u) W4 u2 l. @! E0 [        read A_tote from "data.txt" with delimiter "\n"
$ x* t9 c2 b/ V7 f; [5 O        read A_time from "data.txt" with delimiter "\n"
; r: X$ T+ o$ }6 C: ^5 E        read A_leave from "data.txt" with delimiter "\n"6 `; x/ y( |' i3 ^4 g! D5 t5 P8 N/ Z( `; @( O
        read A_picks from "data.txt" with delimiter "\n"9 P& C" z' w( y$ H) K( w0 G' M
        set load type to A_tote
& Z" `( H* z. S3 A) E# C        if A_tote="tote 1" then set A_induct to 1
+ W, A3 X2 S3 F, i        else if A_tote="tote 2" then set A_induct to 2& k. q* j. K9 y6 c
            else set A_induct to 3    , p7 \) [# v4 q, ], g; l6 @7 @6 L9 P
        set A_i to 01 v) X$ L9 ]% C9 U! m$ R; N
        clone 1 load to P_induction) S3 J0 h! o9 z  W8 a& w
        wait for A_time sec
+ {$ a" O( k8 m1 a    end* [7 j# M/ n) {4 [8 w' y& e
end+ C( z# ~- ^: T9 J

/ i) {6 t; h8 wbegin P_induction arriving. m1 ]/ u$ |. T& ]
    if A_induct=1 then clone 1 load to P_pick1
6 ~0 }0 u' p  N* R" e1 ~1 s    else if A_induct=2 then clone 1 load to P_pick2
8 {. P. h& @; ~8 Q        else clone 1 load to P_pick3
: z- B+ b; N5 j: c9 Uend; j! h% \) v% s( W

6 R1 r: `: d- W7 U6 |; fbegin P_pick1 arriving
3 D. y7 \( P: P1 d. P% }    set A_i to 1+ t" g: q* S, X2 i: ^
    move into Q_induct1
  b( h- J! p" W$ a5 R5 g6 X( A    move into pickaisle.induct14 u- `2 J, i4 T1 g5 ]* h. r
    while A_i<=30 do begin
1 ^+ Z8 D; q/ l        travel to pickaisle.con(A_i)
& J9 Q% b' D( z4 ?  u9 ]) u- O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 r2 y+ B  p1 e% R( l3 w9 b- e+ M
        else wait for 10 sec
8 j: Y5 p7 u7 y# B# Y        if A_i=A_leave then send to die+ K( _, |) y  x% m' q
        else inc A_i by 1% Z9 R' v4 j: h* r9 l
    end
2 @6 p) X9 z: P7 cend5 G" E+ _) s5 C* z8 Z5 [
2 ~' ~* a6 T+ j# U) ~7 A% K7 U
begin P_pick2 arriving) `/ \" [% ?, R% l! J
    set A_i to 112 w6 S: v. m# Q' G0 @3 G
    move into Q_induct2
0 X" }. ^  a; V( ^0 Y' ?    move into pickaisle.induct2
! p) l% F, z6 P! |    while A_i<=30 do begin
! Z' y8 B2 @  l* f9 Z+ ?        travel to pickaisle.con(A_i)
: z; B3 Z0 i0 N* y* F7 @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' |3 I. @3 ?5 L; q! @! [9 Y
        else wait for 10 sec+ _- D9 e) c& h+ Z' S! u3 V
        if A_i=A_leave then send to die
5 @- H" L$ `" V1 j' }  o        else inc A_i by 1
0 M( h- F+ A$ J    end
/ {" n1 C  x3 m# l3 P6 M) Mend
( M! n+ V4 X( [' j3 f# `  F7 E5 m2 }% k1 E
begin P_pick3 arriving8 @5 S$ G0 W2 x6 u
    set A_i to 21
5 F6 U6 E4 I& B    move into Q_induct3+ H2 d/ H% [  G: q0 J
    move into pickaisle.induct3
& w; d. I* L3 X    while A_i<=30 do begin
, J8 @3 a. _1 P        travel to pickaisle.con(A_i)- y! K' k0 k/ A" X! Y0 k5 K, S% H1 s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 W  B" _% X; O4 B. X9 T( E. u        else wait for 10 sec
7 [( D9 h+ l; r& w3 A        if A_i=A_leave then send to die2 b- ^5 E& [- z( c9 Y+ I
        else inc A_i by 17 n, f$ A- d& \1 L  b
    end
/ \$ p5 e7 \! L( X% 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是个什么东东?2 N+ v3 _/ A; b& h6 l' M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! q0 a. N$ R* i; S: F+ n4 @) D  ~7 X8 Y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( x7 {/ U3 i+ {$ ]+ A  Q8 v0 Y

- v* ?$ x5 h2 m+ E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 X3 k/ f/ B: L: s1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& ^, m6 r- a5 e7 R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 x, [6 w$ [5 D7 c& n1 r) W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% [, M4 ~3 b4 w: a* Y- \5 y% m
begin P_induction arriving5 _8 D  P2 p8 f0 ?* d
    clone 1 load to P_pick(A_induct)' p; T' X8 r& E
end最大的系0 n: [6 i  Q2 B' }5 P& l+ K
1 k" d" {! t/ M/ D. j
begin P_pick arriving
7 H6 N9 m; [6 c# L2 A, T$ }* C9 o7 M! e    set A_i to procindex * 10 + 19 |, W8 u! L6 o  j) T! j, \
    move into Q_induct(procindex)
( s. }0 e+ k& _3 ~" |# ]    move into pickaisle.induct(procindex)" a9 o- s- B: n; K3 I( E
    /*check the type of pickaisle.induct(i), for your last problem.*/# o5 w& S5 c1 ]- A! P0 I4 ]
, n- t$ g  p! O4 c7 D" o: m
    while A_i<=30 do begin+ X1 u+ ~8 T, O& P$ |
        travel to pickaisle.con(A_i)0 S4 Y9 [" d6 A0 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" o- P1 C# g% [. I4 X) `. j1 }        else wait for 10 sec
6 v( C* c5 W7 N" L; E        if A_i=A_leave then send to die
' B7 m( _& |9 z  ]        else inc A_i by 1
( m# M3 P+ u5 M" a. y1 o9 @    end
- v' D- w2 @! Lend' Q+ z: E: X* d& O  ?3 X  d2 r8 L

) W+ W0 X1 T! C3 S- `# ~其中的procindex为整形,代表当前process的序号。
% c" j' o; U4 n3 s) T, Dstation和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-9-24 09:06 , Processed in 5.478498 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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