设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12680|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. s$ h3 }0 H1 D+ }$ [* B7 {

# Z; ^" O. c+ n9 Z. y  t我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 U3 _( i. a+ Q3 W$ a$ B

! M4 v8 A& F0 S5 t6 \% ?4 _- ?begin P_read arriving
) e& r. B7 E3 C; X- Y: H    while 1=1 do begin
- |4 N6 n) T" @" T' ~        read A_tote from "data.txt" with delimiter "\n"" L  r& @: U& H% I& k
        read A_time from "data.txt" with delimiter "\n"! x; d/ V3 _% T& A9 i, ?& @6 @) h
        read A_leave from "data.txt" with delimiter "\n"0 \. U0 G% W1 g5 j7 |
        read A_picks from "data.txt" with delimiter "\n"6 F9 e( n1 P7 O7 K
        set load type to A_tote: Q& p5 s) H9 W: z5 {% W
        if A_tote="tote 1" then set A_induct to 1
( M9 L1 x' N! n6 L2 ?        else if A_tote="tote 2" then set A_induct to 2; h* g( l" J3 x5 p2 v: y# }# O/ ]6 ?8 [% J
            else set A_induct to 3   
! S6 d: ]3 z4 F        set A_i to 0: B3 _# f7 }$ {
        clone 1 load to P_induction
( S! B1 l9 z7 ]6 u* |- w        wait for A_time sec
2 P( H+ e) ~4 j( f7 l    end; P7 s4 ~  N% Z& ~1 Y6 f( }% l
end6 ~$ \; ?2 j% Z

$ `$ p" S3 e0 }/ o/ I" \begin P_induction arriving% p' w0 R& t5 _/ C1 L% ?5 o  k
    if A_induct=1 then clone 1 load to P_pick16 J; I! j8 `, X7 R2 Z! ^
    else if A_induct=2 then clone 1 load to P_pick2
# H! }2 e- }9 X8 F( ]        else clone 1 load to P_pick3
2 w: U: u" u" N$ Mend' X, ~7 Z: V# w+ Z$ K0 Z
* g/ Z1 a6 ^; d4 O0 T9 L, e5 j
begin P_pick1 arriving$ \5 l! _% b* ^8 }+ W* H
    set A_i to 18 i% ]; l0 F" J  k
    move into Q_induct1+ t( V6 Z% n2 S6 U: m
    move into pickaisle.induct1& V/ x( R4 Q6 B
    while A_i<=30 do begin
/ m" x, W/ g; E, J+ v  B        travel to pickaisle.con(A_i)
( R: _; q6 C& A$ j# S0 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" y! m. l$ `' o0 l$ `( e" }
        else wait for 10 sec
) Y' t# n# t0 \; w/ u        if A_i=A_leave then send to die" h' f5 I3 o( d; o
        else inc A_i by 1+ p. @- P; W& k0 b
    end0 U6 s0 z$ J' N
end. I' V3 t  e- a* O0 p4 ?7 W9 I
7 ]+ U" c& z* a1 x+ L  L
begin P_pick2 arriving
' ^$ z9 R* H4 ]+ _+ i8 V* K# t  u5 U' p    set A_i to 11' J7 P, {( {7 Y2 W9 e. i
    move into Q_induct2
+ A9 n% O* |* f5 B5 h# P    move into pickaisle.induct2
) U5 `# T. b4 O# n7 ^    while A_i<=30 do begin. g9 t. j. L# m; v8 S
        travel to pickaisle.con(A_i)
7 F/ T( ]! |& K' N& d; j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 l( e- P7 l$ N        else wait for 10 sec
1 d/ b: f, A& @$ @) E8 a( k5 W) c% f' C        if A_i=A_leave then send to die
6 _8 k! ^$ |% Z% o9 Y- \        else inc A_i by 1
1 o  d5 d, N6 u    end! h9 X9 V% O$ I$ e1 q
end9 _5 I2 z1 g  I+ y9 I
% m% L5 G7 H! b# |) K+ x- ^
begin P_pick3 arriving( L3 j! B+ v" M( d( Z: c
    set A_i to 21
9 H, J, j: M& v  I# @' ~: e    move into Q_induct3
3 E2 T2 L7 q+ y+ `: _0 w" l    move into pickaisle.induct3% ?! x/ b+ [8 P
    while A_i<=30 do begin
/ `+ A7 t) T& r  d+ B        travel to pickaisle.con(A_i)' ~( K8 p7 l; a1 o# J( p$ v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 z3 m; T8 r7 o, {4 W1 X        else wait for 10 sec
/ n7 U% y& g+ s/ Z6 {- r0 h- P        if A_i=A_leave then send to die
: i0 R# P9 P- k9 K- M3 B& h        else inc A_i by 1% X5 w* T. H% y7 b" ~  P& o
    end9 h$ b% h$ n# J7 ~
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是个什么东东?
8 p6 `; P( y: H1 ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ @. {# b6 Q. T
* ?& W0 n3 u. K$ R/ y" d. [
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( J8 f1 V5 C- |, @2 P6 H
9 e7 h* }7 \% f+ I) V另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 c, m' g6 J& p' d( j: L1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& T7 X! Z/ Q# r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: s  m, r1 @1 @$ Z& w  [1 h: F7 K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' W5 E/ |/ v# r8 ~0 q
begin P_induction arriving% T, C4 E  h: O) V; N. b
    clone 1 load to P_pick(A_induct)$ T7 \# u  x. `4 S3 E, \( \# M' J# e! B
end最大的系
& ?, q' ?# D3 N4 d6 C" P. q8 z$ g& }: W# I0 g$ y
begin P_pick arriving6 p# y* w1 m. b  E" J; z; r, Q, \. @
    set A_i to procindex * 10 + 1$ \# Q4 W. }! O7 Y% ^; ~
    move into Q_induct(procindex)1 ^5 I$ Y- F' c) p0 p2 `
    move into pickaisle.induct(procindex)
7 o) _% k4 T% T& y" L$ ?$ @    /*check the type of pickaisle.induct(i), for your last problem.*/
+ T# R2 U2 Y/ N" y# G, g% t; J0 u' A
3 F' ^- k, m1 f3 v% R/ s" o+ S6 x    while A_i<=30 do begin
) P1 }4 [: y( y- ~+ w9 P$ h) m        travel to pickaisle.con(A_i)
( j  o" ^5 ?+ \5 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 [1 F8 X. w, K/ ?
        else wait for 10 sec( b8 V3 G6 z; g' f9 U
        if A_i=A_leave then send to die) ]2 J5 T8 }  C3 B6 R: W
        else inc A_i by 1
" E7 R% u# U; l" _* [    end+ ]' @. |5 ]# ?% B
end
# U# H! ]1 {% k& H& M1 a! `" R( @6 e/ D+ A% Q/ r/ d
其中的procindex为整形,代表当前process的序号。
! Q+ k+ K9 F& P# a* ^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-10 08:11 , Processed in 0.017046 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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