设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15663|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 B1 b' f: o  }- @! @. f; {( Q3 Q, G- w7 V, K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; O' A. Z7 K* y8 A& h
$ C, W8 [' y4 ~- h+ _, Lbegin P_read arriving9 X5 ]; I/ p) B; Y8 P% Y
    while 1=1 do begin2 f5 P- I7 x  k
        read A_tote from "data.txt" with delimiter "\n"% n. B8 Q. R9 T! I3 t  F) o/ O
        read A_time from "data.txt" with delimiter "\n"/ A1 s$ z7 X2 s9 n, k# e$ T
        read A_leave from "data.txt" with delimiter "\n"
4 U% Y" K- z, N. E5 m5 p/ h        read A_picks from "data.txt" with delimiter "\n"
& x3 w3 }$ Q7 q- E. y        set load type to A_tote
+ W$ B5 T* y, A0 k& c/ V5 P2 O        if A_tote="tote 1" then set A_induct to 1
* v" b- i. E1 B) P' }        else if A_tote="tote 2" then set A_induct to 26 ~/ h6 Z+ l( Q+ X/ Q
            else set A_induct to 3   
9 U0 e; ^0 P' t        set A_i to 0% T% o0 n( j6 N8 r" ^+ C
        clone 1 load to P_induction' T$ t7 s# R" h, r
        wait for A_time sec' o9 |3 I; h9 U8 d+ Z2 Z1 x8 Z6 [
    end
$ s, h# Y/ Q+ E# Iend
0 A( i0 R  H2 T# I1 x6 Q
/ h7 d/ A( W+ j  H4 Mbegin P_induction arriving8 [% o9 Q! \5 D. ?9 a- k; I0 H
    if A_induct=1 then clone 1 load to P_pick1
1 K$ |& Z1 K" ?* C% n, W    else if A_induct=2 then clone 1 load to P_pick2, o8 w. i% C2 `1 {
        else clone 1 load to P_pick38 ?/ T' u6 c9 @) _
end
- k( C1 _; f& f4 s. K5 Y
0 f( r9 p: D; jbegin P_pick1 arriving
: e( Y5 x* c+ T5 Y3 X/ j    set A_i to 1' q7 I) u, p& Z# |. G! j$ }/ m
    move into Q_induct1
' {: D/ C1 {9 E, g    move into pickaisle.induct1
& \  {0 W1 V( u0 W    while A_i<=30 do begin' q  G) n. y0 |8 {4 e, g( e% P
        travel to pickaisle.con(A_i)
& u) n5 `) R8 i' h  I, O0 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 u  H0 O$ c: ?8 m+ i        else wait for 10 sec
' {* h2 r- K7 a+ P1 q; Q        if A_i=A_leave then send to die" G! K2 W2 S! X2 D% B* |# U
        else inc A_i by 14 E& F+ q6 R; j, P2 S
    end
4 C" P4 L/ K4 q4 P: send
. e( d) }- ?. T4 d: \6 h- }. \1 X) Y. \
begin P_pick2 arriving5 h* E- q5 n3 t+ M5 J' X0 W
    set A_i to 11
* v& \5 Y2 Y( [9 j  G# f5 l/ A    move into Q_induct2
' M4 n  J1 h9 c0 ], X7 N    move into pickaisle.induct2$ ~9 w2 j: w8 L
    while A_i<=30 do begin  Z# s9 }$ z4 P: g
        travel to pickaisle.con(A_i)
/ i$ k% X# R6 R9 j0 G" `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; a; {6 `7 X6 \. O3 b        else wait for 10 sec) m# p8 I# ~& B; k
        if A_i=A_leave then send to die
' d' k" P( p7 V8 s7 e5 E# Q        else inc A_i by 1
0 Z) m3 ^' I4 L) o. F: K    end
& a. Q; k) l, @) Q) L. n8 Xend3 R" O3 }" q: q" z' X$ H
# C: T9 U% g6 K
begin P_pick3 arriving2 ~% k* I8 D/ p8 S1 v, Z8 R% o7 T
    set A_i to 218 X4 J. t( u8 C2 i+ P0 s5 q+ b
    move into Q_induct36 H" \- ?. O7 p/ l7 O4 W( v* H% {* L
    move into pickaisle.induct3
2 V0 r/ `/ o8 I. O1 a& ~# S$ Z    while A_i<=30 do begin
2 T9 X) g/ n! [. B' I) f7 x; p        travel to pickaisle.con(A_i)
, ]/ N( P" y* j' Z# Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, `4 d; M$ i2 c. p$ R- x$ x        else wait for 10 sec
( c! U) z3 r4 C  M        if A_i=A_leave then send to die
3 D+ V" C6 ?; d2 J2 @* H        else inc A_i by 1
( P4 x/ `( C! [    end3 w  Y+ U3 w+ f; K
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是个什么东东?$ _1 @' p. |3 I" {, c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* o% m7 P5 W  h' U8 b$ ~" H9 b5 M, V- v/ Q  ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 P# B! O$ F( o
) X/ [: h: `# R' y8 I* h$ D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ K' \6 Y* k/ q6 S# ?0 j' G5 S1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, ]& y9 E+ ]/ r. y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 G  b& ~. M; r- G0 G3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* o7 ]5 ?8 a% Z1 dbegin P_induction arriving  j4 m* B# F" Z" r  d9 U9 ]8 h
    clone 1 load to P_pick(A_induct)
3 G+ t+ w2 {  [. ?end最大的系# C8 D" _: l/ ?  E

& s  X1 C) R+ }2 @begin P_pick arriving
  ^- d( ^( ?' `! q& J, q    set A_i to procindex * 10 + 15 v- p% V8 t) M) \' y
    move into Q_induct(procindex)0 Y% W9 v! [# P) b/ j% w
    move into pickaisle.induct(procindex)& ~* M# ?. s/ l: o: e
    /*check the type of pickaisle.induct(i), for your last problem.*/! S' l) W0 W7 Q8 E2 M& O" o

8 b9 A0 G1 |" {    while A_i<=30 do begin8 e. l9 J% k0 {
        travel to pickaisle.con(A_i)9 x9 s% n6 Q- N. ?, u* Q3 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* I8 L8 b; q9 }3 {3 R* q9 g! J" t
        else wait for 10 sec
- A( `( M0 R& H        if A_i=A_leave then send to die$ P: P( G; c, x8 @" g! M, h
        else inc A_i by 16 k- y+ G% T: r9 C. ^; b, ]
    end# z1 U. n0 v: s* i3 H2 f! W  x
end
- Y$ h, O# b% n
% a6 v/ ], v/ W: m$ Y其中的procindex为整形,代表当前process的序号。
7 D) _" Q( Z$ g  b& Astation和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-9-25 13:44 , Processed in 0.017628 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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