设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14769|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 a7 j$ `  `5 d0 X) b
! I! i% p; S% J9 g8 [我的问题是,在每个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 y% p2 n1 \: B- p4 m) m7 t2 Q
" L  S: k" Z, T$ s( l1 mbegin P_read arriving  y2 F- O; m5 e( L8 P9 x# D( E
    while 1=1 do begin3 u$ ]& {, Z( J* O) j; |) H
        read A_tote from "data.txt" with delimiter "\n"$ j4 @0 F5 Y+ b, D; [: N
        read A_time from "data.txt" with delimiter "\n"
" L; i5 D1 r4 X' Q$ @        read A_leave from "data.txt" with delimiter "\n"+ R; O1 L9 m; q+ b6 Z
        read A_picks from "data.txt" with delimiter "\n"
5 }' v" w, [" i6 Y5 ]2 a" }        set load type to A_tote( G# _7 U$ E2 Z: S7 M4 z8 Q
        if A_tote="tote 1" then set A_induct to 1
: R4 K1 t, \6 C0 u+ S( o! ]7 I        else if A_tote="tote 2" then set A_induct to 2
9 f, x  }+ `3 E* {' t6 U            else set A_induct to 3    + n; k# L( X2 ~$ r/ I% b, K
        set A_i to 0/ d3 ^4 K. A* y4 U) b. b6 w
        clone 1 load to P_induction) G, K. t/ D/ e# U- u
        wait for A_time sec, C3 i' f9 ?9 R5 D4 F5 p3 F0 f- n' K
    end
" O& W2 g2 G2 Z* ^end
- L. o' s2 ~( ?
2 v9 K0 \# G+ G4 rbegin P_induction arriving
( k0 g. v' o! C! u2 H+ I    if A_induct=1 then clone 1 load to P_pick1
$ l  F/ q- c2 }0 W    else if A_induct=2 then clone 1 load to P_pick2. y, o1 a# p+ `+ F3 k! E, ]
        else clone 1 load to P_pick3  s6 a8 B; b2 r) t
end0 ^" b- K3 ~2 I5 \
8 Q: U8 z8 s" l2 }! N5 H  n, t
begin P_pick1 arriving4 I2 Z3 Q/ ]2 U% C/ K! y
    set A_i to 1
2 B6 a8 n/ x2 t& D/ O. \9 u/ A    move into Q_induct1
: t! j2 G# m/ q* {0 b    move into pickaisle.induct1  O1 X; \% J7 L( |9 O# I# X$ \
    while A_i<=30 do begin' T) p! _, H- O/ h' H
        travel to pickaisle.con(A_i)5 u$ Z3 b% \5 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' X( [& b, o7 {        else wait for 10 sec/ e( Q3 u/ F2 Y! n3 |
        if A_i=A_leave then send to die
5 ~+ j* E$ e! n9 B        else inc A_i by 1' R* s+ h* K0 {
    end
6 M" _( ^& h. X$ \- M" z$ s3 [end
$ w5 Z# Z: [6 v4 u, y; [8 T  e3 o' O7 ~4 r# x) @6 R. h# a
begin P_pick2 arriving
# g: i$ O9 P1 A) H    set A_i to 11) J) }9 e# H/ \- g0 l; P9 R
    move into Q_induct2
" i! H1 @8 P. d8 C    move into pickaisle.induct2
* t+ ~6 M! t3 d: `: x' R    while A_i<=30 do begin
1 ]$ r" _* S8 T- V" _6 ]. {1 S$ z        travel to pickaisle.con(A_i)/ R% f! n* l6 i* ~' o+ B; q. `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _' @# \0 O: @+ U( R
        else wait for 10 sec
' O) m* u' D- i, B0 f        if A_i=A_leave then send to die
' H3 ?: S3 A- b: ~! t        else inc A_i by 1  w* w) I) r# A4 t+ ~, c7 f
    end
( L0 y$ a* ~5 _" I# _end* d; v$ |) i0 X7 N+ C( b
! \1 z% F$ V% [: m% w
begin P_pick3 arriving. u4 V0 m: b" A4 l/ a. G
    set A_i to 21
- V7 ]' X9 O, L. ~& G4 i    move into Q_induct3
" D- F) [% v) @$ F& o+ R% W) E: ^    move into pickaisle.induct3% z  ?0 a4 ~# u
    while A_i<=30 do begin1 I; b1 M9 ~" f' o5 E$ z& T- U
        travel to pickaisle.con(A_i)  c/ i$ a$ r. L0 s* t7 e( w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ t7 R+ Y+ n  }' F& A        else wait for 10 sec3 C- M6 Y% e" ^+ s
        if A_i=A_leave then send to die
* E- z, m, \7 K: i        else inc A_i by 1. J" [( y. M$ ^8 a2 K6 y
    end
# L4 G. s- h: ]7 I4 Send

最佳答案

查看完整内容

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是个什么东东?" o) q, H+ \- L$ t% x* m* c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 I0 }8 X: x/ Q1 C( U8 s* ]6 d5 _6 V

/ [) P. i, b( V6 t* F- q3 SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 w8 i  i0 U- ^* d- P
' ]/ J/ T, Z. I7 }; }( M/ h
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( V5 R+ m+ p$ m  i1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) n3 k9 ?6 S: i5 B: d6 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* F& `1 K% f7 \4 T5 Q+ ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) G; o# s" A9 J3 E$ x+ B1 p0 P2 K
begin P_induction arriving
$ D% y4 u1 X# Y% ?    clone 1 load to P_pick(A_induct)5 d$ J# {+ X/ L
end最大的系  F3 b8 @( U$ q# z

2 }' |$ Q8 T) g4 a+ u+ @begin P_pick arriving
* |: }3 K6 Z# R" w; N    set A_i to procindex * 10 + 1
$ j% I. h5 L4 X) ]$ p$ d    move into Q_induct(procindex), @. t5 i. K: T! @
    move into pickaisle.induct(procindex)$ T6 s) E1 l) R8 ?* S$ _) N( M
    /*check the type of pickaisle.induct(i), for your last problem.*/
; [- F  Z% J0 ]$ B+ v9 T. U; @* p1 ^! y
    while A_i<=30 do begin6 Z+ g3 P8 |+ D5 o
        travel to pickaisle.con(A_i)3 \, X/ p7 z! H/ |( ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 m4 q2 p3 y% [/ {8 l( [% T        else wait for 10 sec: D& Y! y- J' u% k" i
        if A_i=A_leave then send to die
# J! l: B! M4 D        else inc A_i by 1
& M( ]# b' S  V    end
6 i8 x6 y7 b0 w' I6 hend
- h4 T/ y% j+ n8 m- w/ O2 O# I+ m* N; E: b0 o* N7 o
其中的procindex为整形,代表当前process的序号。
2 b  x2 T5 b. z. c( p1 p" L& istation和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-7-25 23:52 , Processed in 0.012653 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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