设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13896|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: P7 y4 n- f) T, {9 x% c5 i0 }+ J& T1 n" e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ I" r7 I, F0 q2 I& o% ^6 D4 G* q, n' l  c) \7 ^
begin P_read arriving8 e, _8 W+ B7 z+ E9 l- B
    while 1=1 do begin
- J* l! e, u2 y* N: N# W: e        read A_tote from "data.txt" with delimiter "\n"
% W6 i; p) I+ H& |/ D5 t$ o3 b+ S        read A_time from "data.txt" with delimiter "\n"
0 z4 _. c, z, ?# H" h        read A_leave from "data.txt" with delimiter "\n"
2 A- |0 M# m7 z$ L        read A_picks from "data.txt" with delimiter "\n"
: x5 l' @$ W- p* t' u0 h: X  J        set load type to A_tote/ U) ^) H+ l; o: K- _! j2 S- d
        if A_tote="tote 1" then set A_induct to 10 \, D8 `6 d. V9 C  q, H( Q
        else if A_tote="tote 2" then set A_induct to 27 E! N) [: v$ O, E
            else set A_induct to 3   
5 C8 o0 \7 L: ]: d. v5 w6 t; W: ]9 E        set A_i to 0* I; P) B' r5 j/ h
        clone 1 load to P_induction
1 z- u7 a# x" @, |+ W! \0 X" y8 h, [        wait for A_time sec
3 w2 W% X( ]  L; _" N+ ]& @: e    end
  E: k: t( G) fend
  N' x$ o: l+ ]( U
) ?) I+ |) o. H) w9 `8 }begin P_induction arriving: C# C+ i/ b6 L" A/ ^+ f
    if A_induct=1 then clone 1 load to P_pick1" }- F; Q1 f1 h- R" i! z
    else if A_induct=2 then clone 1 load to P_pick28 _& D& \  ~, H
        else clone 1 load to P_pick34 I5 A7 Q3 @- y6 P" R$ f; A3 A
end
& h7 b7 B* L* {7 q" {3 o3 f7 b3 h2 |4 O
begin P_pick1 arriving
! M. A) Q9 y, n2 g7 y    set A_i to 11 u; y3 L/ ~3 o2 D+ \
    move into Q_induct1
0 T9 W$ z% }! X  f( ?% o2 z# d    move into pickaisle.induct1
9 P0 ~. `6 ^% L5 k    while A_i<=30 do begin
7 i$ t5 V3 f4 |+ D, S1 G. Q( @  t        travel to pickaisle.con(A_i)
% X: N3 E3 y' _5 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' \  K. _# d" v6 A! N2 a' a
        else wait for 10 sec
. y. [3 \1 F# G        if A_i=A_leave then send to die0 Z3 J0 \5 o+ }. [2 J& L. s4 p
        else inc A_i by 18 b+ \% J4 N. q& F# r3 e% V/ D3 \
    end
  U+ t, U6 s) ^. Eend
9 S) |# h* K3 z! T, A* v7 v
) i. @0 K6 N' W& ~begin P_pick2 arriving: R% B  A! ?) `
    set A_i to 11
" f6 B% j) ^$ G+ D7 A! a    move into Q_induct2" h4 r; i9 r0 s4 g
    move into pickaisle.induct2
0 P5 R( z3 k( n( S: R7 k/ t  G2 N    while A_i<=30 do begin0 M( I& {0 p' H/ y# B
        travel to pickaisle.con(A_i)# T# Z* V9 j; y, Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- [! O' d1 }+ J& k- V        else wait for 10 sec
9 L% o6 @. [7 f" m$ I        if A_i=A_leave then send to die/ u* [% f3 c9 j! X
        else inc A_i by 1/ R1 ~" m8 x% z. ?4 \
    end* c. l" K3 M0 C$ [& X" W
end- m& E+ g) l* Z' F; D" V5 n( x

$ W; n; Q' \1 a% P' x$ z: hbegin P_pick3 arriving  B0 {$ `& x' U( Q
    set A_i to 21
2 x# H2 E( x$ l- c8 p1 M    move into Q_induct3, l2 W5 \/ j% s( U- j! o
    move into pickaisle.induct3- H, }+ F1 p/ a+ f  y+ C9 n
    while A_i<=30 do begin
( S+ K7 V7 W/ a6 O+ \5 U+ k7 V        travel to pickaisle.con(A_i)
6 a% t, V6 d* Z0 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 W: u! I, ^- Y8 v+ \  J        else wait for 10 sec7 I# E# V$ d' P, z( S4 U7 b# d
        if A_i=A_leave then send to die/ ^7 E3 `2 z9 [/ C# n( d
        else inc A_i by 1
  s8 |1 i3 \' F! X    end
! a3 l$ A2 s; j* D  x3 t! `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是个什么东东?) s6 S' H3 N; [. M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: G* _: w$ p# E7 o! B  ]) Y% U
: Q- R1 f; {; T6 TAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, m5 z0 C' ?0 P" L$ V) |, ^
) a6 p4 O% j8 b2 ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ f' U7 F' V# H- ~9 i$ s. K& ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& g- i3 p) {9 ~" ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 Z- D/ K' U& ~  I6 b5 ]4 N3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! ^1 c( B, r2 Xbegin P_induction arriving- X: e4 j0 M1 x, \/ M
    clone 1 load to P_pick(A_induct)
5 k7 J' U, `" k1 D# [9 \end最大的系
: L, L( X" T0 `3 S
" N8 Z( Q& V% d* ]; Ybegin P_pick arriving: ?2 E% @9 a0 |
    set A_i to procindex * 10 + 1
% v' T& Z- w1 C3 F. @  |, E    move into Q_induct(procindex)* |7 }1 p* o1 l# s( X8 V& C
    move into pickaisle.induct(procindex)
3 e+ f/ w* Z2 ^# Z% \0 a/ V8 v, x! Y    /*check the type of pickaisle.induct(i), for your last problem.*/# E' `: ^7 j. M  |; H# \, F

0 W3 g" ]! q" E! i% ?    while A_i<=30 do begin, ]$ ~& U. x* z3 O* \
        travel to pickaisle.con(A_i)
9 L6 S. K# t2 q$ y4 P* i; y5 a; q8 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% l9 l; f. d1 J( v! Z$ s: C        else wait for 10 sec3 w: f5 R$ p- t$ _8 p+ u3 G
        if A_i=A_leave then send to die
0 q1 ~: Z8 F9 F- s& _6 M1 a        else inc A_i by 1( [) S4 z' q2 N" w! V& d6 i
    end, {, x: A9 M( L/ F
end8 W0 P' S* y& L9 p, Y

" L0 C. S4 |, a其中的procindex为整形,代表当前process的序号。) c0 a& B! R! s. Y; O; u
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-5-16 07:41 , Processed in 0.020929 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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