设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13005|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  d4 r  E, q8 H; Z) J3 n9 k
" [& V6 R' Q- I; t6 g我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, E) P& y  y( ~
' B( J' F3 q% k6 A4 n+ tbegin P_read arriving
' M4 ]5 v2 l4 ?. ?$ ]' c3 b& C1 ?    while 1=1 do begin
& ~$ h( w/ @4 F' S. O2 R0 r$ l* h        read A_tote from "data.txt" with delimiter "\n"! t0 |( {# o1 N) Y0 e
        read A_time from "data.txt" with delimiter "\n"
0 V. i5 n% ?) Y; ]! r4 @, W        read A_leave from "data.txt" with delimiter "\n"4 O1 F6 v9 u# P3 `
        read A_picks from "data.txt" with delimiter "\n"- g, {. {& S' r5 W& v. w; R. T
        set load type to A_tote
& x" h; T- B6 O1 o) R( q! z        if A_tote="tote 1" then set A_induct to 18 a8 K  s! P; c1 Z3 E6 y
        else if A_tote="tote 2" then set A_induct to 20 `- _9 c) ~# G2 C9 z' J! a
            else set A_induct to 3    6 T# B9 A5 h& ?
        set A_i to 0
. h4 L& }, I) D" ]: ~  i: ]        clone 1 load to P_induction
: Y0 Q; R9 Z! M& h2 |: K        wait for A_time sec" v5 ]/ R, t* p% K7 f
    end
2 p. K, c$ }- k5 ^end
. Y* z/ g* P7 A* ]2 X
  ~7 I& v% V; `begin P_induction arriving0 [0 _+ L5 \- C! J$ E9 h
    if A_induct=1 then clone 1 load to P_pick1
7 M) L1 B2 n1 Q5 W7 o9 j3 r6 x. A3 q    else if A_induct=2 then clone 1 load to P_pick28 M% c9 b7 a( ^9 E% q& @: D
        else clone 1 load to P_pick3& y& S" U5 z8 a
end
  w* _# P% Q, H' Z$ w. q6 ~' s: P9 V% i+ u6 S8 j4 q9 n" H
begin P_pick1 arriving
; o+ ^% V9 {! o  E1 a$ S    set A_i to 1
: I3 I1 O+ p) K- k% n) H! j    move into Q_induct1
" S9 y* K9 G2 z$ E, I' _* N% f- B    move into pickaisle.induct1
0 c) n" R! U/ u; L    while A_i<=30 do begin
. u% z& O- @8 |        travel to pickaisle.con(A_i)
' X' Y& |& ?* z4 _  g( v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 p+ H* n; {1 f1 g
        else wait for 10 sec
; |4 s/ D$ y. D8 K        if A_i=A_leave then send to die
' I/ p6 L9 d/ X# ?9 ^        else inc A_i by 1. }) {1 y! z2 T+ ]: }4 t+ H
    end
% ]' A0 O' v8 }4 `end7 E2 H( N* a+ @$ I7 f; g

$ _% a- }  N/ Z" G( I9 i  Hbegin P_pick2 arriving
. @' O$ v7 a! N    set A_i to 11
+ u+ A1 M# \! ^4 z( ?    move into Q_induct2& |/ F/ F& y" H
    move into pickaisle.induct2/ v' |* W  Q! U6 S4 p+ W- k
    while A_i<=30 do begin9 m, g( I9 d, q- Z
        travel to pickaisle.con(A_i)
9 b) ]# e0 J5 k' l2 {: J% w: {3 n+ y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, v2 d" L$ |$ H2 d. r3 E; w" w        else wait for 10 sec& d' ~) k) B8 _4 m/ k
        if A_i=A_leave then send to die0 @1 D3 D) W; G! K& k$ v. e  U
        else inc A_i by 1
; x! H7 F0 j8 G$ R, `8 \    end
" W& {+ d+ @% w5 n. E: zend8 k& F$ j2 h6 g" P/ [

6 E2 T; W, X  @begin P_pick3 arriving
1 n) f" h! j' w$ D) n+ n3 j    set A_i to 21/ B2 H( d2 v- u: p: h7 l
    move into Q_induct3
: [" C+ m! y  _6 C  S& v* X  X0 y: j    move into pickaisle.induct3. `/ {5 a4 `  |% H, I
    while A_i<=30 do begin
6 y! v8 X7 M2 B# g% ?9 R1 d, o        travel to pickaisle.con(A_i)6 I0 ?0 b! C  a1 [  X. q! w' r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! [: p0 ]7 I( M( i3 H8 V: U' h' w( o
        else wait for 10 sec
1 k5 q% u+ |& E7 v0 w        if A_i=A_leave then send to die4 b" J, e' F. m( A2 [
        else inc A_i by 19 F6 T0 x. f- l2 H/ ?
    end7 b7 V* h9 O' v, 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是个什么东东?
5 L- H, T5 R! B2 b$ zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; q; i6 e7 k, A* Y8 d* W
4 n: ~+ M3 A; f/ [: B
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: @4 `7 {1 W6 Y, L% O( t
& q. u% R. ^9 e5 e* P6 M  I0 H2 I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. G3 f" i8 N# L$ W
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* I) b- X% U2 B) @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" K- @6 K6 W/ \. h& z3 {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" F% {$ S- k, h  wbegin P_induction arriving2 a4 h2 X0 @! f) [* {6 z
    clone 1 load to P_pick(A_induct)
, G, t2 K- v. {end最大的系
# m( b+ U2 D  g$ G; i+ t: m/ r- T4 n+ Q) }) t* T# V5 h/ I
begin P_pick arriving
6 v& s# B9 F5 b! p; x    set A_i to procindex * 10 + 1
" T& a# D+ o1 M4 Y! N/ @    move into Q_induct(procindex)
: e( x! J0 i4 E/ D: S" w4 f    move into pickaisle.induct(procindex)) [- X5 `9 n) a' k" F  s
    /*check the type of pickaisle.induct(i), for your last problem.*/
4 t  r  [; J6 t1 O
; R0 J" e1 u% h# S# T: W    while A_i<=30 do begin. k  i- ]. x# J" }) o7 W
        travel to pickaisle.con(A_i). J, I, u: a7 ~3 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) y" @5 B) b- `# Z! n; E
        else wait for 10 sec3 N  n9 A5 B) [% ~9 F" y
        if A_i=A_leave then send to die: q4 \3 i$ `* N4 x# T" }! G
        else inc A_i by 1' ^: w4 C) T+ h7 v& Y! A+ H. w! R
    end5 @* k6 F% U. x2 w; p
end3 I" D/ U0 r& M$ I
8 F: p; ?% U+ P9 H  b: ?/ l
其中的procindex为整形,代表当前process的序号。8 M- I. X& i# `+ L1 a/ G' v
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-3-10 17:29 , Processed in 0.018930 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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