设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14095|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 `: z' `* I* f0 y: r. L1 V" e
6 v, L1 D/ L' l0 I  E5 x我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ i/ w+ G. F, f7 y
) M+ u5 ~  U1 R) m2 F
begin P_read arriving8 k( t) q" ^  \7 J, w5 Q7 E
    while 1=1 do begin' \5 j! @9 J7 b
        read A_tote from "data.txt" with delimiter "\n"
5 s/ x% Q4 ?# k$ w+ ^% R        read A_time from "data.txt" with delimiter "\n"4 g, F/ _* B9 |: P8 E, D  D) u
        read A_leave from "data.txt" with delimiter "\n"
; o* ]# Y5 o# Q0 K. B7 L: B        read A_picks from "data.txt" with delimiter "\n"
" j( U2 e. R' B& o- j! J: ?1 y        set load type to A_tote
- K' B8 P- z+ b' q- U5 v        if A_tote="tote 1" then set A_induct to 1
* X& [8 m+ K+ N7 y! L        else if A_tote="tote 2" then set A_induct to 21 e7 A9 X+ Z8 r) R5 S
            else set A_induct to 3   
/ e" e# [1 V9 F4 W$ @3 ]9 V        set A_i to 0
/ o0 n4 ^- \* X1 E1 {' w        clone 1 load to P_induction! H2 \, r+ U$ e% P: O$ c
        wait for A_time sec
4 u. u( a* A9 I) L, R) z# Y0 Z    end! p6 C; P5 x5 f; b
end
/ T( c8 m$ X) x7 Q5 U) D/ q. Y
7 q. v) {1 }+ F. V% q1 V2 g8 pbegin P_induction arriving
1 b' j3 }+ _: {$ g7 G    if A_induct=1 then clone 1 load to P_pick1
+ A6 ~8 m2 R' f  l    else if A_induct=2 then clone 1 load to P_pick2
3 I0 I  I6 P6 O! c9 M  m! y        else clone 1 load to P_pick3
1 `; X& w- @: t8 W: [% Cend6 R5 {' m: F$ `# s

% F: L) G4 o% ^( Q4 h6 ^  C: K& ubegin P_pick1 arriving$ S7 b5 }, }- J+ h, F2 s( b4 |2 |
    set A_i to 1( d. A( Z5 A  W. V% U
    move into Q_induct1
) z# T( P1 H" R; i    move into pickaisle.induct1
. o5 n5 p% L  J+ c    while A_i<=30 do begin
; u; P- O9 n  M! A1 X- L) u        travel to pickaisle.con(A_i)
* d5 Z  d# b. o" B; W; Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: U! p' i& Y3 M, G+ r
        else wait for 10 sec( d0 K, ]( F5 r0 |, ?
        if A_i=A_leave then send to die4 @$ ]/ W3 A, v% n/ i
        else inc A_i by 1
" m: L2 K: ?+ g, S% ^2 a' J: ?    end
; A1 ?# K$ [( |end! B5 ]- T- I# I, L/ A* q/ S' n4 i
1 M2 J  ~; A/ ~0 Q& n3 r
begin P_pick2 arriving
# {9 @2 k" b8 m, K$ ^0 u    set A_i to 11
1 k8 ]2 @9 f9 X8 u$ @/ Q9 k7 N    move into Q_induct2  [8 C& h  P  |) z- c6 t  h
    move into pickaisle.induct2- J7 C1 s$ L5 T5 S) e/ i/ C/ Q$ i
    while A_i<=30 do begin; O# D8 c& @; p
        travel to pickaisle.con(A_i)
. p  `* J% s% f) Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 N7 [6 I( c+ d' ]        else wait for 10 sec6 b8 ]+ b. |0 A4 X9 L4 R) ~
        if A_i=A_leave then send to die4 }- _& f% q7 O
        else inc A_i by 1* O( k. z; L% G# M+ n' V
    end, ]3 j9 K0 k' s9 V2 ^
end
3 ~) k* j' U4 N& k8 l  [: E0 M0 o* W; K2 |! M/ s' Y( x
begin P_pick3 arriving
! X# ~* O- k+ `2 @$ \- u    set A_i to 21
8 v6 G4 I. s/ G7 p  ?2 {, |    move into Q_induct3
+ A; U3 U) E) V- B3 J' B. I    move into pickaisle.induct3% N$ R1 u; Q- v3 {: N
    while A_i<=30 do begin
4 Q9 o, ]# K# H" U- ~  a% q5 ]! d+ K1 a        travel to pickaisle.con(A_i). D$ k* B, [, F+ e* f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- X0 o$ X4 G; Y5 [6 c, E7 b        else wait for 10 sec& m. _% P# h4 W! M% J* h! U) E1 z% e
        if A_i=A_leave then send to die
' R7 b, r% a% [1 x6 \        else inc A_i by 1' N0 b- `; |, R7 a
    end$ }! K, N# Q) m
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是个什么东东?
9 I) w9 |# [: o8 q1 Y( G8 Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! g$ _- K" Z8 M7 I( A5 ~# I7 P1 \1 T9 C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 @& k# ?# @7 H9 A" V# I" D! y

: B6 v% f  r$ \7 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: w5 R, ^7 n2 ~2 o% ~+ n! ]: @& [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: F, a$ ~+ W; m7 T5 u& N' c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 d# }0 k+ W; T* Z& L7 l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& ]3 E2 F9 m+ K; x# R5 G$ K: _0 Jbegin P_induction arriving
: Z/ |9 T! ^* Z$ d2 }% E2 |    clone 1 load to P_pick(A_induct). q1 [: F. U, P/ ]7 _/ n
end最大的系. i" M2 m" N: ?) q
2 l5 \$ O; h; ?8 ]9 M7 y. q7 E2 U  E
begin P_pick arriving6 |+ N' \2 |  b/ L& q8 b7 O
    set A_i to procindex * 10 + 1
  V! [* Z- S9 _7 l7 n    move into Q_induct(procindex)4 Y! e3 F  m- s
    move into pickaisle.induct(procindex)% w/ \& }2 h* _, Y8 p! ^' D' X6 M
    /*check the type of pickaisle.induct(i), for your last problem.*/
% C2 o6 X8 ]7 Z  L% o  r5 i, r6 e1 p( l. w( E
    while A_i<=30 do begin! O# x) l0 }6 P! `2 ~2 ~
        travel to pickaisle.con(A_i)
1 k8 _6 E8 A5 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 g. v$ c8 G& Y. v) {$ O
        else wait for 10 sec  w! r$ {8 D4 g% @8 Z
        if A_i=A_leave then send to die
  B% n& y3 C4 n        else inc A_i by 1
$ S0 P6 q8 S  H% {4 S, G' f$ U    end9 j6 G( Q0 X8 R) ~1 s
end0 i, w" N9 n2 T( d  A
8 s' Z# o# }+ b0 d) \) a- j
其中的procindex为整形,代表当前process的序号。
5 ^9 D: M* o- s9 H( Xstation和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-8 10:19 , Processed in 0.017481 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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