设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13494|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% M" k# J4 N- d1 y7 F
4 \2 \2 r1 {5 o4 r" i5 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中的数值,不知道会不会有什么不妥。
  g. t6 b* V; f, M5 g7 u+ J6 k( {- p, e& B3 r5 w4 g: u
begin P_read arriving
- I' \6 b) L0 W' o) V; [    while 1=1 do begin: K1 T" c# U3 R/ b
        read A_tote from "data.txt" with delimiter "\n"
+ [" P. h$ ~9 G# p; `8 s3 N, q        read A_time from "data.txt" with delimiter "\n"
6 e/ X/ G! T  w$ z/ O& K3 t' H        read A_leave from "data.txt" with delimiter "\n"# a/ R/ W. Q" N9 s1 U7 R( z
        read A_picks from "data.txt" with delimiter "\n"
/ v! l8 V( z# V* z$ e( A& a, z        set load type to A_tote. @7 `7 M5 a% h8 Z' W$ T
        if A_tote="tote 1" then set A_induct to 1% |! G. @* S" Y, M( o
        else if A_tote="tote 2" then set A_induct to 2
/ ~5 J, D) A& I* n2 q6 r            else set A_induct to 3    + t; G& R7 c9 o( h# m
        set A_i to 0
* M) j- a, ~8 y& g$ b        clone 1 load to P_induction6 V8 E7 }$ ?- c1 N# Q% U
        wait for A_time sec" c' Z1 a9 ?3 `/ J
    end! O$ p. _4 D% l9 l) C
end5 C( }* e! o4 G3 @4 J
. N, A, s" J8 B% N
begin P_induction arriving
! z) H: k3 J4 B+ R0 ?5 }  i5 Y4 `    if A_induct=1 then clone 1 load to P_pick1
: ~: x8 F  c; e  V! G    else if A_induct=2 then clone 1 load to P_pick25 `# r; e0 i- z+ L" N
        else clone 1 load to P_pick38 l9 e  c2 g7 u2 q4 {
end5 b+ Q( p& \- r& U" c
- D- r% u. d9 F; s5 g. s/ k
begin P_pick1 arriving6 y% Y. ?2 P8 d: p" v
    set A_i to 1
' G* K+ d( N/ B' P, }) S7 \# k* E    move into Q_induct1  P$ O8 W7 e0 _, B3 M. ?4 ^& N
    move into pickaisle.induct1
9 B4 l4 \5 V/ l" N) a8 v, [    while A_i<=30 do begin
8 [" G. m6 D" K' T. ^! _" B! s( Y$ E        travel to pickaisle.con(A_i)" W' U2 Q$ V3 ^3 L, J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; p3 h- g' H9 m9 z; u        else wait for 10 sec/ ~6 a' `# P$ d8 R  J" L
        if A_i=A_leave then send to die1 ?( s$ R% w  g4 A" h, l* j
        else inc A_i by 1/ v. f4 N* {8 Y9 h6 z; f/ ~
    end+ Y5 D" b" R* w1 D( Y
end
8 M9 p4 R' G: y6 R' i, \9 l# @2 o2 ^2 ~" \) t3 T  P
begin P_pick2 arriving7 @6 i8 X5 q2 N! L( D
    set A_i to 11
0 J5 i2 ?8 s! _    move into Q_induct2  j+ T3 k) L* H# N
    move into pickaisle.induct27 B3 X6 I- J# i# N+ ~/ e
    while A_i<=30 do begin
* l4 |( y6 }4 Y6 m( r        travel to pickaisle.con(A_i): n7 c0 c& T. F  t" h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) C) z( J) n' A% G
        else wait for 10 sec2 i6 U0 f7 N4 N3 d, i/ o  b* P; A$ c9 B
        if A_i=A_leave then send to die
8 N+ _( h% q( F7 Q        else inc A_i by 1
& T/ [+ a9 Q- S; u    end
  ?" d3 n+ y# D' G: ]3 bend9 j. u* L4 ^: R: r5 i9 N' j

) x# z2 o% a8 T* Y1 ^! |begin P_pick3 arriving
% q% U+ ?$ [3 A, O    set A_i to 21! V! x; u  i) q! z- f0 A, m
    move into Q_induct3( X2 G5 r& N. e6 t# B
    move into pickaisle.induct3* e$ l; o. ?1 P2 ~4 ]
    while A_i<=30 do begin
1 j. ?0 f& Q) G0 ~8 g8 A3 E        travel to pickaisle.con(A_i)
. e0 X4 l9 x* r9 j- e& ]$ \2 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 E" D& ]% Y8 A3 a0 [        else wait for 10 sec
* j1 j. t/ j4 G7 i! C) \* s* A        if A_i=A_leave then send to die% T1 ]) y* T2 G
        else inc A_i by 1  T. [( U0 \' _+ V' l! A
    end) f- l6 E6 E; E3 j" Y
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是个什么东东?
( `" {( r$ S* l. M: y/ w# Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) i4 }0 Z7 h5 _" @- i& l1 _% V8 H) Y
7 G1 L1 j3 K4 z- [4 H1 T; X: m$ d1 I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! X2 p, N) e7 U9 C; a/ z7 K' H* T$ O) S/ c0 F- E+ e% O. ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, |- r5 V% f, X; [2 r7 m0 P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  y- C' P0 ~8 E: N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 H# c( M" X5 m* N+ V! {" i7 q% B3 \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# s3 J* w% W! h6 ebegin P_induction arriving
1 O" e6 o# q% x0 P8 M# c    clone 1 load to P_pick(A_induct)! D1 i# O5 Y4 C1 H" K
end最大的系
5 G' K  S  j+ g+ [9 t0 x; r3 U2 L/ i3 W5 y% q
begin P_pick arriving1 p+ e# b! g, l' T* t: C
    set A_i to procindex * 10 + 1* F: Y! Y3 Q! w" A. ^4 j
    move into Q_induct(procindex)
  ]$ h5 c5 i2 _' i0 |  H    move into pickaisle.induct(procindex)
0 [/ f. u, a7 f6 h7 b, B    /*check the type of pickaisle.induct(i), for your last problem.*/% H# B- W0 n9 e4 d' G
+ G7 @, L1 T" b% ~* I  V  T
    while A_i<=30 do begin
# c; `/ |! K0 u! y$ S        travel to pickaisle.con(A_i)
! i( {2 E( n# {0 ?8 C# y' N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) K# N$ ^, A. _& g) S
        else wait for 10 sec( D  c4 Y6 B# G& F- i7 M6 z, J0 s2 ~
        if A_i=A_leave then send to die- B8 z5 F" D% g
        else inc A_i by 1% u4 w1 R' ~) Y$ ?
    end
) ~# w. K" r/ t$ Bend" t, \7 F8 L& A5 X& b! a* @

" K) n. ?3 I/ ?. ~8 N5 _其中的procindex为整形,代表当前process的序号。4 w( T2 D) N* ?) S
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-4-17 19:11 , Processed in 0.015033 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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