设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12691|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 a. [1 J) L4 _* I* y. \! Q
. J6 {8 X( h' _" Y5 |, f我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 [6 B8 a4 h' e" s/ V% u
- }0 ?) s' S: {% V8 W
begin P_read arriving$ W6 b/ x7 B7 [9 b) k2 O  s
    while 1=1 do begin- p' L7 U; y; k) S& ]6 W7 l3 k7 }
        read A_tote from "data.txt" with delimiter "\n"
" y  m! u3 S$ S$ o' z4 O, Y8 ~6 a        read A_time from "data.txt" with delimiter "\n"# a& Q( _7 ~) G
        read A_leave from "data.txt" with delimiter "\n": o' U7 ~) i6 _; O: x
        read A_picks from "data.txt" with delimiter "\n"
+ `( V; j; t; k" D& D& |        set load type to A_tote) U# r- c9 B; g8 Z! {
        if A_tote="tote 1" then set A_induct to 1$ T) j" H6 x6 S. j7 L7 G6 }! u
        else if A_tote="tote 2" then set A_induct to 29 E7 m) \0 q, D( {; H/ E
            else set A_induct to 3    ! w, o1 J2 I- @; _
        set A_i to 0+ x$ `  d) w: o
        clone 1 load to P_induction+ d0 H1 Z" x6 M* W$ J
        wait for A_time sec
, x5 c$ V9 x8 v$ |+ j! g    end
* V" J" z& i7 T9 Q2 Yend
7 Y  ]/ M/ _1 I) J  U6 C; H; q. n( S1 ~
begin P_induction arriving
5 k; F/ p8 ^& ]3 `    if A_induct=1 then clone 1 load to P_pick1
5 @4 \( u* J0 y    else if A_induct=2 then clone 1 load to P_pick2
" F2 k- T% }; I        else clone 1 load to P_pick3
  b5 w1 H6 x: y  C" X( K7 cend
5 Q/ h/ g# H+ l
# ?" E% F6 C+ V( L+ i1 p1 tbegin P_pick1 arriving
; x3 {: j& L  b) I6 K0 E    set A_i to 1
1 _6 u  T! l& a0 ~( P, S    move into Q_induct1
& L' s: j( z6 l    move into pickaisle.induct15 @: ]9 k- ~# j0 T# p( E
    while A_i<=30 do begin
3 [( z9 M% P' O' h        travel to pickaisle.con(A_i)
' @, }! _2 I: c  |1 U2 u# L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S) `0 U. M% n+ ]5 |3 P
        else wait for 10 sec
) ^! T) L: L8 O! J" T        if A_i=A_leave then send to die
# y1 u& t# J4 q# V        else inc A_i by 1
9 s" i5 H, Z+ s; d# Z! q  G    end4 _3 b- G/ I" p  W1 j% ~. L: i
end; e9 Q$ S  [8 |, e/ b+ n$ E/ W

0 Z9 V( X7 ~- V, E& Rbegin P_pick2 arriving
0 D/ a7 k2 O7 s    set A_i to 11
# c: ?6 n) Z: i6 U0 a    move into Q_induct2
2 C* ]1 U4 `2 q1 p5 f: @    move into pickaisle.induct2
* v  d% w1 Q4 i& d    while A_i<=30 do begin, W. O8 O( V( D9 Q4 l
        travel to pickaisle.con(A_i)
5 r' n" U' @$ {1 g& m( r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 a4 c7 @* H+ D8 r- I+ h8 _  |
        else wait for 10 sec" H5 E/ `' h; n7 V# x
        if A_i=A_leave then send to die8 o+ ~* t- ?; J, I5 A6 J/ H) D
        else inc A_i by 1  D: O1 Y3 a4 B: f" {. y
    end
2 J: s0 V: N  z$ R- l2 hend
6 k) |- J* X- B- e0 p1 s8 e: d/ B2 Q
# `" _! u  e) B7 L! qbegin P_pick3 arriving# _8 M; O  M& Q
    set A_i to 21; O3 l/ l3 U5 X% h
    move into Q_induct3
6 N7 c" G; s2 A% _. ]; y% r    move into pickaisle.induct3. N& X' A& P1 b$ q
    while A_i<=30 do begin" s7 |' ~: y1 n# T
        travel to pickaisle.con(A_i)
2 f1 V% B/ Y5 D% t' [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ^2 `4 M% {/ U# X1 r  [        else wait for 10 sec1 J: c! }* H3 g8 f, j$ L( T
        if A_i=A_leave then send to die+ ~$ S; ^6 X* K) V
        else inc A_i by 1. B5 G9 a) h! R; G
    end- J, C- y- _! Z! M2 ^+ D
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是个什么东东?
" I2 n. L" l$ y$ H1 |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 B) F! S$ r' B5 n0 Y  A' T

# t2 f  I1 f! j( ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& P) n- k' Z8 {% i, u8 H  X4 s/ t6 ~

! v1 r5 a7 B# c, ]/ o- \/ Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 Z! L" R$ {8 W8 y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 L0 j' |! n6 i% G- o2 |) O2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 D+ T# }; L/ S- b0 h6 H2 g0 a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) E( U, t* O2 H( U
begin P_induction arriving
% D  y1 S* {" `    clone 1 load to P_pick(A_induct)
. S* Z9 O* W( D5 {5 Iend最大的系6 L. O% V: ]& a

9 h7 d- N: j2 zbegin P_pick arriving
- D! |" h) O# ~. \( f6 i+ M  r4 p+ @    set A_i to procindex * 10 + 1! r6 H/ S' V8 J4 y2 O" U
    move into Q_induct(procindex)
$ w; b5 b/ U+ V$ A3 e5 y$ A& z4 Q, b    move into pickaisle.induct(procindex)7 e$ q" i- f7 c+ G( d5 {7 p
    /*check the type of pickaisle.induct(i), for your last problem.*/
: M; e8 Z3 b5 v  W' N( h" |( M5 a8 ^) s# [
    while A_i<=30 do begin
" a4 l) |8 M! g2 \, ?( B: j6 X( H8 _        travel to pickaisle.con(A_i), g$ w" z1 w9 {2 ^0 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 I( R6 X# G* Q5 n1 ^( a7 w: C1 m        else wait for 10 sec
, B4 q" l4 l1 w* d4 O, F        if A_i=A_leave then send to die4 u0 G: L: L7 o6 Q; g
        else inc A_i by 1
2 V, v5 j  P, g+ q3 H/ U    end+ l1 L1 M3 O' s+ f/ {2 C0 {) u
end# \, u9 L- X8 l/ |' \

1 z+ l, e3 {8 k4 Z4 `9 }# z( C其中的procindex为整形,代表当前process的序号。
* u* M0 t: B1 r' V  M. o6 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-10 20:24 , Processed in 0.020282 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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