设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14814|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 a8 R6 P  M  m' D+ ?" k! D# A2 }0 k! i  u7 c- H' l' ?( V' p
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 m# ^5 O! B) N2 s1 ]+ l& n6 l( R3 k; J7 Z2 `! c1 z9 G
begin P_read arriving
$ l4 h" f! E0 h( l    while 1=1 do begin+ d% C7 u! t/ c1 N
        read A_tote from "data.txt" with delimiter "\n"  q+ p: l7 V, B
        read A_time from "data.txt" with delimiter "\n"
2 M! g' L9 A6 d$ A        read A_leave from "data.txt" with delimiter "\n"  X; p( ]! A; o( \: c1 G$ I2 b
        read A_picks from "data.txt" with delimiter "\n"
' j2 ?' [: r3 m. |( Z: I        set load type to A_tote' p* w- \$ ~8 }: b+ N
        if A_tote="tote 1" then set A_induct to 1& n' E3 S( B6 g% }( ]
        else if A_tote="tote 2" then set A_induct to 2, |1 @, r* {( _/ ~. D8 E
            else set A_induct to 3    ) y- T# n7 |0 }6 @0 Y$ X) {: M" m
        set A_i to 0
: Y3 f% m& o4 x- p2 `1 Y3 O        clone 1 load to P_induction
3 Y; g) ?2 U6 n        wait for A_time sec2 I9 q6 h# x: S, ?2 l
    end
2 z% A6 j* b8 m5 d* ]( M( N. Cend
% t3 `2 h& ~  s- g- x& d1 v8 l' K% t0 A9 j$ a( d0 j' k
begin P_induction arriving
7 g3 k1 k/ g- E+ s: d6 z  g0 r    if A_induct=1 then clone 1 load to P_pick1
5 \! u$ f3 n+ {# u3 l/ [! U    else if A_induct=2 then clone 1 load to P_pick2
% H" M7 E" P* P+ M6 _8 u        else clone 1 load to P_pick3
+ a# F; ^% m% G( Xend. z' ~$ H5 P3 _; n6 k# ~3 u

5 `( G/ p4 g6 ubegin P_pick1 arriving* u$ p2 ~. Y: o
    set A_i to 1" B7 y" u. w0 N  v" F$ e( I( a
    move into Q_induct1
. L4 v2 f6 d' a- a% S    move into pickaisle.induct1
% t! W5 ?- R2 X! n5 ]. U. D    while A_i<=30 do begin  h) M; Q0 X4 t  y! o! _
        travel to pickaisle.con(A_i)
8 z- D2 |5 L% o0 }- k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 g; h4 m# V! `- G
        else wait for 10 sec
$ C1 v! h9 H+ Q        if A_i=A_leave then send to die
+ G4 g9 p" }$ E3 ~$ V3 o/ z        else inc A_i by 1
7 k- s9 h+ U/ q" a* @. _# o    end. m, @$ q* E6 m2 |
end$ X1 u7 ^: L- F5 h& f% I' |

6 k0 i! q# W6 d& z  [4 f4 lbegin P_pick2 arriving
) [' l3 m: K3 E# q$ a7 v    set A_i to 11
$ T5 A$ X$ f  b8 S2 m9 t' b3 l2 \; r7 M    move into Q_induct2, }; ~$ j7 L1 o7 i9 b
    move into pickaisle.induct2! R+ S7 R  N' i2 S
    while A_i<=30 do begin
& t+ z( f: P/ W0 K4 P$ P6 n- q) k        travel to pickaisle.con(A_i)
$ z5 l& ~8 r1 ?7 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! R7 O+ r% k, B" `9 x        else wait for 10 sec
. u0 n& @( z0 @; E: _        if A_i=A_leave then send to die
2 Q3 ]: i/ W. M: U1 Q' }; y& v( \        else inc A_i by 1
8 j. C8 q' @' F% Q0 y% r. P4 b    end# _9 E2 o6 H+ K' I1 f2 S4 J
end
) E2 f: e: R! G6 i% m! z0 d, p% A, B2 c: w5 v1 t$ o9 {: p( ^
begin P_pick3 arriving: v; G' F9 G4 a5 T7 l- i; i' m1 x
    set A_i to 21. o( R2 |1 }  x. a2 W5 R; Z
    move into Q_induct3
: U+ M; W9 N! V; ^+ d9 g    move into pickaisle.induct3
4 t/ ?9 A0 `3 h    while A_i<=30 do begin6 _2 W4 O# ?* y; K# m% Q2 e6 i
        travel to pickaisle.con(A_i)
& ~  a- p' |% f' C+ n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ A9 C% X0 o4 M; S5 v        else wait for 10 sec
( @  m# D" N% h6 p, I' _3 ~, _% u2 f        if A_i=A_leave then send to die7 P( \6 Q7 C3 {5 K0 D# f
        else inc A_i by 13 k' Z) k2 ?7 J) F- W9 }
    end: ]' ]( z( j$ f$ k/ B
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是个什么东东?7 S' [  [8 V1 j, ^- S% ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ A6 j6 g5 \- n/ m1 L" g1 }: S4 X
" f% q; e# n$ M9 s2 d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 o# ]- M& [8 G2 _5 M% u. F  D4 [. P/ Y) d, H' ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 k" [% u: c7 [) W# G  N6 a
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 i6 N! `) W, Q) F! n- l2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 v: m( U& |2 l0 G8 Z' U4 P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 B6 y1 O2 X  {: n* m- N; Ebegin P_induction arriving
7 G+ Q6 e- ^: J1 H% e9 H2 l    clone 1 load to P_pick(A_induct)$ b. ^7 t* }/ V; s& w
end最大的系+ z7 o& [# [! {

3 j) A4 |7 G/ zbegin P_pick arriving
# ^- \) X3 _+ O: K- K, |* D- U/ M    set A_i to procindex * 10 + 1! ]8 j- @1 _* ^; \9 ^3 Y( i8 j2 \: T
    move into Q_induct(procindex). d" K% I; `+ W3 s
    move into pickaisle.induct(procindex)1 i- i9 @' t/ T7 M$ f/ h1 D0 c, N5 q
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 l( o7 |9 ]4 T% Q9 Z; A' a5 _/ e  f5 z4 H' K
    while A_i<=30 do begin7 _# Z" S+ L2 {8 e7 I# N( e7 w
        travel to pickaisle.con(A_i); s6 V" f: F- V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. u# ~) u9 p" A
        else wait for 10 sec/ T4 V, d- ~5 Q, s$ ^. y
        if A_i=A_leave then send to die
; O3 d  g: D  i" _1 h9 h/ X' k        else inc A_i by 1  q1 L5 d& r. Y3 ?0 k& o3 \6 K" p
    end
3 [9 t" w; F9 s2 Z9 Oend( w: d, V0 T; m9 ?
) H1 l0 v+ s' T5 ^8 A
其中的procindex为整形,代表当前process的序号。, V/ R& b. h" C( p  ^4 F9 A+ Y; V
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-27 17:00 , Processed in 0.015558 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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