设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14153|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& N2 B$ T4 S1 a1 f

4 `& c$ Q/ I1 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- x2 `* t1 \' p! b; ]( c" }2 n; H2 B1 N$ ^% d" F7 p$ _3 D
begin P_read arriving( `2 o+ H; H; @! Y* I; v" {# \
    while 1=1 do begin& j# c( N/ d& O$ A4 M3 d
        read A_tote from "data.txt" with delimiter "\n"4 P8 y6 M$ I/ z1 Z( R
        read A_time from "data.txt" with delimiter "\n"
$ b4 s* d. V& I        read A_leave from "data.txt" with delimiter "\n"5 T* n9 {$ B8 @+ K/ g6 J5 M
        read A_picks from "data.txt" with delimiter "\n"9 a' g: P& o+ @4 R, W( ~$ T
        set load type to A_tote
7 ]% p. o+ d" p( P0 _8 ?, M# e        if A_tote="tote 1" then set A_induct to 1
9 g+ k: }2 j/ h% A7 d2 |& H7 r        else if A_tote="tote 2" then set A_induct to 2
+ t, ^1 ]$ c2 B! V4 F8 X5 x1 L" V/ Q            else set A_induct to 3    ; E5 D( U5 z2 F$ D6 F
        set A_i to 0
( M" W1 ?4 L" b, q- e% f( f5 O0 s        clone 1 load to P_induction
1 z0 p" M; W% M+ ?6 i        wait for A_time sec
" _2 ?0 O2 J0 ~6 A- ~    end
* q5 [0 f, i5 T) t  Lend: _& V' a) M; u( X* m

/ g* p* H1 @+ @1 \begin P_induction arriving
/ }8 a7 }% a; \& X# h3 l7 u' r- S2 z    if A_induct=1 then clone 1 load to P_pick1/ x$ N9 h8 `1 G$ V9 U
    else if A_induct=2 then clone 1 load to P_pick2
9 L8 I! @: j) ?# u8 h9 l        else clone 1 load to P_pick3; l; E( k; c) N' `
end
' c& W1 s3 k1 p' E& }
0 P& b; ]5 m% u, O8 C5 X6 gbegin P_pick1 arriving
/ p' ]/ a6 K/ |, }/ ^    set A_i to 17 q2 N0 g5 h- J% t: x* R
    move into Q_induct1
4 P- U) J" H# ]# E; L  v! [    move into pickaisle.induct1
- p! z9 A1 R" V7 i: G    while A_i<=30 do begin( a5 t$ W, j( W/ _, O
        travel to pickaisle.con(A_i)3 i9 b1 ?/ T3 n4 M0 }% I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 F/ W* G9 U; }: j' C
        else wait for 10 sec5 a) d6 T9 T% d; `( g
        if A_i=A_leave then send to die
$ v$ y2 {' x7 R0 G# z4 @        else inc A_i by 1
# [; z* y* Y, k" x    end
! I5 [) Q0 b  H8 i. @0 iend0 r* l& c% k; b3 a2 |7 `6 N6 n' k

, l% m! p( ]5 h5 f" I- |; c. Ubegin P_pick2 arriving
" B1 b5 |; c$ t5 Z' |8 C    set A_i to 11% N8 o  c+ }/ u7 }0 h" w: B
    move into Q_induct2
8 y8 E& L9 X# D5 s9 x4 F    move into pickaisle.induct29 n% O2 ~1 j4 S7 y+ Q
    while A_i<=30 do begin
! T  V$ P. B( X        travel to pickaisle.con(A_i)( U& \; D; Q3 f; I' c) f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( j2 d3 ?7 c4 P# X+ z3 i/ S
        else wait for 10 sec8 Y$ ~) H5 w; l& ]& x8 U8 Q/ Y# m5 X
        if A_i=A_leave then send to die
$ U$ L8 J2 V& [( i. W) g9 A        else inc A_i by 1
9 t$ R) ], h2 ?2 h' k    end
& }, E. @( k9 ?7 B- Vend
+ h# C# h3 x) H. z: [' s  B' {) L( \, n# S
begin P_pick3 arriving
2 u4 f/ e+ M: [    set A_i to 21
; ~/ p/ C5 i; s+ ^: ?    move into Q_induct3- U6 k5 H3 w. O  E; k3 @
    move into pickaisle.induct3
, |$ U$ I0 m1 s3 f* C    while A_i<=30 do begin
) B& P. n) q; M        travel to pickaisle.con(A_i)
; X: r% J; m5 f3 e6 k& S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 m$ `0 @. n0 B# n4 _3 O7 w. ^- S
        else wait for 10 sec
# w. r$ v& y# L7 ]( Q" J        if A_i=A_leave then send to die, q" [! t; ^% F, m1 c7 n
        else inc A_i by 11 N) ^, [6 R/ k- ^
    end
6 m4 I* t. C) Y) g" e  S% c, E+ N# ^. ]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是个什么东东?
( ]5 A: G+ l; D# C# q& \# bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ ~+ p+ S- ]7 Z* k9 ^6 N/ @" L% L+ `1 j- k9 G3 h* N( `5 c, Y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! o4 \2 F  }" i7 {7 w! D% ?; b; z/ e% Y6 ]% t' j6 ^  S8 l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 l- H$ @; m  m. T3 [/ ^8 Z9 |3 `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! \' g0 d9 f/ g0 F% @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 {8 d: P9 V3 ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; Y- m: }$ z) m
begin P_induction arriving" k4 X1 k- u1 d, f, [
    clone 1 load to P_pick(A_induct)# Z9 Q& O4 B$ b' |
end最大的系
* ?+ j% ~( J( V1 z4 |
8 r$ r- V& m/ d2 cbegin P_pick arriving- {- D7 b! V' J3 y9 s) j$ W
    set A_i to procindex * 10 + 1
8 R8 m! Y4 I% B" h3 k    move into Q_induct(procindex)/ f4 [' d! f. j7 r3 Q
    move into pickaisle.induct(procindex)1 t! X0 p$ r$ N$ N& s1 w
    /*check the type of pickaisle.induct(i), for your last problem.*/  E4 E8 ]. b' y( @  C/ t/ w6 B
0 n8 ~" Z& M+ @( n- Q# j
    while A_i<=30 do begin0 Q; o6 I% q7 G0 a. [
        travel to pickaisle.con(A_i)
- Z) x( ]9 H8 ?2 J3 m( w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 x, m6 @) C% R% W3 c; o6 z
        else wait for 10 sec
. X, u- X5 w$ L6 I1 U        if A_i=A_leave then send to die- q  d" r' c9 G& K  r$ k2 l
        else inc A_i by 1
/ Y& a: v/ V2 k5 P8 L! c" @    end5 j" ^6 i9 t3 v1 l6 g9 O: M2 |
end9 V( o! C# I- B
5 \/ y3 y& }* P
其中的procindex为整形,代表当前process的序号。2 t5 O/ V" g9 n; R
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-6-14 18:33 , Processed in 0.030775 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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