设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11649|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& f7 v( D: N% ?7 ]2 O; F* D" m

8 a0 h7 J) T( i# W. z+ r2 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中的数值,不知道会不会有什么不妥。: z5 t1 U- Z. ^

9 C7 Z6 F" c# O$ O" X. c. Lbegin P_read arriving
( `, R( e' D! Y% b    while 1=1 do begin
# _3 |* f5 N  G" Q; s0 n        read A_tote from "data.txt" with delimiter "\n"
) V5 }" Z( E* ^& \        read A_time from "data.txt" with delimiter "\n"
0 Y$ e# r3 M* c" t; Q* m, m        read A_leave from "data.txt" with delimiter "\n"
, {- O- R* i2 B        read A_picks from "data.txt" with delimiter "\n"
3 ?& t( R- p8 N        set load type to A_tote: s% u. I% {6 R: t
        if A_tote="tote 1" then set A_induct to 1
+ i2 `( K0 \3 @2 ~        else if A_tote="tote 2" then set A_induct to 28 K6 ]& G# W( b( B2 m' F- B, e
            else set A_induct to 3   
+ m1 J. e) E* l. Y2 R        set A_i to 0( B( f$ p. A* a+ G3 n$ ]
        clone 1 load to P_induction
- R) I8 A3 P" R6 j# p        wait for A_time sec6 ^* }6 I- \0 d# ~# {
    end
7 P% B& ^# i$ M& M0 Zend3 O$ v2 e' B( ]5 Z6 a
8 y' c* R3 x4 y( ~1 K& c2 E
begin P_induction arriving* t4 B! o( x/ M1 v' U# j
    if A_induct=1 then clone 1 load to P_pick1
* h# Q+ y' h$ T0 b& }9 {1 `3 _    else if A_induct=2 then clone 1 load to P_pick2
5 ~6 Z1 f4 x4 p, r5 y" |" j. U1 `% @        else clone 1 load to P_pick3
' G7 J4 O: E$ Q# G4 \4 \end. ]& Q+ c/ C) x6 p1 k  O

7 i; H; r! R% b& Gbegin P_pick1 arriving1 m0 h' s" B0 ~
    set A_i to 11 |7 ^' N( ~" R- M1 n
    move into Q_induct1/ U" K  ^7 i0 ~& I' f) J) W0 O! s; q
    move into pickaisle.induct15 m- J6 T5 z2 ?1 S; e6 ^1 W
    while A_i<=30 do begin
3 w- ]! e% T$ F$ W0 S# Y+ y        travel to pickaisle.con(A_i)
) }: e* l, R1 l3 s; k1 }+ ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: J# w1 F, s- @" P6 d# H
        else wait for 10 sec( E4 W1 h  V9 z4 l% b1 ~
        if A_i=A_leave then send to die: _- T$ H% t. A. [' ^9 M
        else inc A_i by 1
& k. m5 M. U. r; N5 I) {    end
4 p6 s1 B  C: }end
, D- B1 K) L5 x# k$ \4 x" I( K. }8 Z% Z7 p4 h+ {' ?* P
begin P_pick2 arriving1 q. D- G5 a# i
    set A_i to 11' w  ]$ \0 ^" V- i, ^/ r) q# f
    move into Q_induct2
$ p3 ~8 l3 M3 U7 P0 s    move into pickaisle.induct2& q. N# L5 }: X0 q4 Q: h6 q& T
    while A_i<=30 do begin/ Y8 y& \. a4 p% U% H% Y
        travel to pickaisle.con(A_i), ]9 N2 e. g/ ?! N# y7 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ g) z9 m& s, R" ^9 y( U. r+ C. q+ [
        else wait for 10 sec4 {* z) h+ s* ^/ d
        if A_i=A_leave then send to die" i4 Q* m5 S. c
        else inc A_i by 1# i+ ^0 E9 H9 w& e) s( d3 e
    end; y4 l. l; N* @! Y3 @- \4 d8 y
end
1 s0 C# E. B- b0 d+ E
3 j% ~; g- O) i5 Z" g1 Lbegin P_pick3 arriving
; y- g' h. F+ a- Z) F8 y5 Q    set A_i to 21
$ S  A+ |% x1 A/ O! s& K    move into Q_induct3
3 a( P% R% `2 t, X' ]; \    move into pickaisle.induct3
/ L1 l- R% c0 ]* ~  e0 q    while A_i<=30 do begin
# y. ?  b# u2 b( m! k) b+ E        travel to pickaisle.con(A_i)
0 g3 a! @: i8 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 q( j  T  M$ s* e        else wait for 10 sec) f: w' e% o1 M' Z' n5 l6 p+ c
        if A_i=A_leave then send to die3 u7 O& D' T: S, k
        else inc A_i by 1
' H) ~0 r) X3 [: L  w; |4 n    end6 M) f, d$ M# |! ^" 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是个什么东东?4 Y  T) ^4 M1 B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ u/ p; ]5 ^! W5 a" T7 @; b% n: S0 C" R9 X, x% T/ N
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& r0 w+ h. N( l& m( u: W  `; E& I/ h$ c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 _3 c$ q/ x7 B' A* D; [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 p! Y, w4 ^, e) x' b, e* Y3 t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ e6 g: E% ?4 F: M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# m8 y) e% Z6 C  Y5 E% \0 mbegin P_induction arriving
' w: a- \8 \, J* x. G. u: }    clone 1 load to P_pick(A_induct); P& t* `- V( c0 I$ w6 U: e
end最大的系
% i; u% F1 n8 c. C3 O+ t# }* q# ]! G2 q9 z- G
begin P_pick arriving% F2 g' M4 K- s: v* D. B5 X
    set A_i to procindex * 10 + 1* _! f! i$ W0 W% P1 u' m! ]! b
    move into Q_induct(procindex)
6 Y, [; l8 o4 F    move into pickaisle.induct(procindex)
% g& T, `* \1 c$ K* M    /*check the type of pickaisle.induct(i), for your last problem.*/; f* A$ u! q4 L& E

* L& F3 S% C7 f    while A_i<=30 do begin$ q$ k& F1 n' `- a- P/ E
        travel to pickaisle.con(A_i)& K0 {# A6 S( c" C' _. {7 Z9 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 L. A6 K& z6 S# g" @$ i
        else wait for 10 sec
" v2 E8 T* L+ g1 r; v        if A_i=A_leave then send to die' G3 p* O* F" u  P; ?9 F
        else inc A_i by 16 Z  f! `; w. W4 L, B7 B# b' w
    end& y5 B) z4 M8 }, v6 ^: I2 ^" D) c/ ^6 P
end
. q& ]6 ^$ I( [' }8 K) u7 t0 A( i5 l5 I, Q- M& Y
其中的procindex为整形,代表当前process的序号。
' }7 q* Y. ~$ N' b. t. p% z6 estation和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, 2025-11-25 18:41 , Processed in 0.020242 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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