设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13521|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  w1 d1 I" y+ r3 a! }- S
% {" ]. c8 \2 W$ Z) p  i
我的问题是,在每个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 Q3 v, H  q  Y, ]. H! F
: Q0 F. J& ?2 |4 l! ]6 o
begin P_read arriving
# z" V9 p& _; ^( O    while 1=1 do begin
' u! y/ e0 a  p( \        read A_tote from "data.txt" with delimiter "\n"
3 N. J% a: {- a& j1 t& o, }        read A_time from "data.txt" with delimiter "\n"; a! t& q9 K; N/ Q
        read A_leave from "data.txt" with delimiter "\n"
! L/ R* I3 r) }6 ^- x" |0 J! [        read A_picks from "data.txt" with delimiter "\n"
+ {; u0 e9 f7 D) O' ?6 l        set load type to A_tote) r9 G! C1 ?+ O$ Q$ Q, }1 R5 R
        if A_tote="tote 1" then set A_induct to 1
/ `/ a0 l8 w. x! P        else if A_tote="tote 2" then set A_induct to 2
% B3 o1 K4 W1 h& Y7 _            else set A_induct to 3   
3 J8 A8 k5 l2 O" `7 l        set A_i to 0. m6 L0 O/ Q7 @" u
        clone 1 load to P_induction
$ u- \% }& H; ~' x3 k8 F1 C        wait for A_time sec5 c* R! O8 q( f! ^( Q  |& H
    end
3 f& V5 F* w- x' M0 F7 d8 E" Hend1 C2 i' s8 N$ @  X% w! M. V; O
/ P% @$ u# g9 G
begin P_induction arriving/ H: O2 B* A7 J% d- |
    if A_induct=1 then clone 1 load to P_pick11 L2 D/ O0 k8 N9 b+ n9 H
    else if A_induct=2 then clone 1 load to P_pick2
1 D7 f6 ?& m  n6 {% X        else clone 1 load to P_pick3
$ u% A) o: d4 \- r  S/ }end7 [  h- p7 m( h- V
; E/ n) i; `+ ?) `6 [- S
begin P_pick1 arriving
& ~7 n8 k  z- r& ?5 P    set A_i to 1) L/ @# [, @* s; Q" }7 ~6 d
    move into Q_induct1
$ Z1 o" }4 w) z& ]* Q' M; D& c2 x2 i; n    move into pickaisle.induct17 q5 e# W1 n. m9 l0 m
    while A_i<=30 do begin6 `2 Q+ d/ C% z; Q9 h+ @6 @
        travel to pickaisle.con(A_i)# T1 T0 g9 d1 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* G" l- _% {% A
        else wait for 10 sec
0 n8 O$ S1 h" f. b! p        if A_i=A_leave then send to die
! }5 e: ]# G( r0 V; @% x" U( E) V        else inc A_i by 1
$ b2 P! ]% Q# p4 {    end
% u3 G1 U! @) N2 Z/ L- w4 Y! o+ }% Cend+ ?$ e' q3 a! {; X. o6 V# k
" c# v* @8 V) P2 v/ L
begin P_pick2 arriving
5 c$ }- l* a9 r4 ?; ]    set A_i to 11/ {# D. Y+ G. i, w2 o: d0 n
    move into Q_induct2
+ t6 Z8 Q0 M. ~* ?0 K    move into pickaisle.induct2+ l) J) z1 |! A" H8 M# T
    while A_i<=30 do begin
4 |1 h" f4 g# m0 r' O) T        travel to pickaisle.con(A_i)6 v6 S, l$ @" i" e1 `9 i$ i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  c* B, `7 x5 R( b, l4 k6 i
        else wait for 10 sec
5 @  ~' a# d% p% B  r* [        if A_i=A_leave then send to die
- _6 Y$ [* i8 F6 T        else inc A_i by 1) I6 ~! ^2 l1 [6 H/ k; e2 ^3 K
    end
- s) F$ a7 K; \" qend
' _& g, e: B* t4 }. T4 W$ v/ v: U0 A, T! _) @( e
begin P_pick3 arriving
- B0 ^* x4 ?& u3 U" y    set A_i to 21
) t+ I7 P4 E7 V2 y    move into Q_induct3/ M4 D: K' t) m2 o' n2 r$ P
    move into pickaisle.induct3
( Q5 d5 G( n: n+ G9 e& r% ]2 [+ u6 U; m    while A_i<=30 do begin3 C! k- b! [4 b. T* r* `1 A8 i
        travel to pickaisle.con(A_i)
  d2 v; o! L& b) B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) O. X1 e! S# a' k8 U. s( ~3 y
        else wait for 10 sec  w: n: j0 @: m7 |
        if A_i=A_leave then send to die/ h7 o( I( @  h1 W: I5 W. x8 q
        else inc A_i by 1' r$ I) K* [% e, y8 h
    end7 Y. u0 L3 j! J
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是个什么东东?2 h/ J2 B) @" x1 M0 s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 Z) K9 W* r% C1 h
3 x" ]% A& _- w% [1 G7 h0 Q. G' EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 v' U* N& W$ {' x" b
# l/ t, X, X7 j/ m- W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! F- u. w; G% u& f6 i9 {' L/ D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 a: h; u+ S- T3 m% q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; v5 i$ t) d: h# i6 Y3 }2 P3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 N: v9 u; v; B  hbegin P_induction arriving
) N: g1 G$ \: a- d    clone 1 load to P_pick(A_induct)
3 o3 P( n8 P, D& K/ p+ `end最大的系2 i+ K! j$ v4 ^. v  {/ E( {8 B# W  J
" x6 D1 N" Z; ^% J0 ]6 P7 M' }
begin P_pick arriving2 d3 c8 o5 s+ p9 X' o1 [
    set A_i to procindex * 10 + 15 @$ x4 H" m' W$ O+ h" g. D
    move into Q_induct(procindex)
. x( U/ m5 c) u/ I/ y0 s+ R    move into pickaisle.induct(procindex)
8 N3 r+ ~( L  M! s    /*check the type of pickaisle.induct(i), for your last problem.*/
3 t1 g& i% \0 m0 |3 s2 a* [0 M7 T# M( T5 P, h. g
    while A_i<=30 do begin# u  v: e+ q* h* ~8 t; J
        travel to pickaisle.con(A_i)
4 k6 P! N. p5 }  m: f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ^0 a* F5 w4 }# C3 q* u        else wait for 10 sec  c7 q' o( K) m$ g
        if A_i=A_leave then send to die  }* v5 v; I  X' M: N9 j0 M
        else inc A_i by 1
; @! A9 W3 \' W6 V$ _    end
: I$ O* _. [- y  kend; F2 f6 ]" }! `5 E$ W

; y8 R- j$ ^7 l; D1 G: }: i+ ~其中的procindex为整形,代表当前process的序号。
3 Y4 [1 s" v+ C5 A' }! {3 D) Wstation和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-19 07:09 , Processed in 0.032123 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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