设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13417|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ Q% v" Q" X9 {  ^' Q4 c1 }
+ ^$ i$ n! @* I; o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 j# Q; C' D( t* t3 T0 W# k) E2 Y2 q) |  ]
begin P_read arriving" Y& K" G0 L" _1 h; Y
    while 1=1 do begin1 O! u9 |6 [# k5 b! ^3 K
        read A_tote from "data.txt" with delimiter "\n": _2 i& i- ?$ {6 T$ {* a- X, i
        read A_time from "data.txt" with delimiter "\n"
( x  i) z' ], W' ^        read A_leave from "data.txt" with delimiter "\n"
, S4 X/ ~3 p4 v5 b( r        read A_picks from "data.txt" with delimiter "\n"/ x, u: ^6 P$ o7 X
        set load type to A_tote7 m+ G3 d/ Y% {
        if A_tote="tote 1" then set A_induct to 1* h, U; m3 R8 r
        else if A_tote="tote 2" then set A_induct to 2
6 ^9 j* V0 B9 H3 m4 w            else set A_induct to 3    & D7 r/ x9 \$ ?: y9 {# G9 l
        set A_i to 0
+ A( g+ `( p; t9 z; v        clone 1 load to P_induction9 ?$ q2 h% T* T6 c0 A# ~0 [
        wait for A_time sec+ G, f' W) Y4 m) K* U. x1 s1 G
    end* q4 Y3 q$ M" i6 V; ?
end
. n# ^$ y' |. T# o) {+ u1 K6 W! ?. ]
begin P_induction arriving
  V2 F) ~0 l. K" Q8 d    if A_induct=1 then clone 1 load to P_pick1
5 N& O" H" N0 M  T    else if A_induct=2 then clone 1 load to P_pick2! \( T2 N% N; |: Q! j& G+ H4 t
        else clone 1 load to P_pick39 ^; p3 {0 ^5 X: M% {2 d4 E
end
) j# b: ]4 d5 t5 H; w  C- a
2 T1 L& i7 a) C& O" W! }begin P_pick1 arriving
( V: ~8 i' n0 g9 Z' Q    set A_i to 1
- E! u, R0 f4 `/ l( J. X3 e    move into Q_induct1" m) i2 z3 J$ i% F" M" @
    move into pickaisle.induct1& y6 q4 @9 ^/ j+ s1 d  t
    while A_i<=30 do begin
) U. O7 b- |! k* k6 M' T0 U        travel to pickaisle.con(A_i)- M7 R& c9 S" ^$ d, Z5 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) F8 b  e. C+ I3 e+ e& ~  C
        else wait for 10 sec
. a4 X. f3 _. l# Q' B5 M        if A_i=A_leave then send to die
* N  D- b2 ]( ?3 Q1 x: j+ ~$ e        else inc A_i by 1
4 e3 X4 w4 w6 @    end9 R; z8 ?; c; s3 F
end  p' k" F% C! [7 Q% I: k+ r

7 D& Z6 r4 N" {begin P_pick2 arriving% N1 {. p) H) i" ~) b# \
    set A_i to 11% |4 U3 t8 w  i" @+ k. p
    move into Q_induct2$ q. `0 H5 m& V4 Q$ r' u. g
    move into pickaisle.induct2$ ?; v; M% \) a: D) X' t( b
    while A_i<=30 do begin
4 J3 {6 J3 i3 Z* O" V        travel to pickaisle.con(A_i)) a+ X- v% N6 d& N' J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 J  H4 g6 [0 ?        else wait for 10 sec
  M' G# _4 A2 D2 S7 a2 d- ]        if A_i=A_leave then send to die% {$ k* G. _' n( w( \* X
        else inc A_i by 1
0 k6 w, k1 H7 K, E% H1 e- h8 l    end/ \( }1 [& r7 w
end2 l& |* L- l& ]

  t' M* c9 F! m: N1 I( F+ ybegin P_pick3 arriving: t' C# S. j2 s* n& ^% t
    set A_i to 21
; X' D3 Q1 W9 }; Y6 N    move into Q_induct3& M, d  J: D9 M, @( \; ^! r6 r
    move into pickaisle.induct3/ \  `  V& H5 O
    while A_i<=30 do begin
/ B& P. E/ l, |3 C2 V        travel to pickaisle.con(A_i)
( C% h  ^1 w! b* \" C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ |% g7 J  \3 Q" `# @' s        else wait for 10 sec) v0 L5 I- z+ p* E
        if A_i=A_leave then send to die
8 U! }$ t1 N0 m' G% ^# G9 P        else inc A_i by 1
/ Q& d9 p5 B; s  @; x    end/ Q$ z- z" X4 C
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是个什么东东?0 k, [* I1 B& ?/ F( D2 {: ]$ t5 o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 \3 r: @  V% t- D* V; }
% j4 M! X; A/ c& S  C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* Q& O0 v& n4 F7 p

4 T! o7 W! a. }9 G$ P7 v: ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 U; i7 @7 R) J4 L7 N1 q: D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# L) L# w' f& X7 E% Q; N% p
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; i' X* @  L4 Y$ O' i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" `$ d' R" T4 kbegin P_induction arriving
8 B( m0 X+ u: v6 h' U( n    clone 1 load to P_pick(A_induct)
% O- S1 F! E* U& h9 O3 G8 R2 D7 rend最大的系
& u. p' E6 G& i' [0 V0 f$ g
" L* M+ N! o7 }6 H. T# _begin P_pick arriving
* T' V2 t8 _3 b2 @  u& n  ^    set A_i to procindex * 10 + 13 P6 |: a& V' d
    move into Q_induct(procindex)% _$ `6 q# [1 c3 i0 b  x+ z2 N1 M
    move into pickaisle.induct(procindex)- ^& b1 e1 Y. q5 r. V
    /*check the type of pickaisle.induct(i), for your last problem.*/% w3 ^0 R4 i4 ^* d: g: _

0 L* d1 P( m0 j' k) c1 I    while A_i<=30 do begin
$ m6 j; z; {* ^( v6 ~( D/ e        travel to pickaisle.con(A_i)/ G# {+ a! p; [* V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 t" f# \+ u0 A/ K: U" c
        else wait for 10 sec
) H- Q  r# q% a3 B. N( j        if A_i=A_leave then send to die/ d, y* L% l) n2 u/ w3 l
        else inc A_i by 1
" [7 i5 R+ M) B: C; _    end# u: ]& C- a% I7 G
end
1 H% C4 ]7 w: Q! T/ b
" Z; A+ P* p% l  T% @其中的procindex为整形,代表当前process的序号。
8 V: a2 W. m9 e1 D- b% `% h9 [+ pstation和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-4-12 07:49 , Processed in 0.020188 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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