设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13990|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; v+ ?! K$ g/ _" P8 W5 {/ o
# \3 _6 e& H" r% D# l# a我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" `' ^% Y/ R0 v3 u1 V8 P' H* b) M$ Q0 M/ c' M
begin P_read arriving
) @  \9 w) V/ ]% P4 m7 v$ Y    while 1=1 do begin
# v/ E% `  r2 h        read A_tote from "data.txt" with delimiter "\n"2 q5 U3 ~+ V! M6 \+ i
        read A_time from "data.txt" with delimiter "\n"
/ g, T0 [4 j1 P( [  |        read A_leave from "data.txt" with delimiter "\n"
& H% B9 H5 i! ]/ q9 P! \, C        read A_picks from "data.txt" with delimiter "\n"  d4 d1 z% H4 K6 t7 k
        set load type to A_tote, v; ?# u1 e- x$ C
        if A_tote="tote 1" then set A_induct to 1
% |6 v/ _, _- l, b  E" x        else if A_tote="tote 2" then set A_induct to 21 _' V' u' A7 d% ?6 d, t- E
            else set A_induct to 3    9 Q  d. G! f( h5 ]3 _5 }  s- f' G* @5 p
        set A_i to 03 _- b; H& r! \4 j1 v1 {% |
        clone 1 load to P_induction
5 L* O* p+ h9 n        wait for A_time sec
! J$ x% A, c0 G/ U" i5 ^9 K$ V    end
* [% R0 v2 g3 s* T9 y/ }end, h' p9 h' z7 v! _; c3 t# y
* M- a/ }; I6 C! m8 o4 J0 E
begin P_induction arriving4 h# u6 O% P4 z9 |
    if A_induct=1 then clone 1 load to P_pick1( [9 V* T. b  U9 J2 m: x* N
    else if A_induct=2 then clone 1 load to P_pick2' K5 @1 U1 d* Q; R1 f8 [
        else clone 1 load to P_pick3
! M5 r: O  D4 E& S3 |6 T1 xend
1 Y: I% b/ z& D/ k" s+ s+ X0 F7 W$ b  S
( `8 G9 T$ N1 d/ Z. }begin P_pick1 arriving
/ A2 B) I3 g8 L% e0 C/ q    set A_i to 1
% C7 j! ?4 j7 m! Z+ F# ?9 Q    move into Q_induct1. E1 I2 e: Q- B: D
    move into pickaisle.induct1
5 b, i/ {% G) E: L6 k0 q( B    while A_i<=30 do begin( @. f9 z& S* b) y( B
        travel to pickaisle.con(A_i)2 O) x5 d; b# M; ^: X+ R1 t& H0 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! m8 P7 ^- l* H8 ]        else wait for 10 sec/ X, G8 z' v; s( e7 v: G
        if A_i=A_leave then send to die
% }) E1 i3 N2 ]8 I* a& R) `2 ~' y        else inc A_i by 1
  C; C$ y0 C, J6 H0 ?    end
- {/ O( z6 R) \end
' r: `) M* ^- [+ M3 p  D' r& A0 F* e* \: U* o
begin P_pick2 arriving
' C5 q) w7 A' v& u    set A_i to 11  y# G; e- ~8 H9 S' l1 ]4 u7 W! u
    move into Q_induct2
/ S# T) `& O8 N1 Q- B' r  G1 \    move into pickaisle.induct25 a- j& s; L$ H9 e# k. o. @
    while A_i<=30 do begin- ^! \1 G; f  J* R" h0 w' l1 T8 l* l
        travel to pickaisle.con(A_i). G" W3 R. W( O8 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G1 r  ?  j* ]% u3 A! e        else wait for 10 sec7 ]8 q# [! _0 X: |0 K; U) a
        if A_i=A_leave then send to die
3 N' I0 W+ O! f- N) X  W        else inc A_i by 1
  z1 Q0 _/ {) Y( O7 V$ R6 Q    end
/ J- F! u1 w# [; `  _7 Q2 z) L4 i9 yend
7 z4 J0 D( o! _5 m% X/ K7 K& s% {9 G/ Y
begin P_pick3 arriving3 n5 K  A) E# i4 h) G9 g
    set A_i to 21% i( |* ]/ z5 U( }$ p4 U, s
    move into Q_induct3! |5 Y$ c" G6 N) T) t8 s6 y& b
    move into pickaisle.induct3
- h8 X4 y9 j$ b  ~$ f' M/ O" J$ k6 [    while A_i<=30 do begin
3 ?- @2 L6 U  {1 ]" }. h7 L& M4 n' E, Z        travel to pickaisle.con(A_i): z8 w( k& u9 {# I+ i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! j* e- n4 G& n+ L6 \  c1 k) c        else wait for 10 sec- ?! V3 f9 N+ P: w8 g& l' T" d
        if A_i=A_leave then send to die
+ S" o' d: ~. N9 ?& c        else inc A_i by 1
8 k0 t+ C" V; F, T& X' |    end  b0 l  ~& X8 ^) D7 |  ]* S
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是个什么东东?3 U* f: }" v# P- k% ~8 ]5 t  n- [- e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* V& X! n, \9 i1 h. Z! P( w& \2 c

+ N$ _( G7 u. }  \7 d4 x4 hAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) q- T; n, L% ~" N
6 Z2 K4 q8 R+ _' \2 M! m; E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 X4 L& K) T6 m1 `: w# Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 T  U2 Y. c3 j# T: S8 q2 T8 G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 d- J$ o8 n6 H% Y' B/ p# B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- p( k: E( ?/ b- Y! I. hbegin P_induction arriving& C& q6 b% M# i. q) Y1 B2 }
    clone 1 load to P_pick(A_induct)( J; r& Y* a* m7 q8 I1 q% ^( ?" S
end最大的系
7 M/ j7 I6 W* B, c/ Y+ w9 [$ M9 b0 D1 N% V# J2 O1 M1 ?& v+ @
begin P_pick arriving
5 `& r4 j8 C" q  q: ~    set A_i to procindex * 10 + 1' U1 M, M# J* t0 m0 [5 r* [/ j
    move into Q_induct(procindex)
7 Y' L, f/ I5 d4 n    move into pickaisle.induct(procindex)
7 G0 `/ T8 a& R+ D/ n* L    /*check the type of pickaisle.induct(i), for your last problem.*/
! L+ j8 [5 l: o7 g1 r! i* Q2 \" X: c4 M/ W2 s* @
    while A_i<=30 do begin
. h0 m9 m. s; @8 R. `3 H7 P        travel to pickaisle.con(A_i)
$ ]8 ^6 G2 ^( ?, [) C) ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ r$ s+ M# x( N( z# X        else wait for 10 sec' ]8 P  A) F/ W6 v
        if A_i=A_leave then send to die, E! j0 o( c* p$ X$ M1 M$ H  Q
        else inc A_i by 18 W7 |% t* u6 Z& {
    end
7 e0 E  Q- W  B& c  N3 _# B- f  Tend- K) ]' T9 g9 P4 F, J% j( g
% \9 e" J# x7 p* \
其中的procindex为整形,代表当前process的序号。; F) Q* W$ F) V# Y4 T
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-5-28 01:36 , Processed in 0.014902 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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