设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12671|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ N% v- R+ h7 v: `
3 S& y& U+ i* R我的问题是,在每个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中的数值,不知道会不会有什么不妥。' v: |+ |7 u6 [& R) ~2 h" k
+ ^% ]( d0 G( k% P- K
begin P_read arriving
; E2 k, W+ V- L2 b    while 1=1 do begin; S- Y! x0 |3 i3 J# ^4 a- y. Q, j
        read A_tote from "data.txt" with delimiter "\n"
" s) o2 u3 X3 t2 b) g! s        read A_time from "data.txt" with delimiter "\n"+ j8 {/ e0 k& z! {; v
        read A_leave from "data.txt" with delimiter "\n") y% `# Z0 P# j0 S- J, Q# ^: Y
        read A_picks from "data.txt" with delimiter "\n"
; j( c& X+ e9 D! f& T% C        set load type to A_tote
9 C5 [) D: c; `        if A_tote="tote 1" then set A_induct to 1
8 g5 Z% v: M2 @7 o        else if A_tote="tote 2" then set A_induct to 2
/ P$ G3 c& b, @$ |% S6 L2 R% x            else set A_induct to 3    ) Z- M  o! S0 X) V
        set A_i to 0
/ C$ q  f. c2 \        clone 1 load to P_induction- g. Y( J3 _6 U1 b5 r
        wait for A_time sec& @6 Z* {. j1 m) d! _
    end: Q# B2 W7 m. @; G% k
end
0 |/ Q; y0 `7 r; g7 f
4 H# b$ g* Y* ?. C9 @- q% abegin P_induction arriving
; K0 Q  r9 \9 i/ a8 v1 D    if A_induct=1 then clone 1 load to P_pick1
* f9 m# \4 }/ f6 g; D    else if A_induct=2 then clone 1 load to P_pick2) K8 W* v. s/ d
        else clone 1 load to P_pick3# q2 b, o6 u' @6 N# ^4 v5 h
end0 D; @; t5 A# y0 R! P
7 J  K/ W. M) z) }7 t
begin P_pick1 arriving
# e3 L* @/ z+ ~6 E  M! U! e    set A_i to 1
, [, i6 I. _, D" O* [# N    move into Q_induct1
7 N6 ~* S% v8 t# i. ]- }    move into pickaisle.induct1) F8 l" b: ~4 A
    while A_i<=30 do begin
  d) G2 Y# Q. d$ A7 i3 y$ k        travel to pickaisle.con(A_i)
' S( H4 t1 a, @( h) A5 B: H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% }6 W9 p6 K2 t" |6 E4 M& c9 q
        else wait for 10 sec
: p5 P% b7 I$ @1 |. p        if A_i=A_leave then send to die( N# I* f! j8 w% l- a9 ]) }5 ?
        else inc A_i by 1
! i3 c+ L0 Z' k9 C6 q    end
( \: v! ^+ y* R0 Y+ cend$ P  D. T5 U! M8 {3 |

. t1 t; ^1 s: A# G0 k4 \! Ybegin P_pick2 arriving8 ]! f* V5 L% C# j6 X  c! M4 }
    set A_i to 11
1 Y0 X8 Y8 G" h% t& o! z" p3 D    move into Q_induct2
0 Q9 a5 o# A5 }8 h9 d8 n; l  Q    move into pickaisle.induct26 Z" n! P; L6 Y) k: q7 L' g( a; U
    while A_i<=30 do begin  A, e: i$ M  g% x6 t( P
        travel to pickaisle.con(A_i)
5 B) G' n; j+ c% _5 J2 D( n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* b  B- u2 E7 x2 Z- \        else wait for 10 sec
5 L1 b0 }- x9 M3 L8 T( O6 @/ \        if A_i=A_leave then send to die
6 f) S) O  Z' [) X! Y        else inc A_i by 1
7 y) O8 V5 s2 h8 o    end  [+ y. D3 |' [7 ~9 i; O# R* i
end
( D* ^! r! Z3 n! {( h) A4 m* d' ^, l0 i4 L
begin P_pick3 arriving8 P: ^, {3 P+ ~' p5 w' e( ~
    set A_i to 21. ^( S0 B0 \3 Q, q' X2 V: n3 |
    move into Q_induct3# L; K9 n0 `! k
    move into pickaisle.induct3& [/ e5 ^6 f. e' W) ~9 S) J, {
    while A_i<=30 do begin0 `; b9 V4 e  P# G" @. L8 ]8 Q
        travel to pickaisle.con(A_i)
8 L! s; p4 Z! C! `' B# N, T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. r& ?; \/ V7 h2 I/ A; H8 l+ O
        else wait for 10 sec
" X% |# S0 i. K        if A_i=A_leave then send to die
) P5 T, [5 \, I6 J% ^% H        else inc A_i by 1" U, z7 k# D% l& T1 v
    end5 R3 L. ~! t6 }; s
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是个什么东东?
0 \0 v# ^; L# N, m5 w( Y- umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  x/ I; [3 S; c! w8 n) ]* I! b" ~( C$ L9 X( G+ @% q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  T- X: ?6 C: v4 P8 ?; x6 L/ R" m* O& w3 x6 a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* M2 Y$ w& e9 {: |2 r7 t& ]( Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. C# X; _  F6 Y( c4 P, V4 E) H0 C% _
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ m& B3 r8 V( t  }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# _4 z6 a" m3 z# @* h
begin P_induction arriving- N( b# H8 q0 R! L
    clone 1 load to P_pick(A_induct)
0 q/ ~" W) d+ kend最大的系
  w! N. o& U: X# {0 A! \
: V9 N1 F8 o. J  h( R% {2 l, Obegin P_pick arriving
8 _$ g6 t- d7 F# a7 s8 ]( \    set A_i to procindex * 10 + 1
& B: E9 U6 U' L9 L    move into Q_induct(procindex)
9 N& }  [. L5 N/ q) y4 V/ v    move into pickaisle.induct(procindex)- J* e! S: @7 O8 O0 @& t
    /*check the type of pickaisle.induct(i), for your last problem.*/
, i+ b" X  M: n8 {. P. J6 |! l" W6 F0 R! [' V, A  [$ V0 H
    while A_i<=30 do begin
3 W6 K0 u: Z6 l4 M        travel to pickaisle.con(A_i)4 D9 ]& ?) u  ^+ H% q) f- v0 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ]& X5 H; R" b5 `( {1 V+ b        else wait for 10 sec
  M6 ]' Y- Q! v; @/ q% d) L        if A_i=A_leave then send to die8 P- O0 W8 r5 O/ w9 ^. C
        else inc A_i by 1
0 ?) [. K# \  c    end
8 ?5 Z: Z+ e" M( m8 X, v! eend
: ~( y2 I6 g+ T# \  z, n$ O8 z( F4 D
其中的procindex为整形,代表当前process的序号。6 Q/ Y: a. v0 ?6 `2 Z3 X4 A$ R6 S8 _: {3 l
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-2-9 17:19 , Processed in 0.018711 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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