设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15399|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' v$ d8 m; f8 T0 J/ m: I1 L( }. C0 c- ~, P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, C3 f; X5 N+ i  L3 _
5 [: x  O: `6 ]! mbegin P_read arriving, r0 J# z) A6 Q  k& _: j5 R3 o
    while 1=1 do begin
8 K7 ^/ f! `7 Y7 C  K2 w( C% ]        read A_tote from "data.txt" with delimiter "\n"
" S& [& n6 ^7 f! U  m  W        read A_time from "data.txt" with delimiter "\n"4 o( i- b) N- Z6 w) p/ A
        read A_leave from "data.txt" with delimiter "\n"9 }' l' F; U# p
        read A_picks from "data.txt" with delimiter "\n"7 U. w2 u  |4 i* p! D1 p4 L
        set load type to A_tote1 L/ q" b. O1 l/ |
        if A_tote="tote 1" then set A_induct to 1
. o% T# P: w% `( g3 k* U        else if A_tote="tote 2" then set A_induct to 2" ~+ I: w1 l, p: A% i+ n0 W
            else set A_induct to 3    3 s3 x( a. n$ X5 S1 a# }) o1 g  N
        set A_i to 0
4 G& @! K4 U7 ~+ u$ S        clone 1 load to P_induction
5 b5 H1 t0 {/ n6 z. g+ k2 n3 `% `        wait for A_time sec. c3 e8 O+ T; e$ ~% y: K0 D
    end
' c, P4 R& W, f: ^$ V2 Y- Xend
$ u! p' R" b) `% P, R
% e3 x; R; z& qbegin P_induction arriving0 T. B  m5 J! A7 L5 B4 }7 r! r
    if A_induct=1 then clone 1 load to P_pick1
* D2 G" J! F/ K% ^  R6 Z( u; ]    else if A_induct=2 then clone 1 load to P_pick29 w3 p/ N( z  F7 f
        else clone 1 load to P_pick3
  u7 s. B7 n  W& X2 Bend+ w' k* }) `# e$ s

3 O! m7 s, `  I7 w, h+ hbegin P_pick1 arriving3 r  k( _8 b0 x6 C0 @, F
    set A_i to 1( m: S% F- Y/ o' j9 ^
    move into Q_induct1
1 n! s+ R1 V1 e" b! B6 V5 G* O    move into pickaisle.induct16 {  |; k6 M8 V( g$ R
    while A_i<=30 do begin
6 x- D1 D, W+ X        travel to pickaisle.con(A_i)* Z7 e+ f% X- I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* N- ^5 }8 v! \& {5 i3 _+ h0 Y: A        else wait for 10 sec
8 D- M: P3 q) g        if A_i=A_leave then send to die+ N, P) O, i4 n7 ]
        else inc A_i by 1
/ X! A- ~7 e6 F8 M( Y) D7 o2 r: j# I6 @2 b    end# {" ]( V5 ~- y3 Y! D! ?# B
end
' P) H8 o/ r  \, W, }2 q
3 a. ]& K3 E" @; dbegin P_pick2 arriving
9 c5 n; C6 h) D( y    set A_i to 11
3 J1 n3 `5 W# l( h* B5 s    move into Q_induct2
( f6 |* L9 R/ e. m: u    move into pickaisle.induct2
: a; Q6 m5 c; u* x    while A_i<=30 do begin
2 ^; g! K+ V7 H1 e! `" I        travel to pickaisle.con(A_i)
' P! ^: ?* }4 R5 B0 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 O- T& S9 ^6 T8 U        else wait for 10 sec
& j/ T# w# ?, u4 G3 Y7 y! q, L; d# L        if A_i=A_leave then send to die; }; l. h, q/ }5 Y" N5 k# q
        else inc A_i by 1
6 g+ E, j* ^6 J6 {  T    end
3 p& O) C+ O  [end7 E1 z$ y+ k# \6 r6 U9 @, b5 ^

. ^# S2 ?/ k+ s# \8 E" H: w  Xbegin P_pick3 arriving
7 F0 J0 b( X( H: B1 h% `9 A    set A_i to 21- F' r$ t- r6 Z+ I/ t' d
    move into Q_induct3
& R6 x. X( K" L    move into pickaisle.induct3
  j5 u2 [+ ^, I  i" U7 y% Q* H    while A_i<=30 do begin
' p% L. i( _  [0 N        travel to pickaisle.con(A_i)
8 Q2 B* @0 d  n9 R( @6 H8 a/ _& ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 V- {% o, m0 D' Z% N4 s( d* r
        else wait for 10 sec" h% H. Z) @* o: \9 X/ s* y6 u1 B
        if A_i=A_leave then send to die8 ]- O, ?5 M2 f: }9 f- E  @0 o
        else inc A_i by 1% L% {$ {4 W8 w* q* ?6 B3 B6 {
    end) i. r) M8 x; Z4 K) 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是个什么东东?6 _% c  t+ l8 G  d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& p3 j; ]4 t& _$ f7 ]3 Q8 T+ Z
) @) h! \6 I9 H1 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 n/ a) X( n4 h
/ Y* e! o' d7 ?, x! Z: N% K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" N/ |$ ?4 P$ [, t. [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& @6 a  \6 |2 h! s- j4 ~, L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; e8 y6 v, b/ d* }/ p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ V% W5 f' G/ nbegin P_induction arriving
1 D" C4 R& [  v1 P! R    clone 1 load to P_pick(A_induct)4 p, \: |( y( U# m" ^
end最大的系# w( {( V; L9 f9 r8 |

# Y; @; }6 p' R$ u4 e# g6 C5 [begin P_pick arriving# T( e+ I4 ~6 [8 e3 j+ S
    set A_i to procindex * 10 + 1
7 l: [4 j. b6 x# V7 W    move into Q_induct(procindex)
0 j9 o2 }. I  L$ `1 E    move into pickaisle.induct(procindex)
6 e& m/ X) |7 [7 Y7 k, x    /*check the type of pickaisle.induct(i), for your last problem.*/. l. P$ O: g* `' [9 e1 O

9 i2 g; L% b# S2 r7 Q2 `' A, Q    while A_i<=30 do begin
( t4 M; `8 N$ m* |( s3 m        travel to pickaisle.con(A_i)
: B3 L$ s9 A2 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, n9 S$ ~' M; f: U1 L9 f        else wait for 10 sec
  u6 t1 S* }- U        if A_i=A_leave then send to die) ~# Z' f9 Y2 N
        else inc A_i by 1( d; i) \5 ^2 x' h
    end  K6 A$ R! [+ \; p# G4 ]) R
end$ g5 f, G- T  ?( L5 p7 N

' ]* j! A1 `( |7 d, v, {其中的procindex为整形,代表当前process的序号。
" s' C$ l* H0 w% r  B8 v( Estation和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-8 23:24 , Processed in 0.019953 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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