设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11754|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 p0 i9 J9 z6 p8 L* P  S6 d
" X$ E) N3 }) l) H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& z, m; m1 u1 |' D& T, J/ ^
5 w* M* R. o0 @3 c( Y1 O9 r) h# Q4 Lbegin P_read arriving
! O& L9 W( f$ P    while 1=1 do begin" u% {' A8 g: p
        read A_tote from "data.txt" with delimiter "\n"8 ~, [8 Z& [: l+ x
        read A_time from "data.txt" with delimiter "\n"
0 j" f" m( D' q9 a/ u8 q        read A_leave from "data.txt" with delimiter "\n"; a3 I8 A; P, h& ]% m& G
        read A_picks from "data.txt" with delimiter "\n"6 O' O- ?3 s( k# R
        set load type to A_tote+ M( @0 |! F$ x. B+ U6 n) \8 I# N
        if A_tote="tote 1" then set A_induct to 1# M& X7 }, U* S
        else if A_tote="tote 2" then set A_induct to 2) H! P0 Z2 i! ^! j" `' M
            else set A_induct to 3    6 x' A5 \& b3 x! o
        set A_i to 0
/ M2 ?% `" X& J        clone 1 load to P_induction
/ E+ y+ Z. U# c: K. {( }! L$ [        wait for A_time sec& {) f) R4 ]5 M% x
    end
& n  n  k/ |6 C3 ?: Dend
- i4 X9 g) R& R8 J) d7 e; ]
5 O7 @2 S, s6 [9 ]  `( Cbegin P_induction arriving
- v: V0 b9 e+ F* b    if A_induct=1 then clone 1 load to P_pick13 m- E1 _7 f& v. ^4 k! [
    else if A_induct=2 then clone 1 load to P_pick25 e" q; H5 r6 Q  g
        else clone 1 load to P_pick3- w/ d# u3 c8 F- o' ]
end
* ~( l% m* \* o/ W
* v8 S/ ~5 f' v% n( g3 nbegin P_pick1 arriving' ]' d% m0 R8 f
    set A_i to 1
5 v) _% O# u! ^/ s, y( R    move into Q_induct19 z1 d6 r9 P1 i, o& ]8 B0 {% D
    move into pickaisle.induct1
1 [* a- {$ @( a3 P9 Q7 j4 {    while A_i<=30 do begin
/ e  V8 C; K0 ]8 i8 q2 F        travel to pickaisle.con(A_i)
" t  m9 \" k4 b+ w, ]( r  I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( X, B0 Q- Z% h: {3 x        else wait for 10 sec
4 {6 G) [0 M7 O) s, x        if A_i=A_leave then send to die
4 y7 s6 E- D  W        else inc A_i by 1
. U6 H* f! @! q: B: c    end  L9 R: H$ w$ ]4 F) o
end
$ J$ O: t; }# M* i, L
# X* v% j3 o1 K7 n) C. [3 [  j3 dbegin P_pick2 arriving
# m3 l$ l3 \( L& I1 p: r    set A_i to 115 @) \9 _  |, {6 [2 F
    move into Q_induct2
% U2 v) d5 w: n3 R4 k    move into pickaisle.induct23 @6 w/ }5 G+ r' D9 r
    while A_i<=30 do begin  A5 s* U! M& N9 v, {5 X$ E
        travel to pickaisle.con(A_i)
. ?1 H1 {) E* S+ U8 Q7 f( B& L( P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; j% u' j: Z; x% H& {9 C
        else wait for 10 sec
0 J4 [- I: h9 F* Q% q7 T        if A_i=A_leave then send to die
. c3 n) l3 N# P4 W        else inc A_i by 1
  {; K$ S6 B' m4 S7 E8 l. [    end& I) U" M. c8 _$ q
end4 m* D! F7 K. i8 a' R
. U4 a2 u1 ~5 f0 h" K* h1 [; c
begin P_pick3 arriving
/ K8 w: ^- x7 B6 Q! M6 q    set A_i to 21- a1 X5 e+ J- `4 s
    move into Q_induct3
$ j( A  D9 c, C- n; r7 b8 j9 i    move into pickaisle.induct3  F; a; y& j8 w- C0 ~+ n
    while A_i<=30 do begin- }% b4 G; k& Z1 P" I
        travel to pickaisle.con(A_i)
* Z1 K  |, r5 ~3 @$ z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 H$ C  `$ l4 z) _( T6 |& j, H        else wait for 10 sec
+ H; m1 C3 y4 G" d% }% {, o0 u        if A_i=A_leave then send to die' C/ j) H( c  z. g5 U
        else inc A_i by 1
6 k. V  e/ x; l8 R9 }8 a' n    end5 M& V- O+ y5 t  Q2 [4 E! p7 J0 [
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是个什么东东?
. c  |& C9 B9 s7 `9 Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 U1 O' L& R7 D' y
: @' V, F4 k/ z0 {$ w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 I5 F2 M/ y/ V( S
6 ]& {- |0 y( n- F# V4 ~6 u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 _+ m' G7 l- I  ?# x  O6 p: @6 m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! ], h1 x# Y' \/ k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) _* I% k* v9 G% N2 J" \; x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ F& L3 n$ }8 Y. `* d& s  c- j: Z
begin P_induction arriving& l' G, e# b$ W& }/ b5 j& p) F
    clone 1 load to P_pick(A_induct)1 M5 V- g% ?3 [5 d* p
end最大的系
% k- I9 x' i( X/ d: }% y+ A8 F! d8 h5 m& H" U* C5 [4 B" t* Q
begin P_pick arriving
: i0 r3 I) c8 d4 W    set A_i to procindex * 10 + 10 a; x* w) [* c5 @* v" H! m1 ?' C9 Y
    move into Q_induct(procindex)% U4 W/ Y3 T! K' k* c
    move into pickaisle.induct(procindex)
& |+ C6 l" @: ]    /*check the type of pickaisle.induct(i), for your last problem.*/
. M  E4 [' y4 Q. G9 Y" S+ q
: x1 q& O. c' `. d/ k- O* P: R    while A_i<=30 do begin1 i. ~% l2 m1 ]  s3 u
        travel to pickaisle.con(A_i)
# W, @, W: a0 m: ^; v# C1 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" q- ^% F& p  U$ J3 A, `
        else wait for 10 sec5 u) l: _  {$ _- c6 J; L
        if A_i=A_leave then send to die5 h/ _0 K3 h2 H: b) t. K/ T; r6 W
        else inc A_i by 1
; U) t. B3 e+ u# E4 E3 J2 V    end
: Y# I7 f: u5 K$ R, jend
& a% g. K9 Z8 k# M& H- e7 x( o, o) ~* K8 ~0 b" i3 Q- J% t
其中的procindex为整形,代表当前process的序号。5 t9 u0 a2 I" t$ n  d
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, 2025-12-2 15:58 , Processed in 0.027855 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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