设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14026|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ Z9 d9 r% m0 b! j( t
* G/ r# O# ?7 Q! O! d+ z# d# S  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中的数值,不知道会不会有什么不妥。
! q1 F0 ~' p3 c" Z7 j8 S
* m0 _7 L2 \" E/ p. obegin P_read arriving
( T7 ~3 P5 u/ {# A! P4 B+ @    while 1=1 do begin( l- P+ _2 F7 a! h5 |* M
        read A_tote from "data.txt" with delimiter "\n"
5 _  Z9 j- U7 \+ |        read A_time from "data.txt" with delimiter "\n"* o9 t. C, N* G: `
        read A_leave from "data.txt" with delimiter "\n"4 R8 [" b1 t  a  j' _- M
        read A_picks from "data.txt" with delimiter "\n"
$ S2 P9 ~2 S; `' |        set load type to A_tote
. k- b" m8 w6 Q' n        if A_tote="tote 1" then set A_induct to 1
% q$ }: [. m" a6 c7 J9 ?- R        else if A_tote="tote 2" then set A_induct to 20 f7 F% T/ F+ p) t
            else set A_induct to 3   
$ P/ W5 }$ X. w6 o0 a9 O( p        set A_i to 0+ a7 Y8 ^8 b- k* O# \2 @
        clone 1 load to P_induction2 e$ t% G: s; |+ J# Q
        wait for A_time sec/ `5 L1 u$ m( I2 j1 Q5 k2 L
    end
0 c% X" Z4 B8 R3 J! n. x. wend' X6 L1 f% W9 c$ }/ K! P
5 J1 W3 e7 X" U- a" U/ E! p
begin P_induction arriving
2 h6 S0 K0 O# d2 X6 t    if A_induct=1 then clone 1 load to P_pick1! Q9 a; y, j: U3 Z
    else if A_induct=2 then clone 1 load to P_pick2% v0 g% ]3 r/ b& ?; C  s
        else clone 1 load to P_pick3
$ t+ |: c" p& m6 Q, `3 Eend7 q+ ?$ N4 ~* f; E6 v: ^; ?0 m+ u" \. x
# S2 |/ ~, |5 Y& c3 C; S; ^
begin P_pick1 arriving3 o* D8 ^* X( D' l( l5 J
    set A_i to 1/ w! I3 J* I. Q9 q
    move into Q_induct1
% K1 G! s9 K) ]+ V" I, N1 d3 H    move into pickaisle.induct17 t3 k1 c# X  p$ \/ n# M% J# \
    while A_i<=30 do begin
8 K5 w) n4 r7 f        travel to pickaisle.con(A_i)$ L# k. |( O8 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 M2 p3 {# j$ L4 w: {        else wait for 10 sec
4 f% H" \$ L; n. g8 Y3 X        if A_i=A_leave then send to die
% I0 T, ?" E  \- x4 x) ~        else inc A_i by 1* B$ M: W' P* f, m" K9 P
    end5 M" A/ o" r& c  t/ X8 p8 Z: _
end
6 t1 F' W% d+ f# h+ }3 I' h  }+ Y) N1 W/ [9 V
begin P_pick2 arriving: b8 T* `* X: H, [! b( C
    set A_i to 113 m5 A( c# U& Y/ c9 |9 \
    move into Q_induct22 ^4 q+ B; [1 {, e: m& `3 q, S" \
    move into pickaisle.induct2
' w2 W( e8 n. d2 h" y3 x: L* m    while A_i<=30 do begin
( F, Z' a9 ~, s. Q! @' M2 L% _        travel to pickaisle.con(A_i)
" z( P2 M/ P9 p, K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 v  p7 |5 m5 d8 X8 G  L        else wait for 10 sec
) V" f8 D3 Q5 b3 W        if A_i=A_leave then send to die2 |" @# I- ?- O, K5 z5 A
        else inc A_i by 19 ?! G4 }3 h- w  `+ T! C( @6 x  g
    end0 _# g( m) E, f$ ?  V
end0 k5 ^% z7 {) i

! Z9 a8 J; \2 q4 _2 n, g) M. u3 wbegin P_pick3 arriving+ P2 N9 G/ o# e+ A
    set A_i to 213 ]( K9 V9 ]# M7 o7 ?7 P; X
    move into Q_induct3
) ]0 j* T& K8 A5 V1 a2 d" O: H  S. b    move into pickaisle.induct3
4 n' c/ Z  p5 s! f' f3 S) C    while A_i<=30 do begin0 X) f/ @9 G7 B( k2 n
        travel to pickaisle.con(A_i)
, q7 Z9 `0 d; Y% R* f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 m& o5 W% ?; y( l1 \# c+ @( o
        else wait for 10 sec7 e" J2 I9 K4 [  X9 `6 R
        if A_i=A_leave then send to die
: C6 ~$ v) Y7 A        else inc A_i by 1% p# p% n' t/ |# {* }4 ?
    end
' S6 N( d. n  E6 a% send

最佳答案

查看完整内容

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是个什么东东?# T7 v4 \' v* O* D8 R- x6 e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ M$ ~9 h. V5 B. k( s. i
3 o; O( @( N4 X1 x: ~/ Z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 {1 n( b: z# z/ w3 \
; l% C* T) p( p, ~& ^) U( ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% T1 B0 ?& h4 n! P( O! N  C( B9 Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 Z( x2 A! d+ L- W6 c1 K# `2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 ^2 Y8 W7 w/ @0 n, ?5 S' [9 K  Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 g; d- x" G: cbegin P_induction arriving5 g. h9 `' \3 B2 w1 z; N: v1 P  Z
    clone 1 load to P_pick(A_induct)  c/ p- n8 Q: |2 W( i2 [
end最大的系  P) Q# H7 a0 i8 d! t* S1 ?8 C
) n, B0 ]5 N! c: _% o
begin P_pick arriving
" z; C" R5 Q: |) M; r% h. O    set A_i to procindex * 10 + 1
: ^/ F, d$ C+ h8 T* p+ c  G    move into Q_induct(procindex)5 I* i8 n/ A3 Y  ]8 V, I
    move into pickaisle.induct(procindex)
- N1 @' ^* H/ \* C# I/ l$ w    /*check the type of pickaisle.induct(i), for your last problem.*/) r: d4 s- r# m7 x+ l
& S! {1 F- u5 i; {& d: N9 p
    while A_i<=30 do begin" ^$ C* K8 M+ ^9 g1 N- x1 y
        travel to pickaisle.con(A_i)- I0 [* d7 D; K/ Z& Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 A8 j7 c+ {7 a; H) P: ?        else wait for 10 sec5 d( _1 o& |, c
        if A_i=A_leave then send to die9 C4 d; K- f$ d  u" f5 k
        else inc A_i by 1# R" F$ ]. c" I4 e: T
    end" v/ ?% z" x% C
end
: m6 _* t0 E3 ]
* E1 S0 L) B5 }% `其中的procindex为整形,代表当前process的序号。0 ^" Q3 l6 [4 z, k/ V5 U
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-1 07:59 , Processed in 0.016772 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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