设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15357|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( `$ A+ K) O7 ~5 l6 t  X9 m: A

$ t: I' }$ e& F$ v( W我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 d1 J/ }8 D) `
/ v" R( x1 r1 \: {3 A
begin P_read arriving
1 a* V" Q3 f, d  `; B    while 1=1 do begin
( E0 k3 G6 y3 [! Q( S7 _        read A_tote from "data.txt" with delimiter "\n"- i; ^  t/ o* u' o- `
        read A_time from "data.txt" with delimiter "\n"( n6 G/ u7 @5 X) y1 d5 v5 G
        read A_leave from "data.txt" with delimiter "\n"- e4 c' x: x" X: m1 N! \
        read A_picks from "data.txt" with delimiter "\n"# m% o$ F+ U! ]% M- e% S
        set load type to A_tote
# x3 i. |. `% D0 }$ ?        if A_tote="tote 1" then set A_induct to 1( a2 [( G* e$ C, J0 S8 ~' E6 f& G
        else if A_tote="tote 2" then set A_induct to 2
3 Z$ y- _+ L) t            else set A_induct to 3   
8 r3 D: x" X* |. A8 e        set A_i to 0  n; ^' V' Q* f, ~, B/ c$ R/ l; Z
        clone 1 load to P_induction; ^4 H$ A7 l9 X" \9 s0 \# Y0 p: w. L
        wait for A_time sec
% K3 Y9 v, H% k* ?$ _    end% Z' z6 V# N/ P% A8 g9 k
end* K: ?+ k+ L4 z9 m' L; ^  X' P
2 c+ u2 V" ^+ C" O: M$ N1 c' l
begin P_induction arriving
8 ~' ?; P. F2 B# L! n& D    if A_induct=1 then clone 1 load to P_pick1  y1 J' x* ]3 ^6 r% _5 m' v
    else if A_induct=2 then clone 1 load to P_pick2! k- a; N; N' n0 Y0 g) Z
        else clone 1 load to P_pick3
* \2 G9 g! Q( {8 X! P! e' e" oend
, m0 X2 g! }; C  ^; m: D$ w! s* O
) n# D& l# L* N* o* \8 ]begin P_pick1 arriving
, ?2 u1 }2 X9 j' C    set A_i to 1
' G6 X; f2 r1 ~* @( Z. [    move into Q_induct1
" s" C5 B) T4 n1 s0 L' n' F    move into pickaisle.induct11 ~. ^: Y' b- J0 U/ t
    while A_i<=30 do begin
, N. Q1 ~- F4 p% R* O2 [8 H        travel to pickaisle.con(A_i)
! [, o9 u, _* z3 `4 q/ C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 a  Y* }" w( K9 c6 ^
        else wait for 10 sec
, S* X; n+ o: q- g2 P        if A_i=A_leave then send to die- ?7 `) I0 y5 \7 r
        else inc A_i by 1
; j( N2 K6 @$ B$ ]/ Z# N( b* a; s    end
9 F: G& |$ d7 M" i3 V; dend
  c: t& v6 W1 T, G, K
# P9 z$ _( ]  Gbegin P_pick2 arriving
+ A8 l/ {( K* b/ V* @( l    set A_i to 11
( a4 A! i0 l6 Q9 O# c4 {9 ~    move into Q_induct2
) n  K/ f( S% S( ]/ p7 z# W( I    move into pickaisle.induct2
$ X0 s9 A; \& J* D    while A_i<=30 do begin
& g% \4 H" b) `" H. E        travel to pickaisle.con(A_i)! }% u& `  @' r# b. K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ~7 L! O  A% r$ M$ Y
        else wait for 10 sec
) R; {+ J2 O$ n( H8 `        if A_i=A_leave then send to die  K/ P# Z* }9 }
        else inc A_i by 16 H& |( v1 f, d
    end
0 {' N# K6 H9 G0 z; l2 k) Jend; t' J- @- ~4 ]' P
" u0 Y% i! o6 f* a7 Q
begin P_pick3 arriving
) C; T, j5 C: W# P    set A_i to 21. R  q5 v4 K8 K" ^2 u/ U/ C
    move into Q_induct3
) ]; F  ~: I0 G    move into pickaisle.induct3
' f( N; G; c  ^3 N" w% J    while A_i<=30 do begin2 M$ \6 N8 d9 ^
        travel to pickaisle.con(A_i)
: p/ t. i8 k( j( V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- [  \4 k$ B) W: g. q+ {$ P
        else wait for 10 sec
1 A7 E! D1 @$ S) I+ a        if A_i=A_leave then send to die
* i6 j. @* q7 n( L5 d        else inc A_i by 1$ p$ n% j2 c; L$ x
    end: R( e* ?6 Q) H( e0 Y! W5 K) O
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是个什么东东?
2 ]1 B" {& W1 Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' n8 M: A& P' H8 N, ?! o% @4 V  x
9 r7 n- j! {- H. M! W; lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ L; z, j. ~, [3 _) P% j

% {( J5 g9 j2 n: ?- L: J另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" ~5 q5 t) f8 n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: m# ?( i1 d( c, l, `2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ A4 e) Q7 H8 u  e! z+ P7 g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' O& @. \' U6 E3 K3 _
begin P_induction arriving
! @% D3 u7 T  T& H0 Z' U/ D" p, B    clone 1 load to P_pick(A_induct)9 b% K9 \3 Q  i/ x* B/ D) J2 w
end最大的系+ U( r+ r) @5 B1 {3 H5 W7 Q0 K

. g6 ?# Y7 g  N) h4 ]% p2 Obegin P_pick arriving
7 W8 f/ F1 ~0 c/ X* p    set A_i to procindex * 10 + 1% u1 @, A/ i8 b, S$ \6 C, }, {
    move into Q_induct(procindex)
7 w5 J+ F  J8 G" C" D% ^    move into pickaisle.induct(procindex)
- t4 e+ d+ K8 ]+ M    /*check the type of pickaisle.induct(i), for your last problem.*/* X7 o1 C. V1 E$ W7 V3 V

( \0 h; ~! ^5 s8 J    while A_i<=30 do begin4 K( _" s# u  V; X5 P
        travel to pickaisle.con(A_i)
3 z3 b4 [$ Z" n' j' a( y$ L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 I5 |1 _9 k3 O5 F- l
        else wait for 10 sec
6 c' E4 I- W# J. W' k3 }        if A_i=A_leave then send to die. g" E9 T+ F8 D7 e
        else inc A_i by 1, O/ v+ y/ |& d1 d4 S
    end% z* R' P: b* `9 [' M& @  L
end
* }# y0 v+ c/ w: G- c1 X
0 m) Q- [0 X; p/ j( f7 n其中的procindex为整形,代表当前process的序号。
) E+ w7 E0 a# P2 c% M0 ^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-9-4 22:35 , Processed in 0.020451 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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