设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13661|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ }, X5 e8 z9 q4 N6 u# h$ z  _- e9 |: }
8 j2 ?! R, _9 [& }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ t8 M% L4 T6 H7 k6 D( `, [% Q* E* y* M: x' d
begin P_read arriving( @9 E- r( B# ~5 c/ |# t
    while 1=1 do begin
$ v% s! C# X: r# M7 T        read A_tote from "data.txt" with delimiter "\n"1 g5 [4 x+ F8 r
        read A_time from "data.txt" with delimiter "\n"3 l9 I( t, B& t+ k0 J+ m! m/ }1 i) B
        read A_leave from "data.txt" with delimiter "\n"  M: \5 S/ @1 a% o( s
        read A_picks from "data.txt" with delimiter "\n"* ?. E9 y. ~( I/ e3 H8 G
        set load type to A_tote
& y; ^/ v* _4 H% T9 z/ U0 f        if A_tote="tote 1" then set A_induct to 1
+ y6 ]$ t  r/ q( {2 P        else if A_tote="tote 2" then set A_induct to 2
  G) t- h/ c' D  o) H9 a            else set A_induct to 3   
" E2 B9 M. f7 |- l5 N& i' B* ^        set A_i to 0& n+ _; b  |8 [  U
        clone 1 load to P_induction
/ K# |! m) J" p        wait for A_time sec
0 w$ G7 ?/ G. [& _, f6 T4 U! H    end
/ m  k" F. s2 m2 o0 G; o8 wend! ]0 ]0 B4 A- _
1 B7 V$ f/ R3 e3 i$ y) ?
begin P_induction arriving
* n/ Q- @% K/ R, j' f1 ~' f- x2 \( h    if A_induct=1 then clone 1 load to P_pick1& o( z- a  B5 K" G* ^
    else if A_induct=2 then clone 1 load to P_pick29 m. v! i: `% `
        else clone 1 load to P_pick30 L) s; e0 s3 u1 N# z4 ]4 Z
end/ _. P6 o: i9 J4 P" V3 W" A/ u- o

% C2 ]- n1 V  C% t& W- K. mbegin P_pick1 arriving9 h& N5 d4 j! c+ X. @# H
    set A_i to 1; b* q* [7 `2 V; }8 I/ Q& {" O
    move into Q_induct1
  g; A$ l, j0 `  F' K5 x    move into pickaisle.induct1" w1 F3 m% f0 a2 r! U! U
    while A_i<=30 do begin4 e: f2 u5 A8 [4 |+ e
        travel to pickaisle.con(A_i)
/ X3 g( w7 x4 R( H  k5 C7 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 B3 x- a$ w3 V1 R9 M- a
        else wait for 10 sec
% r, U1 S1 z* O9 C, p  ?& z: x$ l, M        if A_i=A_leave then send to die
) F& o8 h9 R( U# _& }) X        else inc A_i by 1
% L# L4 ?" b) o1 |% I, V    end/ g4 W$ D' O3 Y1 G' k# g
end/ U% V' k6 b9 r$ t; Y" q; O* t7 O2 `
7 Q% }" K$ }5 E/ w2 ?. x2 h6 H+ O
begin P_pick2 arriving, F8 v: }9 n& Z4 B: o
    set A_i to 11; ^$ q% {1 g: q$ Q2 ^' Q, K
    move into Q_induct2
4 i' w* a# h0 ]% U# a  {5 S    move into pickaisle.induct2  T6 B* x  `0 C- i6 R6 j
    while A_i<=30 do begin" n6 b' t1 U4 B% T5 k. R6 M
        travel to pickaisle.con(A_i)
4 ?. G* b$ D- m) s6 ^: }6 b# z9 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 B4 {- k; o& v8 ^1 [: Z
        else wait for 10 sec) v$ N$ r! n# X
        if A_i=A_leave then send to die
- y0 a( H4 h5 r5 L& h        else inc A_i by 1
% l2 B" h. f) a. x    end: _% t9 y4 ^! W' W
end8 I- d% t2 L0 Q) n

% X2 F$ ]% H! m  Dbegin P_pick3 arriving; E: ~* u- \# V+ B" `0 L
    set A_i to 21
+ _' I$ ~  Q: i7 t: `" N: J0 a    move into Q_induct3! K; |1 n% l9 A4 [- ]
    move into pickaisle.induct3+ f7 N' a: l7 y; R% V/ q
    while A_i<=30 do begin* S+ y1 f6 z3 L: P; |7 t& y
        travel to pickaisle.con(A_i)
% z* d3 b* H6 y9 E2 n% J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 x1 C3 g* r5 F6 N
        else wait for 10 sec4 o0 u0 X: C5 F5 J- p, X
        if A_i=A_leave then send to die
" D# b7 B+ E# y+ |, ]        else inc A_i by 1# D" [, ]$ R% _; A
    end
- E0 |! W  f8 Q! r4 w5 Pend

最佳答案

查看完整内容

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是个什么东东?
; Z6 q7 b& a4 L7 t8 O6 s; P' zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* T" @! S5 b# E% j+ e& j

% J; s7 N( Q, l$ xAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 K4 @2 j3 m$ N6 D: n3 J+ u, K

! a8 t+ x# h$ d* E/ Y2 O另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" Z# o. s  K: {, K, x* {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 ~8 k5 J# e8 U3 j9 s& G2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( m# }6 a0 A( G- X, H5 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" _7 |& L8 G% |% W$ l1 E
begin P_induction arriving& p% x7 E3 m! ^, w' x
    clone 1 load to P_pick(A_induct)1 D: `# [! x1 n; D, W
end最大的系! ^+ n0 D4 C) ~( \1 Y- ?) o% h1 h

) T9 x, e, f' {8 D; mbegin P_pick arriving- G* P% X9 K' ]! m) E, B& N% X
    set A_i to procindex * 10 + 1/ u+ R' G, C0 k
    move into Q_induct(procindex)9 O( d2 m- d" v! ^/ ~4 W" C
    move into pickaisle.induct(procindex)
) Z0 E8 \  J4 ~' f9 o; R0 y, _! d    /*check the type of pickaisle.induct(i), for your last problem.*/8 B( J) E& i3 w( C. u5 v" E6 u
4 w6 a' g8 N2 }
    while A_i<=30 do begin
% s- \4 Z, L( ]) M5 U        travel to pickaisle.con(A_i)
- n4 g7 V( T" y2 I0 p8 C) \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: [0 p/ P( I  x- Z: r9 R5 N        else wait for 10 sec
1 J" `9 U( {- D+ B/ J& E- K8 A        if A_i=A_leave then send to die, g) ~- B# ?+ Y" d% Z9 c
        else inc A_i by 18 O0 R0 h1 r# y  @  |
    end
( v/ F' t) O" ?6 f- Z- D' H( Xend/ P7 a$ Q+ C$ P6 g
" O" N- \& l& x/ l* [* q" V: h
其中的procindex为整形,代表当前process的序号。
2 f) j9 [5 l$ \4 a$ y! l+ `; Ustation和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-4-27 03:42 , Processed in 0.020084 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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