设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13132|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ z9 J- P  v  K& S( r
. U* L- c5 J( x% 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中的数值,不知道会不会有什么不妥。
& u; a( F  C- @* Z* n$ H& N9 e  j- x% L9 @
begin P_read arriving" M% C* z9 @. ^" X( H" b
    while 1=1 do begin
' m. G, q  e' C; x6 V        read A_tote from "data.txt" with delimiter "\n". X, R3 @7 k8 J. J$ I* I
        read A_time from "data.txt" with delimiter "\n"/ `4 h+ f; f+ ^
        read A_leave from "data.txt" with delimiter "\n"" D" C6 _: W8 @) K2 d' `) C
        read A_picks from "data.txt" with delimiter "\n"6 ^2 p9 x/ r1 N
        set load type to A_tote
& y( ^5 h* r' Q' _  k        if A_tote="tote 1" then set A_induct to 1' r5 s6 N1 ^# t8 o8 R7 M
        else if A_tote="tote 2" then set A_induct to 25 S4 V) b' `+ }$ q8 \8 i4 I2 }0 A& Y% N
            else set A_induct to 3   
: H% [# j$ ~+ h. N2 t9 p* i- w7 h        set A_i to 09 `7 {* A- J/ m% S5 \
        clone 1 load to P_induction# o+ ^, ?8 b" t) t' ?+ r
        wait for A_time sec) L) L5 L3 @' Y$ `& b6 \
    end
9 J1 X- N) ?$ K8 h" B" o6 Z. Lend( I+ u& H4 ^' Q9 P2 X4 ]
3 ]7 `9 V% o/ V: [; A; H2 a
begin P_induction arriving
2 H% S+ u5 X0 K6 a7 S    if A_induct=1 then clone 1 load to P_pick1/ a) R6 T7 g0 h& n4 a3 p3 {  a3 I
    else if A_induct=2 then clone 1 load to P_pick2
( L" q! N3 P" i( ?& B0 ?9 e9 a3 H        else clone 1 load to P_pick3
+ ^3 n/ l. b6 I. O- S3 rend+ n7 v! q. Q6 A" y7 @; h  M  D
, E) x* L  k6 i! b: s3 J
begin P_pick1 arriving
- D' c  ~: E: u: J, p. P    set A_i to 1
$ H) v9 ]: e3 h* V! Y% K0 @! Y3 t    move into Q_induct1! Q- V9 P" n% }
    move into pickaisle.induct1  a0 d, P0 X6 K% n6 K
    while A_i<=30 do begin
, ~6 Z; B# E) V7 W1 o0 M# f        travel to pickaisle.con(A_i)7 P1 J% }6 P* v3 j8 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ u! x  c* `; U9 ^        else wait for 10 sec' S! f5 W# T. M' k+ A2 p/ b/ O* x
        if A_i=A_leave then send to die0 N) C% s! Y1 Z# P6 Q: r
        else inc A_i by 1
* F3 n( n! P# X% ~. S/ y    end4 b9 |, y0 M6 K; w
end
& c4 }7 o5 r$ _: n8 v) {. G
4 D( A/ U1 Q* y; X( T& b" C. sbegin P_pick2 arriving+ p3 O/ z' m  y  ]
    set A_i to 11/ b7 A+ E9 a/ c+ S- Y! L
    move into Q_induct2
8 F% s. g$ B3 g    move into pickaisle.induct24 P0 x7 A+ `8 J7 f" [
    while A_i<=30 do begin
6 B1 D" E3 d' |9 ?5 N- \$ _        travel to pickaisle.con(A_i)
' }- V* a. z5 {) U) M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ d0 J% g; h; [% w: q/ d        else wait for 10 sec+ b/ W! Z' b; I! c! I  N% C: s
        if A_i=A_leave then send to die5 w3 C2 I, T7 v5 A1 p) n6 B; M* @0 \3 ^
        else inc A_i by 1
, F, }9 j. J/ v6 ^7 A0 V. |& w    end" T0 a9 O! ^) _# s$ \+ X* I
end: Q- g9 M$ E: W& C4 q2 w( J' T, ~
+ a. V+ T3 x( r$ c9 \  x
begin P_pick3 arriving
; n3 R& T( t6 E: E% L  c    set A_i to 21
8 M4 S& c1 B! }8 ~    move into Q_induct3
; p2 x# H$ }7 g1 h    move into pickaisle.induct3( V; q( i, L9 H4 u, b( B
    while A_i<=30 do begin
+ V0 @! ?0 @7 i: R" d* G        travel to pickaisle.con(A_i)
* Y% k  ?/ x  q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 w* {" f9 z' d        else wait for 10 sec
+ o' V2 ~" Y6 l3 j6 }) i; h        if A_i=A_leave then send to die
. f6 h2 Z: X; ^        else inc A_i by 18 Y" R" `5 l9 N& {0 q
    end
+ P, K3 G3 e: w0 ^8 j% T% T; `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是个什么东东?6 o& O' e( k: S- s" O& K2 f+ Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 u! x! G6 r2 ]" ^) C7 S/ ^
0 I, I; F' P: C( G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 T0 t/ {! [3 D  b; e

# Z% \0 |1 x: T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' b( j4 p# p0 I3 {2 b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& X  D- r  i' F' S% l5 ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; k+ L( z& ?7 z3 N  L6 Z# h% ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 p3 {/ t+ l: W8 i2 A
begin P_induction arriving
2 n, B. ?& _" E2 C1 }' s3 ?; Z9 e    clone 1 load to P_pick(A_induct)
" c" ?/ @4 i1 S4 ~* A4 i( _7 I% aend最大的系: C8 _# r# ^0 E

% d7 A$ T6 Z1 j# r( hbegin P_pick arriving
: h2 n: L0 V1 m" t    set A_i to procindex * 10 + 1
0 t, K, ?3 N8 n' q* X3 W, ]0 _* U8 ^    move into Q_induct(procindex)
! h" p% r& h; j* h2 {. V- ^9 o2 I    move into pickaisle.induct(procindex)' H4 R( D# v) q
    /*check the type of pickaisle.induct(i), for your last problem.*/! q1 ]3 T" u5 D1 L- _

" O7 l. v4 z) h, T6 `    while A_i<=30 do begin$ w% x9 B6 ^- x6 P. _7 v- F
        travel to pickaisle.con(A_i)
2 f3 O$ r9 G; @1 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 d: o$ M% G4 Q3 Z( S
        else wait for 10 sec
* C( P4 w& A3 u  o* x0 O        if A_i=A_leave then send to die* C$ a  }! M3 p
        else inc A_i by 11 z! [, ~, o- ]! I/ A) g: \, L8 G
    end( t7 G5 L& g7 W) `
end
  J4 j7 `, K0 G: f3 O: U6 n' ]2 p  x0 W
其中的procindex为整形,代表当前process的序号。# r' X  w5 V. y+ [! v5 _- C
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-3-21 08:40 , Processed in 0.015355 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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