设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15120|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) n% W4 T  }3 @3 {% x- R
- [* u# Q% ~* E! F6 g# V我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 @1 x) @6 Z5 ~# A
3 c' j' g0 {$ J+ |3 N( I
begin P_read arriving0 ?5 h& m0 X- q& w. V
    while 1=1 do begin4 b. x" g! k! u  C
        read A_tote from "data.txt" with delimiter "\n"
  L6 N' u; Q) a3 g; G4 ], ^5 r% |" H        read A_time from "data.txt" with delimiter "\n"% U. k& T, t1 Q, C& m5 @
        read A_leave from "data.txt" with delimiter "\n"0 N1 n0 c: O  g8 w5 c1 L3 W/ c* r
        read A_picks from "data.txt" with delimiter "\n"
2 e; `, z6 }% T: ?) L        set load type to A_tote* C9 w. E& Z+ a9 w
        if A_tote="tote 1" then set A_induct to 1. `' J# x& f$ s' s4 i, M
        else if A_tote="tote 2" then set A_induct to 2
# i, ]5 B: I4 \, l  p            else set A_induct to 3    , I3 D( U0 X4 Y$ u0 s* w. S5 R- o  e
        set A_i to 0; l+ y$ U+ F  p& b  m% [$ n& ~9 r2 b
        clone 1 load to P_induction& D, a8 B2 z, ]' W( v
        wait for A_time sec
" V7 k9 E9 D- B0 Z9 ]    end
4 n0 @0 B! ~* i0 x4 S* k$ y8 send
+ \+ X8 h, H$ {
$ h; _0 k, w$ B6 m4 Obegin P_induction arriving: ^5 n; x8 s$ e4 P" a4 z
    if A_induct=1 then clone 1 load to P_pick1! p% j8 `, D1 N8 }/ m' F
    else if A_induct=2 then clone 1 load to P_pick2
; J/ w. M; V: V- v        else clone 1 load to P_pick3( V( ^. |, h& u( K% M& R% d% z
end( h# ~3 n! W' O5 F& V. o  S7 c/ l

9 ?3 [" K, ?0 Obegin P_pick1 arriving
1 v7 m0 K3 ~& ^! @8 f    set A_i to 1
* g; x* s5 L  M    move into Q_induct1
% }- |* h9 Q8 _5 B; I0 ~    move into pickaisle.induct1
  y6 V4 e; y8 f) F    while A_i<=30 do begin
, G( n( P  n6 \" i* }$ I2 g        travel to pickaisle.con(A_i)
2 V0 A% X2 b7 p  r# W$ u* @& V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 T( C  G" a1 E7 i4 i        else wait for 10 sec  G2 ]0 e! g8 R* t
        if A_i=A_leave then send to die8 f$ u$ ~" I2 a3 |& ]
        else inc A_i by 1
" g4 C* {1 q) `1 P; Y: q. U* s    end; e1 E8 g( E- S7 P9 i8 f6 {# K/ [
end
0 Y4 p$ q7 E3 ]; a! y% x/ d# e% p1 W4 x# k  s! ]& h' R1 n- O
begin P_pick2 arriving
( m9 ^+ y; ?. k' @0 f5 ]    set A_i to 113 S8 k( G2 r' r, k
    move into Q_induct27 e0 s$ K) ]  P( d; m8 d  |. ]4 T
    move into pickaisle.induct2- ~. z# Q3 h* `; y# G; Z+ {! J
    while A_i<=30 do begin" f0 H1 v, \2 ]  k1 M) h" _
        travel to pickaisle.con(A_i)0 K: c- J) X0 ^6 m+ ?2 ]" ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) {0 a; s% K( y" `7 a        else wait for 10 sec
; k; {2 K$ k) g: Z) K# ]6 a% G        if A_i=A_leave then send to die
5 R0 \. p9 f9 Q( U  p        else inc A_i by 1
" m3 C9 D6 a* F7 d    end
1 M7 Q3 [4 D/ r) ~) e4 Kend2 m# w5 l0 B( X; u+ S

$ x$ M2 t1 ]- A1 B2 l% Xbegin P_pick3 arriving
7 v8 r- k' Y. ]; X5 p5 c6 {    set A_i to 21
% L3 N, |3 [% W9 R    move into Q_induct3
# P/ S' |: O2 H" d0 g    move into pickaisle.induct3
4 t  ^3 ^7 |5 m5 a! A    while A_i<=30 do begin! u3 F$ b. c, A6 Y% |
        travel to pickaisle.con(A_i)
$ p, p9 h9 g( c: `* o0 b  P# O! L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) N3 n5 c7 b+ o$ z" O3 n4 {0 P
        else wait for 10 sec
5 O) b1 k+ G; j# `5 b+ Y5 ~        if A_i=A_leave then send to die
6 D7 n3 x" D: c5 h        else inc A_i by 1& }4 X  h- d9 p! `; `6 @7 o! g
    end, C. J0 ]# K& z  u" n: 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是个什么东东?% n; ]& I0 ?  ?, h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" P* w. c9 Q: n. b2 H8 @

/ k( i8 [" w% gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' v6 b' M7 }, D4 K0 f: N7 O/ {% t9 o. l9 E8 Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 M+ x( i! C; O9 L: ]4 l5 n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% `' h  e. z; w8 ?9 L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ d' N% p5 l, h- N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( ~/ j# x2 z# ]" ^1 L+ Z
begin P_induction arriving! Y& o! Q7 I3 q; t
    clone 1 load to P_pick(A_induct)2 \2 ~. V6 a" g+ h5 k% ^& ^
end最大的系
% F$ E1 }1 a0 P2 }. v6 J: B; L- l" v* c7 l8 W  A
begin P_pick arriving
6 b* D6 [( n/ J5 C9 l3 h    set A_i to procindex * 10 + 1
8 _; B  h8 l, u1 s% o2 g0 ]    move into Q_induct(procindex)
* z' k: u/ e$ b4 }: K: g- j    move into pickaisle.induct(procindex)$ r5 J& }" Y0 d6 W! Q
    /*check the type of pickaisle.induct(i), for your last problem.*/
: D/ `& e1 N+ Z# X5 t! f* b0 z, d2 t: e  V/ [" v
    while A_i<=30 do begin/ D6 H# C7 L6 W; @* x7 o
        travel to pickaisle.con(A_i)* |$ \8 E3 n) b5 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 t; v) h  c+ l* }  U
        else wait for 10 sec1 l  ^" s; y! r. h! j
        if A_i=A_leave then send to die
7 k! r) `& N  ~9 f: X        else inc A_i by 1
& Z0 x5 t9 T4 x+ w) w    end
: F1 C, b, @8 b2 d& iend  Q+ r# ], B& g( E2 \
% q( G+ q) ]  O
其中的procindex为整形,代表当前process的序号。
; \1 m: R1 l9 u. Q) }' ?+ l  qstation和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-8-12 09:22 , Processed in 0.016763 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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