设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13903|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% w% s4 p2 ^: ?8 P& y
6 f# i  J: c8 C我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* S* m- D% a* h/ N3 F
2 i" m/ g- m" f! S% _) k( K% `begin P_read arriving
2 p$ G3 Q( E0 D6 Y0 z$ T    while 1=1 do begin9 y/ r" z) Y* E
        read A_tote from "data.txt" with delimiter "\n"8 R( B& e- H1 t2 S
        read A_time from "data.txt" with delimiter "\n"2 h  |2 g+ C# ]5 k/ V( a9 s7 I/ f, h( w
        read A_leave from "data.txt" with delimiter "\n"
* `* q$ U9 Y# V5 [8 s8 g( s: j6 ^        read A_picks from "data.txt" with delimiter "\n"
, z$ S9 E2 {" a  J' ]# a        set load type to A_tote7 ^2 Z3 W& r" x' w8 z/ V6 w
        if A_tote="tote 1" then set A_induct to 1
" S! q0 E' A% A* R1 O3 Q  m: Z        else if A_tote="tote 2" then set A_induct to 28 L' n* p8 k0 Y- M
            else set A_induct to 3   
4 G# F" f8 c; s2 S" A- G) |        set A_i to 0/ \$ e6 h  {, l+ c) U5 f
        clone 1 load to P_induction
" Z1 M3 `7 F( W( o5 @3 }; o        wait for A_time sec
( C  a% [( p, i2 E# C) {+ l    end
7 K3 s. @8 v( B( B+ e0 eend
) p, r* P- z, d; Z; \. u  y9 H# u2 j3 X8 W0 S7 {
begin P_induction arriving/ t" \* T- c* F2 O
    if A_induct=1 then clone 1 load to P_pick1
$ h" S  S. U* G6 R" N, o. K* W0 S    else if A_induct=2 then clone 1 load to P_pick2
$ g9 e! u3 _2 q4 i8 V2 W; R4 i. l; B; ^3 v        else clone 1 load to P_pick3
8 p/ m& {( v% ?' vend
# e1 s5 C3 R* {& H8 S
' k7 e* M) N+ G3 [6 abegin P_pick1 arriving
) \) U" `/ N. K+ c: }1 v    set A_i to 1) @* ~% M% @$ Y
    move into Q_induct13 G, q/ [) I2 A% E( i" J  U
    move into pickaisle.induct1
7 ~- h4 `: e8 C0 M+ p) E# u2 B    while A_i<=30 do begin
4 @2 b5 @8 s, i) @5 d        travel to pickaisle.con(A_i)+ z: ?, t, Q$ o% M; k: Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% N0 Q% {- T) y
        else wait for 10 sec; B  N: H" w+ ?0 r2 `6 R) X7 y5 L# I
        if A_i=A_leave then send to die* r" p2 F; g1 m8 X
        else inc A_i by 1# u" i+ C5 e, O" P1 q% }
    end
. h% F! Z, g, q' v6 iend6 @9 s5 J! ?2 F  |7 s- V

6 c; y4 i# B/ bbegin P_pick2 arriving
% l5 x, y3 N0 }) R# f) P# o    set A_i to 11
& Q3 t' N; @4 D( J7 M& R; k    move into Q_induct2: ^+ u0 n1 G( h) x" c
    move into pickaisle.induct2
9 T! c1 w( u( t$ f( o  w9 ]: s    while A_i<=30 do begin
) V$ i! d! d0 E9 ]        travel to pickaisle.con(A_i)
9 J# }+ m5 ?! u* x$ S& f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 X$ L; e" ^  O" u
        else wait for 10 sec
0 P7 v8 O( R4 q/ G& w: h7 _        if A_i=A_leave then send to die
1 V0 X$ F6 `1 Y8 t& _5 t3 x2 b        else inc A_i by 1
- p+ u$ _4 b4 u( B  h! h7 v; G' o    end3 J5 A+ v! Q/ j  j7 c2 f/ R$ b
end
) R) `- \4 u3 y- ^# X" R5 j
8 U/ O7 X, f7 N8 g! }) Ubegin P_pick3 arriving
, I+ t4 f, G2 P2 n- H  ?    set A_i to 210 o+ j" W5 g- u7 E6 t4 s
    move into Q_induct3" ~; t4 u5 c2 R2 F2 Z$ `. V
    move into pickaisle.induct3
* B- s" s1 r/ [, r/ y    while A_i<=30 do begin
" L5 Z& f, E1 `# W, D, n        travel to pickaisle.con(A_i)! P* X- i* {( c) R# g9 }' o5 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* s4 [, K: Z" ?% I
        else wait for 10 sec0 I$ p0 k8 x  v. w" c, B
        if A_i=A_leave then send to die; }( q. _# \8 U4 K/ e0 I5 x
        else inc A_i by 1) V/ M2 |- i. E
    end& d# p3 A. s* n; j! ]8 U) Z' `
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是个什么东东?3 C4 j: s' o; i  F7 D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 e- N7 X7 c: i0 ]
* S1 G( }% c7 s- \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 b' F# I  B) X2 s/ _. \
9 T" G& z4 q& T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 C6 I+ N8 j6 p  j6 M% Y2 O- |7 B
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) ], W( G- [9 ?7 t. Y* L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 p$ q. M7 p; N9 B, p5 u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 X3 f; W% B  [' `# c  O4 f( O
begin P_induction arriving* ]/ C! Y! z9 d( @5 [+ O: \+ w
    clone 1 load to P_pick(A_induct)5 w+ I1 V# D, Z
end最大的系
" v# v* d2 X6 k, H/ s9 d! F
4 I/ y+ l6 M8 Z$ l7 k9 Hbegin P_pick arriving* Z6 X, R2 S% i$ V2 G& ^
    set A_i to procindex * 10 + 1
2 {! y' d. I& m/ W: j/ n3 i    move into Q_induct(procindex)
: K5 e( D" s7 H7 D    move into pickaisle.induct(procindex)
9 E+ d0 z4 d5 g' y3 L, G  I    /*check the type of pickaisle.induct(i), for your last problem.*/
6 \# c# W7 ^& y  E. D2 s# e, Q  u' o% u8 q
    while A_i<=30 do begin+ H# p0 Q1 F* ]
        travel to pickaisle.con(A_i)
: b& r4 }5 F: ~  W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 Z( C4 ^9 ^# P, Z% c        else wait for 10 sec. w3 U2 z5 K# a
        if A_i=A_leave then send to die
7 w+ R0 z+ ^) a, u+ Y! a        else inc A_i by 1
/ p; [& ~' V1 [* A) `! ?, |    end) a3 y$ w' t8 b5 h; A9 E
end
, K" r5 a. p' T6 D* c6 t7 b$ z  i' U
其中的procindex为整形,代表当前process的序号。
* }4 M: }1 h4 y% `3 k& o4 }1 [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-5-17 07:09 , Processed in 0.017841 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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