设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15079|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( u2 U6 f& n4 a2 F
$ ?/ t' _& W3 [* \5 j+ h* a3 ~我的问题是,在每个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 A! M  P! l/ v  R; A7 q$ }$ n$ m9 N" V9 d2 n" I4 y; [% d/ C
begin P_read arriving
" ^8 z9 j. R6 R  i! U# n    while 1=1 do begin5 k+ O9 @& C! y* [
        read A_tote from "data.txt" with delimiter "\n"
' x3 p: h6 z/ h9 d        read A_time from "data.txt" with delimiter "\n"
/ _) H4 w, V( E/ L% x8 y5 A0 Q        read A_leave from "data.txt" with delimiter "\n"
: {" O5 c5 A2 u        read A_picks from "data.txt" with delimiter "\n"8 S5 n( O  X' N6 u
        set load type to A_tote  K2 V- U5 r, n3 A) ]: N) R
        if A_tote="tote 1" then set A_induct to 18 g/ w* W" Q8 m1 r( |! r7 P
        else if A_tote="tote 2" then set A_induct to 2# ~. u& M5 I; b" a; i- R, o5 l
            else set A_induct to 3   
: M, R6 F$ }' R        set A_i to 0
/ W3 Y' d, q6 F, [0 |/ S$ K        clone 1 load to P_induction. ^% D& u+ }+ F" r* F+ G/ P; R4 i
        wait for A_time sec
+ \" [* n) Q2 c- v    end0 [; o; t! m8 A6 B
end
. l4 m  C( B$ k4 J5 J' W/ \0 L! o7 g' {1 b" B
begin P_induction arriving
* h6 u! T, k; Y9 s: x    if A_induct=1 then clone 1 load to P_pick1
1 N/ r8 z/ P: @+ _3 [% C* K    else if A_induct=2 then clone 1 load to P_pick2
& A/ E  H- i" P' |        else clone 1 load to P_pick3
# N9 g7 P+ F0 t: Aend
% U% z2 n! y" j" Y: o
% \5 E' a& `! [/ |( t( xbegin P_pick1 arriving1 j5 ^* W& T7 c
    set A_i to 1
3 ~3 Q$ R( Q, A8 G7 H9 ~( y5 ~. `    move into Q_induct1( S( G9 g- G& i# y; ]4 m% @
    move into pickaisle.induct1
6 V1 }0 {5 @0 ~9 d    while A_i<=30 do begin
& m+ T( {$ [9 w        travel to pickaisle.con(A_i)
2 D" s/ @+ u+ q: `, ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ J6 H6 |* D" m8 r        else wait for 10 sec
- h) e+ x8 z% p& y7 s2 k; J, ?- R  R# k4 g        if A_i=A_leave then send to die2 N! }' j2 D: i9 ?2 a! f0 c6 I
        else inc A_i by 18 o! @' ?9 W5 ^+ T" a2 a
    end: w( O, A# Y' T, T% }7 I: X1 N1 x
end
' Q9 |! i# ?1 }9 U3 X. ?/ k0 R  g3 |9 z0 _) U8 r
begin P_pick2 arriving4 R2 d- f8 Z* y& l
    set A_i to 11* ~  n! [4 {6 l/ d1 f3 Y
    move into Q_induct2+ w: v. J( V1 r2 L
    move into pickaisle.induct2
3 i0 c- y& k# a    while A_i<=30 do begin' R$ L. \+ \+ \9 c  ~* N0 k
        travel to pickaisle.con(A_i)$ h$ Q) _# F" z/ R5 m. Y( g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 K7 ^  l9 Q7 ~7 @6 k
        else wait for 10 sec
2 m  ]# |# C% E% T: E1 u# f        if A_i=A_leave then send to die. r: m3 \  s- R) ~
        else inc A_i by 14 L: U, ]1 b/ i$ S; H- P
    end
, t, |3 K% o6 l# y: }1 h2 W0 Rend' }7 ^6 Z: E( P3 {

" A, m) x4 f& j3 L; l) |begin P_pick3 arriving
% S5 r+ b2 V& J5 F( @) n2 F$ ]7 x    set A_i to 21
3 w: u$ {1 V$ X3 o  V    move into Q_induct3
  Z% m8 ?9 z* O, o' \    move into pickaisle.induct39 o" n5 t4 N8 ?9 {( ~6 O
    while A_i<=30 do begin2 Z/ x5 h; _  x- N& z) L
        travel to pickaisle.con(A_i)2 E. s( s0 ^3 A+ u) c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) w5 _! }! l1 ]5 y3 \* Q8 G
        else wait for 10 sec) f; n* J3 A5 U0 D7 x$ K, f+ K
        if A_i=A_leave then send to die. g9 b( X9 @' T
        else inc A_i by 1
8 p, @+ y1 i2 ^  |$ Q8 ^- S9 M+ L! t    end( J" T( w5 |; x* k$ r6 f
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是个什么东东?
- L( I% v+ S/ p4 `1 v4 smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" ]& Y) h$ e1 t! U1 l$ I4 V$ k3 O
$ O# ?* A9 I' d$ fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ |: w3 e( e' ?  ?( _$ M0 f" O* f  _# B6 M" f' C! W
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 f5 }# }3 X: }% p1 u$ s9 b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* N. u, z. g: \$ `" {3 Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 ]) Y- V# ?. G: y, \. ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) S: b1 M: y' O) Gbegin P_induction arriving
1 c% B9 P# x( q9 K! R$ M    clone 1 load to P_pick(A_induct)
" V) k  {$ H1 B$ p2 R/ o/ F/ r! kend最大的系0 r! l/ O; O' ?: u; ]8 f. e
9 M3 S2 Z0 h6 @( `$ I3 P
begin P_pick arriving
8 Y6 ~7 z5 c% F3 X    set A_i to procindex * 10 + 1
3 n7 ~6 ~5 k1 m; z$ q# r- L    move into Q_induct(procindex), ?9 Q9 j3 X  a4 k
    move into pickaisle.induct(procindex)
& P( A& j" w( I' O8 J2 G4 n+ O    /*check the type of pickaisle.induct(i), for your last problem.*/) T7 c) z1 {! `3 ]. S6 Q! Z
% x6 l9 Z( I2 b) D% c
    while A_i<=30 do begin
3 l) n; [2 |3 H$ t2 H( s* C+ t        travel to pickaisle.con(A_i)
9 r7 N+ s5 m2 A+ i" D4 H: t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' `, q- F8 ?, B2 u2 k$ j        else wait for 10 sec) X. u4 U1 t- {- d- K/ @
        if A_i=A_leave then send to die; \7 Y5 w, o8 d  h" y
        else inc A_i by 1
  u. R+ V7 u. _! l! ]    end
" h4 p- M  ~5 p! O5 jend5 W+ A- n$ C+ I) ^$ D
7 z, V" }" M' j1 b
其中的procindex为整形,代表当前process的序号。
0 d+ l) d0 {' |8 istation和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-8 13:46 , Processed in 0.015688 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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