设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13951|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 U* n/ v- b. d3 h5 Z1 s

' g- W, \# h# X/ B* W+ ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ q4 r: s4 B8 A# p+ x. Y
0 x! I, N0 @6 f" C  `begin P_read arriving0 f- z5 ~* h+ }4 ~6 ~
    while 1=1 do begin, K8 P0 c. ~9 U2 {  M& Z  ?" \, M
        read A_tote from "data.txt" with delimiter "\n"
( d2 x( w  N4 q* ^8 a5 V2 H) G; j        read A_time from "data.txt" with delimiter "\n"6 U. M. _0 ^' O7 T7 {. b
        read A_leave from "data.txt" with delimiter "\n"1 ^: c7 H0 s/ ?( C* M9 R: }
        read A_picks from "data.txt" with delimiter "\n"9 R( J& E- g- m3 h" h. i
        set load type to A_tote7 r' l( b& `" `- T9 z
        if A_tote="tote 1" then set A_induct to 14 Z2 `" n. S* W0 V7 [- F9 S9 U; d
        else if A_tote="tote 2" then set A_induct to 2
, Z4 r2 t1 c# p2 z            else set A_induct to 3   
0 P! E3 {/ I$ g: Y( {9 @  g8 o        set A_i to 0% F- Y4 {" L, L, S9 t
        clone 1 load to P_induction$ {2 Q: ~. A% K% Z/ A* }
        wait for A_time sec& i5 b) t. n! y  a, k1 J2 R5 o
    end: b- I1 }$ s4 Q' F3 y3 f( u) l
end5 X/ l4 M" N0 V8 e9 b

9 @* Q2 g) h1 ]* p3 [. Z8 @3 c) U$ Zbegin P_induction arriving) Z2 [& N$ \* |5 B
    if A_induct=1 then clone 1 load to P_pick1: b5 f+ T; B1 D0 P! w
    else if A_induct=2 then clone 1 load to P_pick2
* O# z) Z8 l( P9 N* s; Z        else clone 1 load to P_pick3
1 h0 ?% _/ [# A) dend
  H0 }# A, g6 X" x: F; c6 E' k; y  {! s. l
begin P_pick1 arriving6 ^  H5 J, A: b9 V( R0 b
    set A_i to 1
7 K4 G2 a& ]; t- k% F; o3 R) w    move into Q_induct1
: o' l$ K4 U' K& \    move into pickaisle.induct1% i8 |) ^, i$ J+ d( k
    while A_i<=30 do begin
8 I7 y. ^) ?$ R/ _5 @        travel to pickaisle.con(A_i)
% `9 |! b0 A9 H3 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- C$ j' l5 ]& Y: n$ P" w        else wait for 10 sec' q- U# l* J5 i; H3 t4 y( ]: L
        if A_i=A_leave then send to die, {2 p$ x2 {6 S# z- }  x6 b
        else inc A_i by 18 m2 r  T2 K- W* o& @6 h/ w
    end
( k- \( B- c6 P/ s, I0 t. Oend
" E6 I& i9 q/ n6 f4 z( G) A3 V3 H* t
begin P_pick2 arriving
1 s$ {% n7 o2 X$ j  V    set A_i to 11
( I( J/ t& b$ ~7 V% G: H    move into Q_induct2
) Q' L7 g5 D$ _# a    move into pickaisle.induct2
3 [2 f& J" G7 p& t5 g1 T    while A_i<=30 do begin
7 w( {6 {- G% b( A        travel to pickaisle.con(A_i)
" }$ p% A; i6 d' i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! {# G1 \: q2 h6 |6 W3 @
        else wait for 10 sec
( W. ?8 `' g# r  d2 j        if A_i=A_leave then send to die; W+ @8 Q# u; \2 _, F
        else inc A_i by 1
  W% I# F* S3 H    end
( p4 j+ J( Y4 s. N! zend/ O/ n: E8 h% R) P! Z( [

" S9 g. v- \9 Q& e6 vbegin P_pick3 arriving
# u/ o; e; I% T+ A# A5 t. F; ?4 m    set A_i to 219 ?3 o1 o1 \/ ^. K& K# T# S
    move into Q_induct3- A/ E, S6 u! }6 E9 u: C+ U
    move into pickaisle.induct3
5 ?8 X0 n: P  R! e+ d    while A_i<=30 do begin
+ E7 e7 h+ d# S4 O& K        travel to pickaisle.con(A_i)( @7 g, M6 E  e. J& h0 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 W; t, w; `+ f' [4 ]6 t, ]        else wait for 10 sec
8 r! V& e% j/ s2 P( R$ v        if A_i=A_leave then send to die/ u4 ]( O' H) g: P0 F
        else inc A_i by 1
- l2 Z- M, Q; K; X3 B- a( e4 i    end8 R( V1 z% P% K, j5 Y
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是个什么东东?
1 T# B9 o6 G" Amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 P( T2 w0 J  b5 g5 C: w9 R5 O: k' ~4 C( M6 U! u# l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& N; D5 G) v3 ?% A# d7 v* g
9 X) X9 b; x! M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# Z1 G2 H! ?& `( W- ]0 I/ [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 }- s' y% `, C5 O& C9 [/ q. I3 M) {8 i2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, `: h6 m, I2 t. `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 _; c, H% N) j2 Z$ f+ x; r9 Z
begin P_induction arriving
4 o$ E7 K& C: s7 q    clone 1 load to P_pick(A_induct)
5 d( s1 Y- L* b; Y  _! W) J# yend最大的系: J# z. x! a: w2 a/ q+ v/ Z, H5 \

: E1 [" J5 u4 D# sbegin P_pick arriving: X+ S. i8 s$ Q6 n( u. i  S
    set A_i to procindex * 10 + 1
: m" h6 Q4 j1 |; [6 K6 ^2 k( C3 X    move into Q_induct(procindex)
1 V6 z% L3 l) D) D, \, i8 i2 `    move into pickaisle.induct(procindex)
8 d6 w7 K8 @: Y0 |9 U% K. D    /*check the type of pickaisle.induct(i), for your last problem.*/
7 }! P" I+ J+ i% k% X' Y0 _1 R5 q9 W- A
    while A_i<=30 do begin8 Y5 U( y/ v9 F/ ]7 ]) E* G
        travel to pickaisle.con(A_i)
$ X" V# H: C# l/ m9 U7 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" Q0 Q% Y% X, S+ Z3 u7 T  A        else wait for 10 sec$ p% |* g" H  q0 I  V
        if A_i=A_leave then send to die
2 h; r# y2 V' r9 I        else inc A_i by 1
2 g7 F+ A$ Z7 G" `    end
. `4 ?! m( ]; D' d& M% e7 h# u- lend, @. i& W4 @) }$ w( Q8 X( l1 ^
2 P$ W# t4 v0 a  i" N  \; e; D
其中的procindex为整形,代表当前process的序号。
# X, ]- q  l. b3 s9 r$ i7 Astation和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-5-23 13:19 , Processed in 0.021559 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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