设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14044|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, v& j5 Y' j: t: V/ u4 S1 `/ D4 R& z1 f: h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 x2 T3 M/ e0 J" ]. w- d3 E

% Y5 P$ M6 \  J* f( q- |begin P_read arriving
! E+ {& ?/ ?3 q    while 1=1 do begin
- O5 n7 J/ [; \& l1 w9 G        read A_tote from "data.txt" with delimiter "\n"; _  b% N2 ^9 F9 ]3 X
        read A_time from "data.txt" with delimiter "\n"( ~# s3 c& E7 h: |
        read A_leave from "data.txt" with delimiter "\n"
. y6 i& D2 ?+ E/ D        read A_picks from "data.txt" with delimiter "\n"4 i0 D% r5 R! m
        set load type to A_tote0 `6 U! n6 `5 G( D# j, f0 _0 j- M
        if A_tote="tote 1" then set A_induct to 1% s( k2 t0 J' d7 A& |5 h  \" Y* U8 T
        else if A_tote="tote 2" then set A_induct to 2, y* N3 x, m# G0 z& Y, J
            else set A_induct to 3    4 a9 R! |0 D$ s1 {( n
        set A_i to 0& X( c  }/ R0 G4 |1 E
        clone 1 load to P_induction& s+ @+ I9 v9 L5 W0 I
        wait for A_time sec
5 P7 _) H7 o' r! b8 s$ n    end( u0 q' o  I2 P+ z! d, \/ X" L( \
end) q( v- ~0 p) [3 R8 i$ V& I$ A
' e4 R' ~; l/ m5 M- C: ]
begin P_induction arriving
: [) l0 m. n) o1 M7 f    if A_induct=1 then clone 1 load to P_pick1. S% [: L2 C" j" _" _
    else if A_induct=2 then clone 1 load to P_pick2: }# f! {1 `6 J: i1 |
        else clone 1 load to P_pick3- T: M0 z; b5 [5 N% F
end- C: k; v. w1 o

6 g, w; v. ^3 y7 g7 \1 J; Y; fbegin P_pick1 arriving" B1 l( [8 [9 P, r8 a2 T2 i
    set A_i to 1
: E* O5 V9 s3 E9 c- t, K    move into Q_induct1
- h7 \/ H% N5 G1 N9 E/ w    move into pickaisle.induct1
$ I6 F0 q: K, C; F    while A_i<=30 do begin' \8 L  ]1 N4 q9 ~0 u9 }
        travel to pickaisle.con(A_i)3 u! A8 F( k7 _+ A$ E! }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( l: c  k& Q( q        else wait for 10 sec& I, |5 Y' I' d. h
        if A_i=A_leave then send to die) S" L' @+ `+ L  L1 b: P
        else inc A_i by 1- P1 C  P" l$ V9 ?
    end
7 ]! I* R1 O/ m7 A0 uend
8 H- c! j! B/ [1 Q- v+ V9 E! l# b/ f6 D6 o  K0 s* i2 E6 m
begin P_pick2 arriving
* n! ?; k' ?# ~- z, w' I0 @8 x    set A_i to 11
5 M6 w. J% D  p# e    move into Q_induct2$ Q: Q) X! c2 e+ p2 ?7 M. }' B; L0 e
    move into pickaisle.induct26 ^& ]# X6 P7 f$ x' G
    while A_i<=30 do begin& F" i1 F1 s/ w: L3 a+ S* W4 R8 J
        travel to pickaisle.con(A_i)9 w+ J* w2 s7 N6 Q' e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) k: ~* n2 V- S6 @* v8 `        else wait for 10 sec
3 H7 T8 v, b7 e( p8 _, m        if A_i=A_leave then send to die3 W6 f2 g/ Q, q* Q3 w  n
        else inc A_i by 1
: N3 t# Z9 o) z1 M% e" T5 f    end% a) u" p- A: _5 E$ H- _/ `; y
end! k9 ^( a/ S3 O' x9 Q
5 e# v& h; w+ C; r- i
begin P_pick3 arriving
" m7 }4 y8 ~/ Z: `% y4 F    set A_i to 215 S3 O+ p: W  C, F! y
    move into Q_induct37 z- {; Y( L% d5 V
    move into pickaisle.induct3
4 V: A+ w/ m7 S+ D8 j    while A_i<=30 do begin
9 W; H- T6 b# k9 H  L3 \) C        travel to pickaisle.con(A_i)
/ n" J& c$ a7 C0 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  |. H4 @" w5 }" r4 R  e
        else wait for 10 sec) Y) P( i% [8 k
        if A_i=A_leave then send to die
' p% w0 t5 b0 U        else inc A_i by 1# M; o! k5 \2 O! @$ J* P7 i1 Y2 @
    end
( i6 _2 X7 K5 A. bend

最佳答案

查看完整内容

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是个什么东东?" b0 S) ^# z# F+ j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* Y0 S3 r" [' S8 N2 B
0 z% j" R' |. {9 }; g5 XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! }# T1 t* q+ l2 |# v
* _/ K% R& R; A. X另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 `( b& I5 d2 e  d) {% K& h0 y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 J: d7 ~# u% v! e9 M% L( `; B6 Y, t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 n7 {) r; W, L# g" p$ G3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: S) V& X" N8 |, d4 Jbegin P_induction arriving
) v! V* b% e  ]    clone 1 load to P_pick(A_induct)
7 z9 F) w5 i) d+ O' \. ^6 x3 Iend最大的系
( \* P( M* Z3 C' J: ~
6 F- n* {0 r. H6 h/ ?begin P_pick arriving* M0 O! M, |& ^( o4 r- z1 w
    set A_i to procindex * 10 + 1
. R9 i2 a  [$ Z! }, ~! l, [/ t    move into Q_induct(procindex)3 f8 L9 D: i; ]# G1 U2 T* f
    move into pickaisle.induct(procindex)
6 z, w4 l+ L) j( R+ Q  E/ q3 K- s    /*check the type of pickaisle.induct(i), for your last problem.*/
4 o2 k/ {6 a5 Q; e  B3 x" ^5 ^" F- y+ ^5 J: h4 ~* \
    while A_i<=30 do begin
( V' n9 d# D$ z) c- W) f( R0 I        travel to pickaisle.con(A_i)% ~/ w# C3 ?1 H0 ]7 J* D# g# ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- h6 U* ?/ w/ M5 P        else wait for 10 sec, u( b, P; L5 D. r# \7 j
        if A_i=A_leave then send to die$ o6 G2 ]! T0 @  L
        else inc A_i by 1% t5 A1 O7 B* S5 V7 H
    end9 n1 d3 ~9 u' W, W$ L
end) H; m0 l+ \- l7 g! k2 {# g  B

# O8 U$ ~0 ^3 l2 i) N+ `+ C  ~, z其中的procindex为整形,代表当前process的序号。0 z% u6 t3 f5 C8 s. l$ q
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-6-2 21:17 , Processed in 0.019698 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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