设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11828|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 F1 ~* o- @! L1 ?5 h. ]
9 W2 Q7 k2 n) b( u2 Y; I' B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) Q2 d/ J& D( d, m. K/ K
+ x5 m. N8 r" Y( l4 obegin P_read arriving
8 L% }/ [9 u+ V$ z$ O% _/ e. `: _( R    while 1=1 do begin
* _" ]/ J4 Q/ D* M        read A_tote from "data.txt" with delimiter "\n"
% z7 l+ b2 i$ e5 z; S5 c& [* }        read A_time from "data.txt" with delimiter "\n"' P: {& V6 `, t. F
        read A_leave from "data.txt" with delimiter "\n"8 B" M8 h( a. L  l+ k
        read A_picks from "data.txt" with delimiter "\n"' z  m- [- P2 Q2 @) P* U0 r
        set load type to A_tote7 ~) U9 o& h' B9 a; C
        if A_tote="tote 1" then set A_induct to 1
3 B. @7 O. Y6 o# A# I        else if A_tote="tote 2" then set A_induct to 2
' g2 u, b6 e) S            else set A_induct to 3    6 c4 I; Y; ?. }. a; X; ?; t; d
        set A_i to 0
+ p' ]: q3 A$ F" R* f        clone 1 load to P_induction
! u3 e4 Z' B" j3 H8 C7 W6 K* X5 Y        wait for A_time sec% \5 W: r8 e0 z+ a5 O8 S9 N
    end
* c1 x8 ]% u9 k9 Tend
6 p. E: m! S" t  D( V% t. w! `4 H) ~) l! P+ n6 ~# G# C# T
begin P_induction arriving" }  F# W* B) w) u) w) k9 Q) v
    if A_induct=1 then clone 1 load to P_pick19 {+ p; v! G3 [3 P* O* C( d
    else if A_induct=2 then clone 1 load to P_pick2
8 `' j; Q+ ^6 ]3 Y3 D! i9 g& k        else clone 1 load to P_pick3
2 p3 _3 [: W& T  t; Yend5 D' ]/ {& K! f3 O" \

' x, N9 V" ]9 P7 z3 |begin P_pick1 arriving
4 _* n% l# E/ [, t, p    set A_i to 1! Q0 C2 I" U. L: ~& ]  l5 c* G
    move into Q_induct1$ D$ a7 D6 P: G: P
    move into pickaisle.induct1
5 |, l# A8 E2 D5 ]. M" V8 f5 m    while A_i<=30 do begin
, a; O) S+ I, M" u7 |3 j        travel to pickaisle.con(A_i)5 z5 p) Q. [$ H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. ^6 G) c# C* L* ~  z8 [% {0 g
        else wait for 10 sec
* g$ D) f8 c4 J& O  i7 m        if A_i=A_leave then send to die& I; Y8 C% y8 J! R' p4 N
        else inc A_i by 1" U( v* }! q: K, r% Q( P
    end% f8 h+ m& n! x% A) Z
end
$ @0 X; q* f0 k9 e
, P3 Z$ D5 A  u2 X; ]begin P_pick2 arriving
8 s8 C4 o; r& B    set A_i to 11
, a( q' s2 H, j  V( @$ Q( F# |' T    move into Q_induct22 ?( I5 y- D; n( p3 N% u1 ?
    move into pickaisle.induct2/ [8 v) `( k5 L  w; h
    while A_i<=30 do begin0 A8 M8 ]: E* B8 @
        travel to pickaisle.con(A_i)3 ?1 i- V2 }% c: v0 X) I4 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 m' W* ^8 x1 `. c( K3 [( q        else wait for 10 sec
0 j- \/ h! ~* K) a        if A_i=A_leave then send to die
5 o6 |7 t0 t+ z! {) k4 {        else inc A_i by 1
- S! |! Z% n% ?5 K    end
# C+ i! l/ B% H* Yend1 n5 d! i+ m/ v. {" \

/ D: C3 @, D8 d1 _begin P_pick3 arriving; b+ r" W/ ?8 ^& h, o
    set A_i to 21
) d" v! \( v: a& R    move into Q_induct3* T; a! F$ N: X3 j
    move into pickaisle.induct3
  x* R- M% q& B' G$ ~. x    while A_i<=30 do begin
& V1 Y; }; H7 Y# A3 U8 `        travel to pickaisle.con(A_i)6 g# u- ]# X( O4 c! Y2 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! f2 h2 _/ c# U" `* n# K
        else wait for 10 sec. w8 H$ M, N( C8 @" q0 P5 F
        if A_i=A_leave then send to die
7 t3 w2 {- Q$ V2 q  o- w        else inc A_i by 1
/ w. Y& p- Q6 ?1 u3 v8 x    end
+ h# [* x/ \( l! Iend

最佳答案

查看完整内容

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是个什么东东?
9 n' E' h8 F2 Wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" C  ]! l7 T% y- u/ a
2 e/ l. _0 ^- d1 t( V" O* g* sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( k; O! H5 ], @5 S2 o5 E+ |" L! F
7 `( j0 V, ^" t
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( g" T$ L( t% K$ y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( G+ v7 X" g5 J5 |4 o2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" F( z7 A/ \' o+ z' ]1 }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. }4 z' w% T% o/ v
begin P_induction arriving
: x1 c4 ?& \6 }) ^7 V# Q0 G# r    clone 1 load to P_pick(A_induct)
. |( ?4 n1 h4 C7 K2 R& ?end最大的系
+ N1 W3 c# t- r0 _
: B' f* M' P& m1 _begin P_pick arriving, p& M; o8 i$ y! J. k- R1 U7 ]1 u
    set A_i to procindex * 10 + 13 z" L- r9 I7 X% i/ @' \
    move into Q_induct(procindex)
& u/ X3 B# s4 j/ G" K/ T. j    move into pickaisle.induct(procindex)
* t5 S8 c, w) T    /*check the type of pickaisle.induct(i), for your last problem.*/
& Q' k" o3 x9 f( _! D+ H) J6 `# U; Y! o/ o5 b
    while A_i<=30 do begin3 c2 v2 N9 c; q5 w6 g  k9 h
        travel to pickaisle.con(A_i)" {- F/ ]# J* \1 o7 P. j+ V8 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 v7 ~7 R4 Y/ A- }! j
        else wait for 10 sec
! l) h- J+ X; s3 K        if A_i=A_leave then send to die
0 }0 a0 _2 k. o" ^# A        else inc A_i by 1
# [8 d( u8 `: Y# o  g4 Z    end2 {6 p% a1 t  b8 N
end( P. G) S2 q# D; `2 S

' x$ J( R9 f, x2 z1 l- H+ `其中的procindex为整形,代表当前process的序号。
0 Y6 L( M# w. j2 y' n5 Dstation和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-12-8 13:26 , Processed in 0.016431 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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