设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13931|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 s/ d& ]8 C6 }3 A4 g3 z/ f, C3 }# c# i. a& K; P% e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: B, \1 o, F+ y1 W2 _+ F
# E) i  q# F5 A* e1 w3 z5 O2 }
begin P_read arriving# j0 t- b+ _2 d, s
    while 1=1 do begin
8 g5 c6 m0 R. i* F5 I- E+ {        read A_tote from "data.txt" with delimiter "\n"
9 k( A) b1 B) k; u5 o+ m        read A_time from "data.txt" with delimiter "\n", q( e# k* \8 @
        read A_leave from "data.txt" with delimiter "\n"
- D( X% l5 i7 I4 ?( z! [5 C        read A_picks from "data.txt" with delimiter "\n"5 n0 @, |; {: [1 P: R" ?4 Y0 |5 p
        set load type to A_tote
9 N% L# B# f) t9 m( [( v        if A_tote="tote 1" then set A_induct to 1
  C1 W' a( x- J        else if A_tote="tote 2" then set A_induct to 2! R. H6 V; u- M# B
            else set A_induct to 3   
5 P6 K0 K# Y! l2 ^  g        set A_i to 0
+ j0 e3 b: n$ Q" o) b. G        clone 1 load to P_induction
. M$ d& w% J3 _, Z" S        wait for A_time sec1 w  G. j! ^9 x5 Y
    end; x9 ~; W) u4 d  M4 l5 Q! u5 j
end# h, g" g  g% s1 I

6 b, J. y- A5 }, ~- a) e- \, P$ y: y+ qbegin P_induction arriving
  T* c3 U5 M4 m% }' f1 J, x    if A_induct=1 then clone 1 load to P_pick1- o6 x6 g# i  M, u7 }
    else if A_induct=2 then clone 1 load to P_pick2
  w6 r* X  t: p0 E/ |        else clone 1 load to P_pick38 r. C+ r9 G" t) x8 Y5 |
end- ~' b6 C* n# k- z6 R

2 y0 f- t$ F: A3 u1 Z, s. \) I4 Ebegin P_pick1 arriving0 H, Q( @, b$ w/ K. g) b1 o2 \
    set A_i to 1
( m* P/ l" X# q% y2 Y! G5 G0 ?8 Q    move into Q_induct1
- {. e1 ~0 `" |, s    move into pickaisle.induct1
3 J" n* ^2 ]6 N    while A_i<=30 do begin/ f0 ~& }0 f! h( }" e; t' G/ q% x
        travel to pickaisle.con(A_i)
# ^% [5 b+ _+ K3 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X: ?! w9 ]1 y$ J  h3 u. `9 ]
        else wait for 10 sec* h: }* e8 w6 w' t' ^
        if A_i=A_leave then send to die
' Q; U' G) [4 s5 X4 I        else inc A_i by 1
4 R, i4 R' {( `4 F    end
3 A4 d  r. G  i" |+ N  z- Nend
: @% ]7 {+ k$ D& l7 E( ~4 B* d" r" F
begin P_pick2 arriving
- t* T" H$ ]; W! a# c3 E7 f    set A_i to 11# f- y% d' j3 x  [7 P5 {$ U
    move into Q_induct2
4 E5 S! t" {- N% e& W1 b    move into pickaisle.induct2
) {1 |+ \1 w0 J' e; r    while A_i<=30 do begin
& d7 {+ V& Z3 G; g        travel to pickaisle.con(A_i)+ T; d$ J# s" X. ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Y- z6 \5 Z8 {& u8 d
        else wait for 10 sec: {7 c* ]3 V" U9 U
        if A_i=A_leave then send to die
8 P& a. ~- h( j! }& I        else inc A_i by 1
3 X  Z; q/ r& o    end3 F# k3 ^: r4 ?3 q( |! [$ S
end
* @" }$ z4 e) @5 K! e" e  g, U/ R9 V9 |8 ]) W
begin P_pick3 arriving
$ T1 V* j; E8 ^5 A$ Z. n0 G    set A_i to 213 P: c" D$ ^3 L# C. U3 N
    move into Q_induct3) _* ?- {+ f2 y: y
    move into pickaisle.induct3% ~# j% a0 H0 u5 L1 l
    while A_i<=30 do begin
( v4 j: w8 ^% e; a1 }        travel to pickaisle.con(A_i)
* g- W0 ]! u7 N0 G+ J6 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' J& _9 \; X: ^: n/ w3 |
        else wait for 10 sec- `, O. u& z  c
        if A_i=A_leave then send to die
& O8 {6 Y4 H, x& K  f        else inc A_i by 1" q- ?! A0 B* U/ S
    end
" X1 k' ^. d8 |9 k- L' Wend

最佳答案

查看完整内容

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. @3 y$ C  q5 M+ b3 u) h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 [* X6 q) c; v9 e
- N0 Z; w6 D, ]# n: PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ [- a5 v+ o' S9 u. U7 ~- M
: i. ?  S$ e5 a0 Z: g, L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% B( I( E3 }1 u) o9 y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 O9 E) k, y- v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' l6 b# F& y7 J8 C9 e3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, `9 r4 G2 g0 K" Z7 L- Nbegin P_induction arriving% g0 z9 U6 |7 Z" b5 M: Z9 _
    clone 1 load to P_pick(A_induct)
- C; f4 x% e. v1 I; tend最大的系0 i$ q! \3 s  l! X# U
6 {/ N% H# c) K; b$ w
begin P_pick arriving
; w5 k/ ?; @7 s    set A_i to procindex * 10 + 1
; C, `# d: Q+ m4 R0 x6 |    move into Q_induct(procindex)1 S  V7 n: ?; k- F
    move into pickaisle.induct(procindex)1 S6 i' p9 P1 Z' Y  H! s
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 G- o. r- V2 W8 k
3 `: a  B8 E! p& K' i- X  c    while A_i<=30 do begin4 e' A/ Z, H1 l
        travel to pickaisle.con(A_i)
/ j9 J, g7 H& I; i' q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 M' S3 N3 f( O  ^" U        else wait for 10 sec
5 w& T6 ?2 c4 I4 H        if A_i=A_leave then send to die
- h) P: q; a# B1 K5 _5 B# ]        else inc A_i by 1
2 N7 E$ A1 T( \2 u    end
0 N* t$ {0 O7 I9 i5 gend% y0 N3 d# P/ R0 p, u3 @1 l
9 k% i( T) _% ?; ]  x
其中的procindex为整形,代表当前process的序号。/ o) k1 o" w- M* x) l9 C4 Q* W
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-5-20 04:48 , Processed in 0.017992 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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