设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13337|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 P- R( H) e0 b+ K; {. j, p" b( }) C8 Z  b/ S; w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  \: X" b" X+ N+ R7 n. M

! e5 k+ \; w* c, N# _1 p8 Kbegin P_read arriving
. W1 s: `9 ~0 x, w4 i/ ?# G6 ^( j2 E0 s    while 1=1 do begin
9 N+ V4 t, c: {$ n; o- A: e; P        read A_tote from "data.txt" with delimiter "\n"
& {3 F4 y: l( x6 L- g. }+ |        read A_time from "data.txt" with delimiter "\n"
8 t  J; x% ^- j, p. W: x% u        read A_leave from "data.txt" with delimiter "\n"
$ u& H% h* k4 F        read A_picks from "data.txt" with delimiter "\n"4 C) u& k% S" _# L9 `) M2 L
        set load type to A_tote- V3 ^# o6 D' y' h3 ~. b7 b0 t
        if A_tote="tote 1" then set A_induct to 1+ k  j- y) f4 x1 s4 y% E
        else if A_tote="tote 2" then set A_induct to 2
2 o* ?3 N5 O: D- k( g! L  o  p, Y1 @            else set A_induct to 3   
/ t1 A% K6 V5 W$ ?4 m# m$ _        set A_i to 0( y: h" e! ^$ z5 _: L7 r2 U
        clone 1 load to P_induction
& i& J" u/ ^4 x! V: m2 L        wait for A_time sec
& [" Q; J5 W& w+ d" q* X0 h    end! |' O6 Y; L3 \" |
end
! S4 W& G5 f( Q% \# K8 Z0 I! N
( U# F, L9 g5 S  {1 X8 N( W* ybegin P_induction arriving
2 ~& Z' S7 y5 Z9 g    if A_induct=1 then clone 1 load to P_pick1; t2 ^  b  w+ Y
    else if A_induct=2 then clone 1 load to P_pick2+ M2 O& ?( s6 I, b; ]' q
        else clone 1 load to P_pick3
$ h  D: k( }: D0 kend7 s) h3 A5 n& b4 y: R$ n- i3 m

+ |2 {: E0 }- Y, H4 |begin P_pick1 arriving
& u1 Z2 t* W% a+ V3 E5 t$ r    set A_i to 1
4 S* |* e7 O9 s8 q" t- l    move into Q_induct1& H; ]; P) G+ x% S7 v: a$ C
    move into pickaisle.induct1/ e2 t$ ~% L0 _9 ~1 P0 o/ @% m
    while A_i<=30 do begin
3 S5 H+ {1 g7 f# j8 g7 T1 C        travel to pickaisle.con(A_i)
* t* s; H; ]% C5 G) c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; R" Z( Y! T/ P' E. X
        else wait for 10 sec
/ T5 |/ L$ M9 U1 c9 W        if A_i=A_leave then send to die
; o& T: ^. u4 B! x/ ]; p+ y: o, Q        else inc A_i by 1
( ^% ]/ m" R0 f3 {# [% u    end3 v2 S8 u, q9 M; W; P( e
end: v  B# c& p! Z* {2 E4 ^9 B$ v

5 P+ s$ S7 ~$ a0 X7 e4 g4 z& _% }begin P_pick2 arriving& h% |8 D& w& a8 w* x9 G
    set A_i to 11
* L8 k, M1 _2 {7 m+ E6 U    move into Q_induct2# c* \9 \* A; E; N
    move into pickaisle.induct2
4 M& k4 a2 Q$ I; H2 t6 l    while A_i<=30 do begin
; c( x: T4 B( }1 ?3 B        travel to pickaisle.con(A_i)3 `# i) d) P. y2 \# Y5 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: C3 ]9 I8 b7 y' R        else wait for 10 sec
# o* k  _5 \, V. u: B9 T        if A_i=A_leave then send to die4 H/ R( }# r  ]# `8 a) S7 S! z
        else inc A_i by 17 P  d% S- s) I+ p/ D% x
    end
8 l% ^4 |/ S2 o/ ~end
6 n" A& M5 A1 C4 ~% ^3 T! I* o* l$ w$ v( t
begin P_pick3 arriving4 ^6 U, [$ c1 I1 @
    set A_i to 21
% D+ H8 m  ~  w8 O8 e" C6 h    move into Q_induct34 J1 `+ E- ?' c1 b9 \0 X7 v! v6 x
    move into pickaisle.induct3/ l0 _- m8 c- S  M  f. g
    while A_i<=30 do begin7 D8 v9 Y) W# D
        travel to pickaisle.con(A_i)9 ^! O- W' ~% j( Y! B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 f/ `/ U  L$ v4 z' n
        else wait for 10 sec5 a$ `1 a$ C$ G' C0 @
        if A_i=A_leave then send to die
. w: K* J( D' P# l        else inc A_i by 14 R/ n( ]5 l2 Y% X# e4 `! U, a
    end
" H3 O5 M" C- L0 Yend

最佳答案

查看完整内容

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是个什么东东?
0 Q3 p* [6 J% q0 u6 r& g2 wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" Z. V# m/ t+ o% J0 L6 z, Z$ Q
3 l- u+ R, d! M$ B3 z: d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' L- N! c6 t4 W- v2 s4 X, f
4 q! v" M3 m' {2 O另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ I$ I& Q0 E( K' o3 V$ `; f. `( |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 m. k, x' r) V8 A! g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 B# v" T/ B  n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" u$ O8 M9 }6 W; r0 c2 i, ^
begin P_induction arriving
8 M% B3 t7 h- ]6 \    clone 1 load to P_pick(A_induct)0 X) \1 P" C  J) K! _( V
end最大的系! P2 M0 u1 u/ R: M, t+ }

  @3 F3 F; T- E9 ]3 y0 Xbegin P_pick arriving7 \7 y8 l4 y& |
    set A_i to procindex * 10 + 1; g4 }9 ^% J- i
    move into Q_induct(procindex)" v( @; x. O; I$ Q& h! f
    move into pickaisle.induct(procindex), n8 b2 N: i1 Z# t* X
    /*check the type of pickaisle.induct(i), for your last problem.*/* c$ P1 v& p! c. H
6 f# H+ ?/ _, z( d% Z3 d- R  |
    while A_i<=30 do begin: J- S/ [4 N5 J! U2 c" K
        travel to pickaisle.con(A_i)
/ n; w# k+ [, a" G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" w: h* I9 z. o% _        else wait for 10 sec
" |5 x) _8 F- h& W' p        if A_i=A_leave then send to die
% F) V' K' J; d) t: Z        else inc A_i by 1
$ n7 w( b0 u" b  N: _    end
3 [/ G# D0 t; m! w! T1 qend* ~6 C6 t* Z' T0 j$ H1 q
5 [3 P1 z- u0 ?9 N
其中的procindex为整形,代表当前process的序号。' c6 g0 M% ]' o: G
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-4-5 07:10 , Processed in 0.021215 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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