设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11809|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 C$ A7 H& s( i4 `  q
- }7 `$ A5 K8 {& H9 d我的问题是,在每个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中的数值,不知道会不会有什么不妥。" n6 f3 \# |* ]* d6 t' T
0 X$ T' p/ G) d. w& a5 K
begin P_read arriving
. h( |# r5 h) g" \0 T6 n$ n3 e    while 1=1 do begin
% i- l; b0 {  k        read A_tote from "data.txt" with delimiter "\n"
+ Q8 T. ?( j& _8 ^# h- Q        read A_time from "data.txt" with delimiter "\n"
& Q. f/ s& k( h  H0 X# i" |        read A_leave from "data.txt" with delimiter "\n"2 B! B0 \& B6 V* I. M7 A
        read A_picks from "data.txt" with delimiter "\n"
% {( s0 e# D& a* {0 h( n6 Y        set load type to A_tote
0 `/ v% k; u# ]( X8 J        if A_tote="tote 1" then set A_induct to 1
' n) m. I  ^) Q0 c: ~" W        else if A_tote="tote 2" then set A_induct to 2
! U+ I  F0 s& n6 l, B7 t# j/ Y3 A            else set A_induct to 3   
& B3 _( {0 {+ G# H  ]" F" Z1 O, [        set A_i to 02 Q, D" e, X! h) ~" A" E8 P( s
        clone 1 load to P_induction+ i8 f' b  z& D0 N2 G9 U
        wait for A_time sec
1 O1 t  Y3 b; h- l8 E7 F0 D    end
/ z$ F2 E$ |6 K4 W1 W7 eend
1 l4 j, z& J( W
  X; {& X0 K, X6 r9 S8 L" p  Ubegin P_induction arriving
. i# I" F; l. k. _& s    if A_induct=1 then clone 1 load to P_pick1
6 C$ b: k' w" y2 d    else if A_induct=2 then clone 1 load to P_pick2
. a+ n! K2 ~$ @9 W) C2 J        else clone 1 load to P_pick3* H" D" ~* h! ~% r
end9 x( Q* O" u# f, \- R7 h0 Q
3 z9 I9 k3 M9 ?/ L8 p" l$ w& J
begin P_pick1 arriving0 X+ w2 g3 ]6 c* O8 W& z- ~( I
    set A_i to 1
+ O1 ]! d% H( N# ?% ~    move into Q_induct1
. p4 Z# ]& Z1 ^. ?# a    move into pickaisle.induct1
# b; Y; u/ o" t4 i1 d3 L    while A_i<=30 do begin2 i- b, a1 o$ P) G+ u7 }
        travel to pickaisle.con(A_i)
+ O: r' |2 \0 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" J9 A5 T  H4 K/ s9 E
        else wait for 10 sec' }% c# f4 |5 V/ o% y* g5 ^) Y
        if A_i=A_leave then send to die: U' x  c4 N. E2 c5 T# R* o8 g- u
        else inc A_i by 1* O3 ^1 s; ~7 a( X) C( Y1 @/ E+ n
    end( G; q' G7 ~7 [2 G+ ]8 y
end* d! c; _3 ^1 M" ^; @
& \1 b5 D* B- g3 ~
begin P_pick2 arriving& h/ O; `( B7 C/ Z! _5 c
    set A_i to 11* @% J" |( a% u. ^7 ?; x( m/ W
    move into Q_induct2
. W* a- b9 ~; J3 d! v: f/ _    move into pickaisle.induct2+ Q# Z! \, c) f) B4 c
    while A_i<=30 do begin
& x( ^- N- _% a9 U% P) F        travel to pickaisle.con(A_i)
; f/ s; {9 L- v- G' M8 a$ a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, _9 c5 A$ G3 T& Y        else wait for 10 sec
7 P/ R/ H! S8 L6 a        if A_i=A_leave then send to die
2 P- |3 C# h7 W5 b$ }$ f0 z* n& y8 h        else inc A_i by 1- o- k0 r8 Q  A6 ]1 K8 l7 |6 j# }
    end
, V) o- j1 n2 @end% Q1 d( X2 w% z3 x
- J% k( |0 U& u9 M1 a; w
begin P_pick3 arriving% q. Z; E: H6 I! D* y. ^- I
    set A_i to 21
! i+ s# r; I' i; d    move into Q_induct3
7 G; @5 i3 e' E% L7 G: U- k    move into pickaisle.induct3
, Y4 q3 N: i( T: @5 p  t    while A_i<=30 do begin
! E" Z( J9 |: Y9 o. x        travel to pickaisle.con(A_i)
) \) L& X# J0 N9 z! ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 G$ k' W# l& m- q; C+ N* j; k
        else wait for 10 sec
. D4 j5 f* q$ M9 o1 G9 m        if A_i=A_leave then send to die' y1 {( p- G5 p, B2 c
        else inc A_i by 1* f1 E1 [. e5 W9 y9 u/ C3 }
    end
( ]7 ]" P( T" H1 Xend

最佳答案

查看完整内容

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是个什么东东?
- d- U% a7 C8 ], C2 n0 P6 emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ E% z0 W6 ~& G  n" q
, ?. f/ q, x; t* u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 z2 W! f5 c! N: O
6 B, F- W' @' w9 `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* o* l) u/ f. R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 k# a8 l( S  ~: X' Z# D/ S& T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 |, E8 \- e& F% q% W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" F5 y/ z; O" }begin P_induction arriving! K9 Q& Y3 A& |3 c6 A% Z* g8 O9 i- R
    clone 1 load to P_pick(A_induct)
' z4 R3 N# O6 _& w2 {6 h( V8 |end最大的系% r1 l# z6 x% h

! I0 g3 \' N0 s/ a- l6 ^begin P_pick arriving
' w" J: ]) `. P) V3 ]2 ^    set A_i to procindex * 10 + 1
; a- q3 a2 [( Y# X( [    move into Q_induct(procindex)3 n& D' e7 n" u& ?5 T) b
    move into pickaisle.induct(procindex)+ x7 v6 s* R3 O: C5 s
    /*check the type of pickaisle.induct(i), for your last problem.*/( N# n$ x, K8 ^$ q: R# m

- L6 Y* B* [( @# C2 n3 o! C    while A_i<=30 do begin* @8 I' d9 e4 ?: J  m  `" U* G" X
        travel to pickaisle.con(A_i)2 i9 K7 e) w9 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 V8 Q* d+ O: X8 w0 |
        else wait for 10 sec* @7 N. l. |  D3 S0 v# O% R
        if A_i=A_leave then send to die3 D* w9 T# A* @0 T0 q! c
        else inc A_i by 1
7 h8 b% |% s5 p- n# D# ^    end
+ o0 B0 g8 ?3 B: Dend7 {# K6 m2 F! C9 d+ Q
5 Q% W3 j! K! v0 \! l
其中的procindex为整形,代表当前process的序号。# _7 @& O# A* c% m9 w
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, 2025-12-7 07:16 , Processed in 0.013846 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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