设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13695|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 ^  u0 ~# u8 f) j/ n
2 m7 q4 m, q* a1 r我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! {: K8 y# H5 @& X8 E0 x1 b% G
! J9 w5 V4 _7 H4 B" Ybegin P_read arriving$ B  O2 f4 I1 `- S5 [$ T% M
    while 1=1 do begin: `6 z$ i( r: W; u+ v
        read A_tote from "data.txt" with delimiter "\n"& n+ F+ h+ U2 k0 K4 Q, M7 n- [
        read A_time from "data.txt" with delimiter "\n"
. m. X1 C+ }8 |        read A_leave from "data.txt" with delimiter "\n"% D- G2 q. q5 ~8 f, Q! N/ E
        read A_picks from "data.txt" with delimiter "\n". R! I( f4 s5 M- `9 ?
        set load type to A_tote
& e2 D/ G5 B9 J, ?  B        if A_tote="tote 1" then set A_induct to 1' m: A; G3 c* g7 }, P
        else if A_tote="tote 2" then set A_induct to 2
( Z2 x2 F- \% ], ?( o- l+ K            else set A_induct to 3   
) V5 w! G4 A: j$ P, r; T( y        set A_i to 0
; f, m1 H. w/ d        clone 1 load to P_induction
. ^7 }( W& p- j* c        wait for A_time sec' ~1 G5 n) i$ s
    end
; p" R, w. S9 [- F8 f* x' `/ ~8 _end( n, L, H7 ?* a0 Z6 A& o

9 c( j" q. X1 Z  ibegin P_induction arriving
& J# z9 H. @* d0 O/ b: B    if A_induct=1 then clone 1 load to P_pick18 B4 D0 x: m! d. k" {
    else if A_induct=2 then clone 1 load to P_pick2$ {3 `$ o6 V( F% J& K7 B
        else clone 1 load to P_pick3
; b) }/ t6 a, {6 t% vend
8 Y5 b: L. O0 E$ I/ U/ b2 G! X% A' |* Q) I0 D$ i3 c' ?
begin P_pick1 arriving
1 S' Q# I! @: T5 R: f+ k5 K    set A_i to 1
( ~- i( C5 D$ A  |3 {9 A  ~    move into Q_induct1$ {2 a! k  N- w# T2 f
    move into pickaisle.induct1
# n+ |) ~8 g# ^( E* \    while A_i<=30 do begin7 q0 q& x- d# |! v& c& U
        travel to pickaisle.con(A_i)
9 G* ?: ?! a4 V" `% a' r. U8 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ q$ N2 c% H; f2 r) [6 i        else wait for 10 sec
0 Q& S3 @) Q/ r# Q3 }7 T) Q- n        if A_i=A_leave then send to die
. _* U! }5 p) C9 S        else inc A_i by 1
$ x0 Z+ e& ~0 j* r$ s; T    end
' H9 k9 B' j8 u- c. ?: ?9 K* Cend. F+ T' J% |6 P2 h) q$ _$ b, B  y

# i# {) p' p! c5 kbegin P_pick2 arriving
, `5 u8 |7 ~7 O' L5 m1 f    set A_i to 11$ |  o9 `, N" Z8 `
    move into Q_induct2
4 i) z6 O+ h) Q  Q2 p    move into pickaisle.induct2: ^! D: e, V+ L1 f: \1 E: r
    while A_i<=30 do begin
/ j8 X( Y) c1 ]4 p        travel to pickaisle.con(A_i)) q, y- S: s& m. S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ t; W3 \  v3 r( a2 A4 A& v: f
        else wait for 10 sec6 y3 k3 K7 a' }: F6 k; ^. M
        if A_i=A_leave then send to die
( ^7 _! o$ O3 {# G' O% u% E8 Z        else inc A_i by 1! X. i( s4 O- j. ^. m# I
    end
7 q# |+ x+ t: s6 }7 T. Fend
$ N; m8 d$ c% [* P7 z! K; T, Q! a  ~5 v
begin P_pick3 arriving* q! d3 h  m7 e. E- N
    set A_i to 21
* ?6 e) n9 z) I4 \- B# F; W: _( A    move into Q_induct3
+ y3 X% O) w0 e1 d5 @" U- ?    move into pickaisle.induct3; O0 ~2 u$ R. P% V' V4 h
    while A_i<=30 do begin$ a0 t0 f. A! U: N
        travel to pickaisle.con(A_i)! s0 F$ E5 Y' K- `3 T. Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Y% k$ g1 P6 q: Z& N4 s
        else wait for 10 sec% z+ X7 c; K; o3 Q  g
        if A_i=A_leave then send to die. ^( ^% k6 c! N
        else inc A_i by 1
5 P; g, a  D4 E$ ]    end. m% E% K, x! [& r# }7 R: A
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是个什么东东?
; W6 d2 \3 X# t5 S( w/ s1 E& }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ @, b9 w: H# s

0 t# a3 D' R( [( b9 fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* P- Q- d( x# S: ?
3 x- B" [  p; t( y9 c4 b
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 ~' @) c/ I( ?, \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 B1 U; _# N3 @4 I2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* N5 d" f0 m4 g+ e% ?/ A% i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. M7 H3 E! r8 q3 q/ h- n8 u( O" e
begin P_induction arriving
/ l2 Z2 G9 q! H' {2 o    clone 1 load to P_pick(A_induct)$ f9 k6 G7 ?% j* q. p; c
end最大的系  ~6 }9 o5 F* ^
7 v& {, X' q* D
begin P_pick arriving( a) Q$ `3 q. v0 A8 \+ k
    set A_i to procindex * 10 + 13 x$ W' l0 l; N1 T* Y, c% a- Y$ L
    move into Q_induct(procindex)0 J% x) I7 L2 I) p
    move into pickaisle.induct(procindex)# _) q; m' d0 E8 F0 D/ @% d1 y9 W: K
    /*check the type of pickaisle.induct(i), for your last problem.*/
* A/ z" O% L) }% ?4 Y  |; z$ L9 B
$ F# ?% i% M1 w8 D. s    while A_i<=30 do begin# ?/ K: b( Q- B) \
        travel to pickaisle.con(A_i)
; {9 {# B( ^! w% E& M% n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ J# D, Z, O. |        else wait for 10 sec5 E1 }9 n3 g* f% e: W0 Z
        if A_i=A_leave then send to die* w/ f; M9 B: i) t
        else inc A_i by 1
! a! f. E; T4 b2 q    end( `& ?- t7 _+ @, n" B
end, L5 ~  j. U. X+ i8 r3 H2 J  h' @+ S

6 e$ ~0 f; T3 F0 a其中的procindex为整形,代表当前process的序号。5 r" T0 v7 c: L( V% a5 |8 J: i: X
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-4-29 10:34 , Processed in 0.020608 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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