设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13957|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 Z" ]4 T3 }9 \# I0 B4 R9 N$ n4 y, T
( f0 `! ^( A+ x) e- m1 O$ f( D我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 l0 K& \; f% @. \! Q# R+ j- T# i/ a: ^  g. q1 Z  ]" H  _# j
begin P_read arriving% c, U6 L. m3 r  ]4 \6 X1 P* t
    while 1=1 do begin
4 z: }1 I! ?: N) L, \( C        read A_tote from "data.txt" with delimiter "\n"& H6 {  ~* f( C5 h* s
        read A_time from "data.txt" with delimiter "\n"
3 e1 V. j8 w; u1 I4 w* T6 Y        read A_leave from "data.txt" with delimiter "\n"
  |; |+ c- }# }% Z5 V% J& I! ~        read A_picks from "data.txt" with delimiter "\n"2 N5 Z0 z8 {: J8 O
        set load type to A_tote3 Q6 r! ?: s3 E- {3 c$ U+ U" E: L" a
        if A_tote="tote 1" then set A_induct to 1
- ~7 U2 @( ]1 Q5 E+ R        else if A_tote="tote 2" then set A_induct to 2
* B  y9 T4 ~; H0 X3 M7 q( C: ~            else set A_induct to 3   
3 |& e3 j1 G+ P        set A_i to 06 H; d- w- }1 m4 \; q
        clone 1 load to P_induction4 a# x$ S+ S# F7 g* _
        wait for A_time sec
* F/ L: x8 Q6 C' S4 Q3 W! J    end# Z7 l; Q9 B) E9 h2 n
end# N# r' n. B# G4 r, i
$ e- i; P- D5 j
begin P_induction arriving
0 v+ x% R! [/ ~. k2 h9 Z. z    if A_induct=1 then clone 1 load to P_pick1
" ^4 {' b) G$ k7 S8 r0 g9 [    else if A_induct=2 then clone 1 load to P_pick2
- Y# o! S. r6 l        else clone 1 load to P_pick3& m  O1 H+ j/ C
end
' Q2 R& W1 }% V* A- z7 L; N) G% G' V7 P8 ]
begin P_pick1 arriving& ]* ]9 S) ?' \+ x) v# c: g) r7 M9 J
    set A_i to 1
4 K4 Z1 Z. D( y4 E    move into Q_induct18 w* p4 k/ G! s# W+ l: @
    move into pickaisle.induct15 o) `- o1 J- R; m$ A/ M8 G* W) b+ x5 b
    while A_i<=30 do begin
( p' Q- a) ~7 H        travel to pickaisle.con(A_i)7 @$ \: [8 D. o& F, P( B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& B( M6 }0 j' |, [. \        else wait for 10 sec
" n2 [9 W4 t! s. t        if A_i=A_leave then send to die
% m& r4 E" i# j! _/ `* E0 z        else inc A_i by 1
# ~( |8 B# L! j, X: ^6 ?4 K    end
. ]7 b% U& v1 W; send6 O" K' e( ?1 z+ G* q' ?6 P2 ~2 L1 f
- C& ]3 o1 ?9 O+ y1 S9 ?
begin P_pick2 arriving
4 a3 d: k& Z$ s/ U& b7 q    set A_i to 11* f4 c& N2 C! X5 {: V) x* Q. T
    move into Q_induct2
) n& t, D7 @9 R2 m3 Q    move into pickaisle.induct2
+ y6 |4 m8 B- |7 _& |    while A_i<=30 do begin
7 I+ ~. F' R' p9 m        travel to pickaisle.con(A_i)$ t* i& t7 e2 F* ~" E1 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 a4 t1 p# C! Y7 p4 G5 i
        else wait for 10 sec
4 _0 P9 A# Z# [9 c        if A_i=A_leave then send to die
4 [; n  f- j9 B7 a        else inc A_i by 1
( w" l! m4 E* H8 W6 N1 t5 S8 P- w    end$ T9 y! T+ x1 N; K( t5 Z
end3 X) V. i. C9 ^0 c2 \# u$ K

5 N( B2 f' n" C6 t' m7 }! S' wbegin P_pick3 arriving1 ?2 V8 ^; j/ [) S! q/ B
    set A_i to 21
9 X# V/ l+ F5 w    move into Q_induct35 M, @1 h0 {5 T0 M
    move into pickaisle.induct3" }8 \) W8 j) I
    while A_i<=30 do begin2 ]2 R8 z* H: j& N+ @9 r
        travel to pickaisle.con(A_i)* f" V$ z  v) Q; o( W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: v4 W& Z: ^! y* N        else wait for 10 sec" O9 n+ h* @6 o8 O# s! o* M
        if A_i=A_leave then send to die
' _2 _0 ~* o# g; \        else inc A_i by 1
5 s' B5 U1 Y7 `1 U: |    end
8 e! @! ?+ x# }8 u/ x& [0 eend

最佳答案

查看完整内容

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 |0 }/ C( w1 B: T$ Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' v5 V# \' N  M7 a8 m- u2 a& |: ~; z+ I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- Z8 V8 ?$ ~+ E* m9 Q4 f8 g. `0 N' K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 z) q; y: r, r1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 G( \/ C! P! Y: X5 D4 t; D0 G. G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 D. u* X. W. O. o1 O3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 {7 k  L& L6 o% w# q& vbegin P_induction arriving8 p& Q5 t' W+ z) }
    clone 1 load to P_pick(A_induct)% e+ q7 \; A  Y
end最大的系1 A- L& \; o, R) G
/ I  R7 O  `) O* g0 O* F' D
begin P_pick arriving
0 {& ]; Y5 `0 }, Z* e    set A_i to procindex * 10 + 1
4 C- ]+ S7 [$ w% x0 }  {    move into Q_induct(procindex)
4 W9 X/ e; B+ |) }) x    move into pickaisle.induct(procindex)7 ~5 u% g6 a. i+ d7 M
    /*check the type of pickaisle.induct(i), for your last problem.*/7 D  F- Q0 Z. |, c5 D
( o$ T# A' Y$ J8 e
    while A_i<=30 do begin) f& \( Y0 U1 w! O8 R& |
        travel to pickaisle.con(A_i)
' \! o/ A2 f+ g+ w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^8 O9 X  G' S
        else wait for 10 sec) Z, b8 q, U+ V3 r2 Z: Q
        if A_i=A_leave then send to die
' u7 w% ~$ b5 b0 t. s; N/ i6 r        else inc A_i by 1% {) J% y: ^4 i& u
    end
) B  k/ W, G5 F/ ?$ B0 rend, H& B0 _% w% O; R# P
* x3 A( i7 M, {0 K. i$ T. N( Y
其中的procindex为整形,代表当前process的序号。
' g7 z5 c8 O' K5 B! v/ Ostation和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-24 15:57 , Processed in 0.015715 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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