设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11985|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) l; T$ z8 H5 {7 ?
( f3 W* W- y0 C- b( p# C, L  K" q我的问题是,在每个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 @+ T4 I3 A  h& j: f
( s3 R: A8 \: g, gbegin P_read arriving  e7 {. L, Z8 N
    while 1=1 do begin* ]. ^) R! j$ N! ?) ^* Q! l
        read A_tote from "data.txt" with delimiter "\n"
' `* N2 J0 Y+ P$ t$ B        read A_time from "data.txt" with delimiter "\n"1 C& x; R- T/ m9 r# }
        read A_leave from "data.txt" with delimiter "\n"% K& ?! s( t. t! `+ h. W+ |
        read A_picks from "data.txt" with delimiter "\n"4 ~3 {* \9 U) Y
        set load type to A_tote
, G0 s6 Q) B3 m  S2 ^        if A_tote="tote 1" then set A_induct to 1
0 t$ ?1 o, m$ S! U2 m        else if A_tote="tote 2" then set A_induct to 2
2 V7 b+ J# o" Y7 o" v            else set A_induct to 3   
3 e4 I" z( d! m  }$ W* ^: t        set A_i to 0) m7 F0 k' L( t; \' b& j5 o
        clone 1 load to P_induction
/ g. r0 h' u% H: c& i        wait for A_time sec
$ n; e3 e1 O7 d* J* O    end7 ]- |8 F& _( c& F8 `* d
end$ N0 L, Z5 x, N& v. z5 c- g" d

4 d6 D, G: P$ b. X& ^* Dbegin P_induction arriving3 u$ L& J) F% X# L9 n
    if A_induct=1 then clone 1 load to P_pick1
9 |- G- A( Z3 e    else if A_induct=2 then clone 1 load to P_pick2- M7 B& K2 ~' E
        else clone 1 load to P_pick3
0 C' J3 d$ u' v* c2 ~$ F" e' bend! W1 h! D# y9 V( O' g& i! `  x6 d
- ]3 K" y$ v) L1 c. [% c, N; J
begin P_pick1 arriving
4 y8 ~& d/ P& N    set A_i to 11 k: P0 N2 m8 I& g0 r3 J" v
    move into Q_induct1
! ]! m. y1 \9 C    move into pickaisle.induct1$ _* N3 O: C; W
    while A_i<=30 do begin" C9 V* R/ U; i* v. E
        travel to pickaisle.con(A_i)/ Y4 T+ w8 l- e  W, E- B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 K6 a* f) P/ \/ H        else wait for 10 sec" Q2 k; p: D" q" x+ A) v( _* n
        if A_i=A_leave then send to die
; X8 A/ m9 z- s4 s, }0 [/ O3 L        else inc A_i by 1& F- ]+ Z; R$ ]) S& [! j3 n
    end! F, L) v' H" `
end
! e7 J  V$ h$ J1 ~1 `
# l7 M4 H- v4 Q' V0 xbegin P_pick2 arriving0 Z( t* T9 Q) P
    set A_i to 11% v9 r' O6 Y1 \: c4 h
    move into Q_induct20 R, A2 C- D3 c1 _
    move into pickaisle.induct2
' |, ~" `& ^: K& C    while A_i<=30 do begin
% T* h: u% f- ?2 m7 d- e* w        travel to pickaisle.con(A_i)) f: r3 g9 S9 f% m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Q. g9 Z8 Y) u5 @- u% w
        else wait for 10 sec; \: }) H* f; P9 U! F! r
        if A_i=A_leave then send to die
4 Z$ [4 t% ]5 I: s        else inc A_i by 1! X7 @2 q: `9 W
    end
5 X/ `+ h4 `3 ]" Z; Xend
& a% B" D2 H4 ?: {7 o2 [) H/ ?
  g' @8 U. K4 g7 g2 zbegin P_pick3 arriving
+ A$ h4 \2 Q/ `! Q' J    set A_i to 21% h9 @& |4 y$ k
    move into Q_induct36 k$ P: H7 ]0 X. I/ q% R
    move into pickaisle.induct3
6 E: ?: T* Z- A9 J! N1 x" J5 B    while A_i<=30 do begin9 x, b: N  U9 l
        travel to pickaisle.con(A_i)% n* V: n1 D' J+ N/ f# _# \1 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 z& H7 P% x+ A, c        else wait for 10 sec
/ E: h, ~8 L% F7 c        if A_i=A_leave then send to die" [4 F0 G! p/ k- k
        else inc A_i by 1' y1 v! h# B3 }3 ^& {" E
    end8 j: W; k) f# G8 E6 q# u
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是个什么东东?. g; @+ c5 w1 c/ j, y2 K2 V, B0 d. _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 y8 ]% d! H3 n* U: K+ {8 V
, l1 a0 t9 X  @% }( \# i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- H, f* S* H. Y7 `5 y7 G
1 v  r9 }4 ~7 q6 t/ v% h* `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- w* r2 {3 r. r( y! r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 \5 y. n  _/ M; X' y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! _- ]( t0 [; L7 F. e" a9 _( O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ r* I+ T7 x" ]9 rbegin P_induction arriving
2 e6 y/ M+ J( V# o    clone 1 load to P_pick(A_induct)% D. o5 ?3 R% n
end最大的系
) N  r& A3 p1 ]2 O" m: n, l
1 W; j" K! K- I2 p  W- [0 Ubegin P_pick arriving
  ]6 m, [1 g8 v    set A_i to procindex * 10 + 1
% C2 K7 F* k8 B- L% b3 c    move into Q_induct(procindex)
6 V5 \! ^7 V: c( R% p0 c    move into pickaisle.induct(procindex)
) A7 A: n9 a& G    /*check the type of pickaisle.induct(i), for your last problem.*/
8 e( k+ K# u! j
% k! y1 }7 a& N3 P4 U& Z, e% A: j2 Q    while A_i<=30 do begin
' S9 E6 _- p( l' Y        travel to pickaisle.con(A_i)# v1 q8 y) z) U- Z. _2 Q  D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' d$ w& K, P0 o! x. A
        else wait for 10 sec: n0 W9 W/ s& x" E
        if A_i=A_leave then send to die* Y; b. g* A1 ?) C# F4 P
        else inc A_i by 17 I2 b" O" P' N+ ]8 o, }5 t( @
    end
0 Z9 Y) o" H+ i; j& ^2 u) Mend; g1 z- E$ P. z8 z2 ]

7 R( ^6 S( a2 T, H其中的procindex为整形,代表当前process的序号。
3 b6 H% q  M( ^2 Gstation和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-19 03:47 , Processed in 0.018975 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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