设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14319|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ z, G7 M8 e" L# f# w; a* u. Q/ ^# ^# I$ f7 l3 A
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" r* k8 e* P6 I1 q) y$ e% a1 `, R. e/ n
begin P_read arriving
) l; f; N5 h  F+ I0 c, i0 d    while 1=1 do begin
& g! k/ T' W; ?4 F& T/ s% E3 D        read A_tote from "data.txt" with delimiter "\n"4 S9 _& J% v9 a' @/ L! j
        read A_time from "data.txt" with delimiter "\n"
! e  g( f) m6 j        read A_leave from "data.txt" with delimiter "\n"
8 t. ?5 j  U) H: X- J        read A_picks from "data.txt" with delimiter "\n"! C8 R" A4 U, {0 C7 M0 n+ f) s
        set load type to A_tote: F0 U" p7 C8 z, b5 i4 Y! n
        if A_tote="tote 1" then set A_induct to 1
0 y' B  X$ K+ w0 V        else if A_tote="tote 2" then set A_induct to 2" ]. p: R* M& n8 e$ A2 N
            else set A_induct to 3    2 o' D( h: Y2 `6 Y" ^7 D6 `3 q
        set A_i to 0
2 i" u8 Q0 X- ^" ?  M        clone 1 load to P_induction) D' t# o: u9 J) S) |' H
        wait for A_time sec* D5 @, w, J8 e4 C
    end0 D" h# d& w3 ]2 o8 u- V  _
end
* ~6 |& i& z# Q% j5 C0 q4 q' e+ x. U% N; ^' a& V& K+ B  B: E8 ^
begin P_induction arriving% t) F& ^' z' B6 Y6 q: z% n
    if A_induct=1 then clone 1 load to P_pick1
/ i% p8 p& T1 \; x9 f    else if A_induct=2 then clone 1 load to P_pick2
: X! H/ \2 R- Z        else clone 1 load to P_pick3
: t: {# H; [, ^, H& pend
" ]* A) B$ t. [  W' c% v6 C$ q. Z' r
begin P_pick1 arriving$ x' p" A: T. u, o: l% D
    set A_i to 1
. G: A* X! \1 ]5 R7 c) m    move into Q_induct1( E7 C( O, A" W, s3 Q+ a" F
    move into pickaisle.induct1
6 E( [* b& W; O# j0 D; \    while A_i<=30 do begin% ~, i7 K& }; x$ C$ A3 ~- }+ L
        travel to pickaisle.con(A_i)
. H* l# ]4 e9 I+ K3 L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. k- p0 K9 O" q        else wait for 10 sec
/ F+ t" @' ^. M/ h' k        if A_i=A_leave then send to die* u  H0 C, |/ w) d2 j6 W5 [
        else inc A_i by 10 M. F5 W, E/ @1 `, w
    end" r+ ~- K9 V# K0 J  v- y& W
end
+ y$ h5 ^: G+ G& N% a* D/ I5 q* b: s* {6 I# w5 Z3 p! L4 x
begin P_pick2 arriving
3 n) d. }1 x! U4 s    set A_i to 11
* d- T1 f- t9 J  w$ w, G" a* j    move into Q_induct21 N% {$ c4 ~$ k: `+ O) s; H
    move into pickaisle.induct27 x; U" |8 w1 q) x
    while A_i<=30 do begin
& O) ~3 @4 c* x: \0 O        travel to pickaisle.con(A_i)
" j) a8 f. Z9 W1 y3 G1 E  x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. I7 [% E4 k/ L; M0 [
        else wait for 10 sec
) b5 U2 @* r* A1 N! o        if A_i=A_leave then send to die
) s& }8 p4 v$ @) y- l; c% o! e        else inc A_i by 1
/ J; H2 j8 c( P1 q. H# @, L) l    end
5 z, t9 P$ [3 bend5 b& i& h' m# g9 v% i
9 |: N, B: L7 T# C. O
begin P_pick3 arriving: d9 @+ p4 b- s' J, b
    set A_i to 21
7 l* {) q! Z+ v$ v: Q/ K    move into Q_induct3. G  K5 T. n  s& J3 R
    move into pickaisle.induct3% m1 c# S* O1 T, L" M0 d: J+ e9 r
    while A_i<=30 do begin
4 e& J1 @& G+ S8 x, H5 n        travel to pickaisle.con(A_i)
9 f+ i0 {2 V6 q' F4 y3 J8 U1 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- {8 J$ }5 }) w4 W- |
        else wait for 10 sec! j4 Z2 Q- C! i  w$ `7 i1 _
        if A_i=A_leave then send to die
& D: _. n9 A: K& g5 P3 N        else inc A_i by 1
" b/ C; g% f  I& Y2 j    end; M( u( w5 G( e; `, |! ^6 x9 @* V) 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是个什么东东?; s8 A( K$ {5 D3 q4 [  d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* P2 _7 b7 k' c3 \# j; }. a9 ?. b: i" ~1 g& M8 Z) M
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) `% f& j/ B1 b) r6 p$ d6 x, [
+ L2 m' o+ u. r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ E* m6 w" c' D, a5 @& L+ {4 D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 W* y1 s3 x* o3 q( c8 _# M: L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) J9 d. p* |) T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ e; d! b. N: T# l8 _
begin P_induction arriving
4 T! X+ s; Q2 W+ k, d    clone 1 load to P_pick(A_induct)
6 P2 C: L, G" U6 nend最大的系. u) q* i* c; F- e% y
7 i$ _+ @, ^5 P
begin P_pick arriving
$ t  L. R" J: P6 S# s  B    set A_i to procindex * 10 + 1
. ?+ t$ |7 A4 i, V- a3 Z    move into Q_induct(procindex)
6 k; e; i- c) V- v4 G" S) c    move into pickaisle.induct(procindex)
" T2 j* q5 V& N) H0 r8 S  J; @    /*check the type of pickaisle.induct(i), for your last problem.*/) \. a" F5 f- ?1 m' T8 D) V

/ \$ \: W! @: p: P% M" }    while A_i<=30 do begin, w4 o4 Y3 ?! G6 n6 a* z0 M
        travel to pickaisle.con(A_i)
5 r, g9 l! b* Z& T+ ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# C) G3 S: G9 T  G5 Y  M( W' J        else wait for 10 sec
1 {! L6 w6 {& G2 V        if A_i=A_leave then send to die/ _1 q5 l, ^7 r  t. e. v4 h7 L
        else inc A_i by 1
- y. _* }. ]( Q    end3 l1 Z7 }" g) w) i: a. M
end/ `, m. O7 Y+ Y% X- L6 g) i% Y! C2 A# U
6 u4 m7 s' L9 j. X
其中的procindex为整形,代表当前process的序号。" k9 T; c1 N: G8 q
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-7-2 13:37 , Processed in 0.012967 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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