设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13175|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 ~# c. Z$ l6 v7 s' W- o; b5 [* @

3 F/ x9 ^; L0 u# P我的问题是,在每个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中的数值,不知道会不会有什么不妥。% f) ~$ A2 M) C
0 [+ p5 D4 \5 b; h! q" W
begin P_read arriving+ p& n1 t( j% a# v2 ~% P
    while 1=1 do begin
* Y( I; C/ \( y. U4 w        read A_tote from "data.txt" with delimiter "\n": T2 v  G8 z, S; t% O
        read A_time from "data.txt" with delimiter "\n"* Z* F  ^+ ^& c. O) v' \
        read A_leave from "data.txt" with delimiter "\n"$ }/ |! g/ J- P/ W( }1 T
        read A_picks from "data.txt" with delimiter "\n"
5 r; V9 H: P: B, f3 _& Y% |        set load type to A_tote
9 C- O% l: K7 C5 B5 C2 h        if A_tote="tote 1" then set A_induct to 1
4 G! G2 _  O" I* }3 k+ S        else if A_tote="tote 2" then set A_induct to 2
6 s5 {: O4 `4 E1 P3 i+ h7 \" `            else set A_induct to 3   
$ ?5 V6 z/ ^. y/ r% n8 q        set A_i to 0
4 R( d0 C, v5 z9 L( I" c4 Z, n: c        clone 1 load to P_induction
9 F3 p( O- S. q7 B+ c        wait for A_time sec- B% B% q* q1 a. C3 t
    end  I; B* }  o2 K) n$ d& |6 J; r4 k
end
- U2 B4 P8 F0 h7 G
3 e# v1 Z& b2 A9 t: b6 t! c/ Fbegin P_induction arriving# I6 \9 v: O7 h' b6 H
    if A_induct=1 then clone 1 load to P_pick1$ G. P4 Y- o2 C$ a! m" C  q' c
    else if A_induct=2 then clone 1 load to P_pick22 @9 n4 L  T' E4 Z5 q
        else clone 1 load to P_pick3
# L, V& E: \4 U8 }" w3 O3 qend0 C1 m6 m- [. H; d5 w
" L7 h" O2 c0 q: P& j
begin P_pick1 arriving
: r) ]. I2 g) y6 r; S. [    set A_i to 10 l" z% F" M" W- T) P7 @( p) ^, J
    move into Q_induct1
* q* i6 R0 K! {% e% p! \/ ~/ u    move into pickaisle.induct1
9 b; i) x7 c7 K- s    while A_i<=30 do begin7 H  y2 @- N! U, t/ E
        travel to pickaisle.con(A_i)2 n$ U7 W2 C: N8 ~  M; ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ?: e( r4 J8 Y5 J( D/ {
        else wait for 10 sec
5 q: _) l8 \/ ~9 e        if A_i=A_leave then send to die, p+ t, f- j; m- Q7 M
        else inc A_i by 1! o: M0 f6 Y$ L# ?" J1 |
    end- R0 \& Y9 P( L% n1 e
end: y9 P6 @% ^, R& S  I; T

1 U1 R2 s8 M* G' B- P, Abegin P_pick2 arriving
7 R* K' ?# i5 ~: K! U* @    set A_i to 11
' M1 r0 e7 ^1 s2 z4 S$ R$ G    move into Q_induct2' v5 l/ H" z: s) m  x
    move into pickaisle.induct2% Q4 d/ e% o& K# z8 C  w
    while A_i<=30 do begin" w) X" |/ N/ u* J
        travel to pickaisle.con(A_i)
! p: H# q. @9 S, Y1 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ o8 V+ z: y7 D        else wait for 10 sec
! D5 d. g- q$ t# u  s5 w        if A_i=A_leave then send to die/ D8 k) }: V  e  O, j% t, l
        else inc A_i by 1
0 t' I" q! t7 s9 P6 m+ g1 L    end
3 M/ p( F0 T, O2 G: I# D. xend. v: B: b$ ?. q4 j0 O

# k% ~  F1 c8 i7 r& Q! K3 Rbegin P_pick3 arriving
7 T" v( }8 c- w/ I    set A_i to 21& @4 t( j5 g8 r5 A0 I0 Y6 b
    move into Q_induct3
* m* x% B4 Y" T; b    move into pickaisle.induct3
$ R' G5 [+ p7 G' b$ [5 j5 ]! D    while A_i<=30 do begin
$ W* B: L" _6 s' R8 Z6 w: P2 I        travel to pickaisle.con(A_i)' F# m7 ~" H& M( a1 k/ l/ l9 O  Y$ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 o& F7 ?' [  N
        else wait for 10 sec
9 g9 j* P8 a- n& I6 y% Q( B3 Z        if A_i=A_leave then send to die
  p  t9 m. d. U# b  G' A2 A$ [" ]        else inc A_i by 1, G& X; ~; H3 B$ j1 E
    end
: T# z- o: j0 t3 a; |( D, [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是个什么东东?
6 A$ o9 w9 |3 @move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* O; T. L' C5 x) A
* x2 F$ H' F1 T! L4 u8 R: h* JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 f; M, C2 a! B7 i6 V* ~5 _

3 n4 j/ l: d3 i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, ]4 _6 ^3 e! u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: s) {5 E. ]) t( j# j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' b) [! B: C+ ~9 \. Y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ @7 J6 I8 U! v
begin P_induction arriving
( D) H5 V5 J3 T" r, A0 V    clone 1 load to P_pick(A_induct)& M6 X9 |" R$ |, B" X8 J1 C/ Q
end最大的系
4 l9 }& p/ N; v. y* w  u8 F% k# j7 T) E2 g; t
begin P_pick arriving4 [  `& j& v" I' w" s6 V$ Y8 e& E
    set A_i to procindex * 10 + 1; s. ~( b& r+ _( o9 g+ Q: k
    move into Q_induct(procindex)
- L: z9 i5 j( K! S1 V    move into pickaisle.induct(procindex)6 O, F0 ]) S* b% {6 Q" W
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 G6 E4 I2 {2 i6 w$ |% u* v# ~! R. ?+ v) _2 t$ W9 Z) N
    while A_i<=30 do begin. c: T7 s' W: \( O2 B2 |1 u+ j% n
        travel to pickaisle.con(A_i)
$ {$ @: d8 P9 z0 j/ M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" |+ V. t% W& B6 b$ h6 K
        else wait for 10 sec
8 I  k' l2 h% X" ^! k/ N) H: t5 x        if A_i=A_leave then send to die! B% ?1 _5 Y0 m4 d  [' [8 ^6 e
        else inc A_i by 14 T7 \& _/ \9 |, R& E6 ]/ v
    end3 K& }4 Y! ~' ^+ ~
end
9 m/ @/ Y% G+ Q
: T5 x( D# l1 j0 q% g: d( y; C% w其中的procindex为整形,代表当前process的序号。) {- \3 K" ~- r8 A1 F+ O! N
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-3-24 12:08 , Processed in 0.017651 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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