设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12732|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  f9 _3 ^7 m6 }9 a, d! a$ s
7 p& H! v0 C; ~) D# {6 m- c( v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" h0 I1 @# J( b9 w+ t9 ]

1 F# G1 j! m3 ^# \- p) |8 s8 Jbegin P_read arriving
  e4 }! ?% O( f0 U    while 1=1 do begin, m2 A* l' O; B/ l4 S# U
        read A_tote from "data.txt" with delimiter "\n"
2 O% O& M0 G# _; O        read A_time from "data.txt" with delimiter "\n"9 ]& G/ R8 \0 {' R! W
        read A_leave from "data.txt" with delimiter "\n"
( G( O2 D% o7 ?' _4 M        read A_picks from "data.txt" with delimiter "\n"
$ s1 |7 B, Z0 S0 K0 A, m6 h. L2 _: \        set load type to A_tote; E( {) d+ a. n& c1 v3 Y
        if A_tote="tote 1" then set A_induct to 1
; u% P" p0 }- U. @) @7 p& r) {        else if A_tote="tote 2" then set A_induct to 2' W5 T) Q) u( h; i& J  h& K
            else set A_induct to 3    ) W  `4 E0 W' D3 }! w
        set A_i to 0$ @# l0 j0 a# {4 F8 U
        clone 1 load to P_induction
+ e- U1 ^$ q- `' r& \* v        wait for A_time sec
( K4 C! K: f. v! W, @    end
: u, A8 e* b# {0 c/ Z8 y* Send+ A4 s$ Y% @  \8 a' e8 ^4 v: t

. n, i5 d, p9 x! }% Gbegin P_induction arriving
- o- |* u; q; t1 `: P    if A_induct=1 then clone 1 load to P_pick1
% i; t8 u; o8 [' k7 E    else if A_induct=2 then clone 1 load to P_pick2
% e9 g" ], X# s* d        else clone 1 load to P_pick35 t) j- _0 h* x* E# U! D
end
$ \1 I3 Q5 L) {
# ~# q, t: A9 d! B# P( bbegin P_pick1 arriving. D, s5 c. g2 L3 q8 W
    set A_i to 1+ `# A& Y6 G- D% Q  Z
    move into Q_induct1
% i: v) n0 B- U9 E6 G) Y    move into pickaisle.induct1$ m- E9 [) n6 J/ T
    while A_i<=30 do begin$ \7 q% d; k$ K! r
        travel to pickaisle.con(A_i)
; D6 W2 Y4 x, b, o; E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# F0 g0 p1 E, k        else wait for 10 sec
8 ~" w* {, h/ g, E: N! S6 T        if A_i=A_leave then send to die( d6 P2 c+ q' E! q
        else inc A_i by 1
9 H: Y7 x+ ~- H3 [    end/ X* [2 e  N7 K- m* _+ r
end
# I! j! x3 b1 U- k4 y) j* M" w6 n4 p% g; V9 a& j8 W
begin P_pick2 arriving
9 ]; x: {9 E, Z9 q$ U    set A_i to 11
5 v# }# U( U9 g# _; r+ c    move into Q_induct2
2 |% f& o9 c) ]% d5 s    move into pickaisle.induct2
  P+ ^( k, K0 |1 t    while A_i<=30 do begin
& @3 _( f+ [) w* Z! V1 @3 |2 W; v        travel to pickaisle.con(A_i)
; ~& ]/ w: ^4 c& M' K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 G3 D9 @) c  ~        else wait for 10 sec
8 d% r$ j' F5 W4 d, \  R) \        if A_i=A_leave then send to die# U  |; m4 p& ~3 u# V8 F: E& Z
        else inc A_i by 12 K, H( V' b* m4 c& `3 I
    end
; Z* L0 S: Q8 F; u! |end' W  K+ x) [! M$ x+ Q! O. I$ T/ f6 F. X. ^
, w4 T1 w$ n3 C3 {# K
begin P_pick3 arriving
! X! H/ W, m. \8 |, t    set A_i to 21/ A9 N8 P. f5 ?9 Q! z
    move into Q_induct3
" V# L( @4 ^" Q  {; P    move into pickaisle.induct3. n/ X! w4 q+ ~( ?3 ?
    while A_i<=30 do begin* |6 v" u5 w0 }4 l' T
        travel to pickaisle.con(A_i)
9 o7 b. x6 K* W  i3 _. Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M7 r# \: `8 m" f9 m5 x( R8 H        else wait for 10 sec
1 k% i- K' S' i: W0 ~8 u/ z9 `        if A_i=A_leave then send to die7 k7 a# s, F2 R, c
        else inc A_i by 1$ J8 p" J6 F& L; m5 |% K1 ^
    end" u( P5 g7 }8 G; E" B% Z$ Y" S
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是个什么东东?3 {/ b+ R  ^- _2 U6 _8 ?  x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 Z/ a' |$ K# q% h4 x: H. ~0 `

" n2 A* S! s5 ~2 u; jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- o# O/ D" c# a' t4 Q. w- S$ t# e8 u! x' Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 E6 m: A7 c/ I% r8 U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# n& Z! ?; o( Q% F# G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' J* L  o# q, N+ D2 _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% V  c* [/ E! `9 Ubegin P_induction arriving
2 r8 @' W& Y9 A  [4 O% x: }  _5 p    clone 1 load to P_pick(A_induct)
! n7 r# }9 y3 ?: T% Z9 Kend最大的系
+ K& }  t6 x6 c5 s  D9 V' y, R, c6 D1 B, ]2 J4 N# b# M  N
begin P_pick arriving# B) F' v' J6 s* v
    set A_i to procindex * 10 + 1: i- k2 O5 q8 ?' [1 X; Q$ g
    move into Q_induct(procindex)
8 j& p. T! g: l: o7 Q6 g    move into pickaisle.induct(procindex)
- N! y7 z( P3 @. k    /*check the type of pickaisle.induct(i), for your last problem.*/% m/ e  R. I# L) @2 s+ I3 A3 j
6 T2 ?; r" q# m, s
    while A_i<=30 do begin0 n. S) [& v3 l
        travel to pickaisle.con(A_i)
1 I% k/ r+ E4 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 t4 n# u  q4 ?, g5 H        else wait for 10 sec
. T9 l$ z( R' e) j2 Y% ]. n4 f        if A_i=A_leave then send to die" w& v0 C) z, ^6 K' T
        else inc A_i by 1
- w9 L, o' ~% C. w    end
$ G( M& B% {$ c5 }; fend
. b7 r% n3 u$ v0 {0 t4 ]1 ^9 C8 {6 Y
其中的procindex为整形,代表当前process的序号。
$ m, j2 ?! }# Xstation和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-15 12:41 , Processed in 0.014864 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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