设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12694|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, w# O, j& z0 F, Y( s1 ]8 n1 V4 ?7 T5 x  o4 |7 j( S0 z1 M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 S1 t& h7 B% R- J" M

, \5 I7 ~2 t/ Gbegin P_read arriving* s5 R2 ~. y) X: y$ ^4 h
    while 1=1 do begin) o3 X7 t' A0 ]& P7 G0 N+ u
        read A_tote from "data.txt" with delimiter "\n"
+ j1 H' h" G3 j% G; S- ~6 E" b        read A_time from "data.txt" with delimiter "\n"7 _; X1 y, R1 U1 I3 P' f8 {* y
        read A_leave from "data.txt" with delimiter "\n"  W, j( ~2 e0 p" Y  B' r
        read A_picks from "data.txt" with delimiter "\n"
1 Y! V# ~3 o8 @  K, o% J/ ^: j        set load type to A_tote
+ M2 x7 v0 s, |8 s1 j" }8 P        if A_tote="tote 1" then set A_induct to 1
. T0 l6 W# `- o7 c7 Z( S) K        else if A_tote="tote 2" then set A_induct to 2
: X3 ^1 u) r# k% @            else set A_induct to 3    8 H' g9 h! Q& I! h' `& y* {
        set A_i to 0: a5 \4 b# ~3 H) X; z3 d! I
        clone 1 load to P_induction
- B! n+ w" O8 ]3 q! ^        wait for A_time sec- \; Y3 w6 V, h- S  C( ^( }5 z- N) Y
    end
+ e& L8 j) a, U1 y& Send, K/ r/ E" n! D* o# r
8 ?# a( n' Q* k6 v
begin P_induction arriving+ y( R0 c: h" ~0 e5 u0 h
    if A_induct=1 then clone 1 load to P_pick1. R6 o8 d1 t- k. y
    else if A_induct=2 then clone 1 load to P_pick28 C% n7 W  Q, {. B5 d5 ^
        else clone 1 load to P_pick39 c0 c! N' _2 }- }, G" D7 V% z
end
, D+ t9 a! I, P, r# b$ S" `
* D$ }1 T! ]: Z# d( i, Ubegin P_pick1 arriving
& A" F3 |! @3 z* |) [4 W- [    set A_i to 1; {6 U* ]5 t' u' \) L* `
    move into Q_induct1
# L) o5 V7 u3 u    move into pickaisle.induct1
5 U3 X, A6 y( n- E    while A_i<=30 do begin
+ P" v- a' U& S5 w4 {        travel to pickaisle.con(A_i); `) T# N1 @7 V+ c7 p  w* r5 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: t4 ]1 a/ d9 [" J  {
        else wait for 10 sec
9 E" \' `# F3 a2 E        if A_i=A_leave then send to die7 h7 g+ I4 k6 @6 Z$ g4 d; d3 Q
        else inc A_i by 10 L3 K+ \# H, o( c
    end
& d! I& ]9 \+ u) W( f8 aend2 S1 N$ s/ W( g- R  d
6 S* S; e, K& a2 `( f0 j& K& W0 R
begin P_pick2 arriving
& O5 N2 o+ c, I& p& ~) ?- n    set A_i to 11. r% ?: a. o+ r
    move into Q_induct2  `- u. w7 v" w1 z4 A& c1 B
    move into pickaisle.induct2
+ j- G, x3 w2 o/ T0 L    while A_i<=30 do begin7 G2 R* x3 h* P7 \. o8 M
        travel to pickaisle.con(A_i)' Z$ n+ g2 M. p+ [1 P) e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ^4 n2 s; e0 O1 `        else wait for 10 sec& T! J  a( C/ ~4 v% e; P/ L: @* J
        if A_i=A_leave then send to die
- {# ?5 \( v8 D4 E4 a/ x        else inc A_i by 1
5 E& ~0 {9 a% ^2 u* p8 d1 e    end
5 @* e7 d0 O% A  Qend
1 g" o# Q' ^, l, P, `! ^/ I0 Z# F/ j. ^  T; d( t4 j- t
begin P_pick3 arriving$ W* Z. y/ [: Y& W2 Y: q
    set A_i to 21
( L/ k$ t" I: f* q& O    move into Q_induct3  E7 ~* I% O0 n0 {2 n( ^5 f
    move into pickaisle.induct39 U" g5 S2 s* L* `' D
    while A_i<=30 do begin
4 y2 A  C3 C. [        travel to pickaisle.con(A_i)
+ a& I  W9 \( \$ Z& j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 R- @) A: m' C7 \& x+ m1 u
        else wait for 10 sec3 x+ l( Q! d9 G! f! J) n
        if A_i=A_leave then send to die
, b( d- k" v) W: c        else inc A_i by 10 ^) K! F8 ?0 s3 i/ W2 I% Q
    end. e  I' L1 s; K; n/ r
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是个什么东东?7 w7 J2 W7 x3 Q. R% Z6 u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" ^) ^; W; P: G+ U% e' W
2 c  v, |5 o* `7 A4 d) YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% N) E5 }2 Y- D. ?, c" Y; q
' }# Q! y" B0 B, D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 _8 ^7 M6 V2 g8 Q' @6 Q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ [+ T& K. b8 J8 G8 M  W( i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 w6 S3 l" W7 j6 s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 ~/ P: n1 b( _$ A' bbegin P_induction arriving
# n: M% F; i/ w$ Y- A* G" k; k    clone 1 load to P_pick(A_induct)7 H: [& Y5 v- N0 }
end最大的系+ x8 q" e% w% O: Z4 j4 {

+ I5 a6 h# a- o, Lbegin P_pick arriving
' J. y& d9 k+ o  V* S    set A_i to procindex * 10 + 12 m$ u9 ?5 i" S6 S' a
    move into Q_induct(procindex)0 t9 n& L; i& ^1 h" x4 F# ^
    move into pickaisle.induct(procindex)) {" G$ ]5 _9 V: u( w
    /*check the type of pickaisle.induct(i), for your last problem.*// q8 ?$ p6 X0 x: \! ]
3 S# p  L" R, L5 D) P4 q" e; b
    while A_i<=30 do begin* _2 S, j6 u  N' \
        travel to pickaisle.con(A_i)6 h8 f) f( t# p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 n( }5 o  ?6 g  {( E7 w/ T& d
        else wait for 10 sec
, H0 p, d  F8 b% m1 W- g        if A_i=A_leave then send to die
! g" l+ \- F1 N; C$ j        else inc A_i by 1
9 ~! a0 ]- {) f$ S    end
+ c0 s) _0 n: o1 dend: u/ z# ~4 v- s+ F3 x9 b) r

$ q+ w9 c; t6 q2 f6 L; n其中的procindex为整形,代表当前process的序号。$ W+ l$ V% C  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-2-11 06:22 , Processed in 0.023566 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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