设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15352|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ C3 I; z  C! f* {/ D% b- }( g$ r

0 T" o; }5 X4 t- E/ m1 L5 j+ ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 f1 I1 r: C3 i' j

0 z! C0 F# F. B0 lbegin P_read arriving4 z$ \! {4 K7 a& p% c0 C
    while 1=1 do begin' E+ m- l" n% V- w$ n) u0 K
        read A_tote from "data.txt" with delimiter "\n"7 U4 d3 o5 w; Y1 |: n) Q( [5 [7 _
        read A_time from "data.txt" with delimiter "\n"
8 T) L+ I- z% A  d/ g* N        read A_leave from "data.txt" with delimiter "\n"
! Q! I' Q8 }/ q: S' u        read A_picks from "data.txt" with delimiter "\n"+ x* Q3 W" P+ f
        set load type to A_tote8 Y& e2 s7 _* _/ W( j
        if A_tote="tote 1" then set A_induct to 1; _( a  ]9 z1 g( n0 X, p" Z
        else if A_tote="tote 2" then set A_induct to 2- z+ x; @2 b. H8 S
            else set A_induct to 3    ) P2 }; n1 ~% Y& O
        set A_i to 0( t  K3 u# j! L5 N5 I
        clone 1 load to P_induction
1 Q5 N/ ]( `% |( A9 H' z        wait for A_time sec# e) k/ O* e. O) O; b$ n; p- \
    end3 p. z- f4 j) Y! y6 |5 p
end
( t% f/ W- X7 D4 u1 Q7 g  y2 c+ k+ T" V4 K
begin P_induction arriving
2 S, s* `4 m1 }; p; l    if A_induct=1 then clone 1 load to P_pick1
4 i3 ~. G! [* o! o3 a5 Y    else if A_induct=2 then clone 1 load to P_pick2/ D% x& Z8 C$ P2 x) J, _+ y5 I
        else clone 1 load to P_pick3
' q) k- c( e$ B% a! }end- e" h4 h3 X: e5 A- {
) [7 a$ s- a6 l% \6 j# r
begin P_pick1 arriving
6 B- r$ k% f9 e' B* h( g+ P    set A_i to 1' t9 u+ v) p  c
    move into Q_induct14 t4 h, w* b) T+ L: s$ U% _
    move into pickaisle.induct1
- C+ F$ }) b6 i$ H: j" U7 v    while A_i<=30 do begin
" Z; y9 V  K  e9 V, C        travel to pickaisle.con(A_i)
0 A3 `2 }5 M  ]2 ?5 @, L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! A) a6 K/ f: k8 Z! i! @+ X        else wait for 10 sec
, G: u4 O# O/ v6 w6 Z0 U        if A_i=A_leave then send to die- H# U2 E3 l' A, D1 n5 n& C
        else inc A_i by 1+ s7 L; |/ |( d- S8 R5 F4 [
    end- F5 O2 W% Z; x! ^, B
end
$ l9 H! }; ]  a2 X# y- O1 W  N: M8 K- I, K( H9 H
begin P_pick2 arriving
) n, ^" l! X& {2 |" c% A) I4 c    set A_i to 11" G, _4 w9 w9 \1 A) U
    move into Q_induct25 e: o  t; d  {2 a! V: _
    move into pickaisle.induct2
- r/ U+ L, H/ q4 D3 }8 d0 U$ m. W    while A_i<=30 do begin
7 ?! S% {2 b/ l. U  ^        travel to pickaisle.con(A_i)
; K+ i& _  u- Q. l3 ~9 d2 Q! n- a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( ~& j. O7 q0 O7 F1 ^$ }* t1 x7 H        else wait for 10 sec
' \  [$ o% G7 x        if A_i=A_leave then send to die
8 ~9 O. U& e' f% W7 s" N        else inc A_i by 1
; w( t6 y0 R* c2 A    end* M0 O# \' `: @- K
end% U2 S0 f7 u" v4 a$ H. Z
9 K% U# K) e' ~( @, s, S
begin P_pick3 arriving
% d1 g) A' P$ U6 d; w9 D$ ]    set A_i to 21: S8 J7 \: @# }$ r4 @
    move into Q_induct34 D: j) G8 v' `4 Y! ?
    move into pickaisle.induct38 k, z. \% A* @# U* A% V0 Q
    while A_i<=30 do begin, Z2 D: z% m( l  c1 V. D% H0 ]
        travel to pickaisle.con(A_i)- {- F' Z8 [+ ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 k" `' M# y, R% k
        else wait for 10 sec- z: v: s; h- d' c; v+ F
        if A_i=A_leave then send to die9 T3 h# g8 ?; y! w% y
        else inc A_i by 18 M( f* C8 f' D: l
    end
" w- p( q3 s, ~: Q( iend

最佳答案

查看完整内容

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是个什么东东?( `# C3 M$ ]) t" |# D9 ~0 C& m0 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' P/ s* X# N- L, w9 d3 ?) x
$ l5 s2 K, h, N- O  n! Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 F. i% F" g5 @
9 a! F. g- J3 a7 P7 j6 G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- v) U* D5 B$ |( J$ S: i1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 `) r: S: f' \; A6 ?$ u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 n5 a" i  y, s, b# n& ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% X& D( u! B9 y; Q
begin P_induction arriving
( u. e) V$ i0 Z5 ?. e4 W& K    clone 1 load to P_pick(A_induct); H# r! P- _3 b5 e! b( ?" t4 ?5 s
end最大的系
& y9 B: C0 C* {7 x. K( ^  k! e: q% n+ x7 I
begin P_pick arriving, s2 R9 y+ ?8 {; [# {3 T1 p
    set A_i to procindex * 10 + 1
% y7 P/ x- k' u  W; I* F1 H    move into Q_induct(procindex)
( D+ B; {+ K) d    move into pickaisle.induct(procindex)* o& y1 {9 D1 P& W
    /*check the type of pickaisle.induct(i), for your last problem.*// v# J* U! p5 D* X
; J8 j6 \4 [" ~# k) }
    while A_i<=30 do begin# H5 l6 H) {# e1 t
        travel to pickaisle.con(A_i)/ t- o& ]0 \: A0 S: F0 X3 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! `* {+ E- L' }' \+ _
        else wait for 10 sec
7 K9 O- |5 V5 o: {        if A_i=A_leave then send to die7 X' H! l5 f7 u& @8 A
        else inc A_i by 1
  V# g" K' ?5 p& t+ O    end4 o) z2 X3 ?3 _% Y9 d+ I" V6 R$ t
end9 l8 G* C; Q! ]$ {/ n4 |6 c

& g( R7 z; t; `: ~1 v其中的procindex为整形,代表当前process的序号。, s7 a7 n4 C. l2 V2 j  \
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-9-4 10:40 , Processed in 0.016576 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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