设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14546|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( ]4 a/ s' g* W5 x+ s; g1 F

1 D' v# l+ `! F* f3 b+ L( 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中的数值,不知道会不会有什么不妥。
0 Z9 h% a3 u6 q$ J! S3 s
& j& r7 v2 T# _3 Qbegin P_read arriving' @: F' L5 Y* z2 `) Y, `1 m. J
    while 1=1 do begin# s6 q- a: x3 B  L$ [
        read A_tote from "data.txt" with delimiter "\n"
' P! Z3 Z. @# N! k        read A_time from "data.txt" with delimiter "\n"
+ e. A" W! I3 Q& Y! w& \1 H        read A_leave from "data.txt" with delimiter "\n"
' n/ g4 w2 q8 ?. Z$ y+ d        read A_picks from "data.txt" with delimiter "\n"
2 s! s; B: G/ \& d: ]6 P% ]        set load type to A_tote2 q- z2 C1 \- s4 s: e
        if A_tote="tote 1" then set A_induct to 1
  u2 f7 p& c% s  h0 t3 U        else if A_tote="tote 2" then set A_induct to 2" j* s. Z  I( h: c- x5 f( h
            else set A_induct to 3    8 d% h! S# M- c! [- T
        set A_i to 08 c  w- d- ?  f0 T( ?
        clone 1 load to P_induction! N: U5 m5 X1 {$ S
        wait for A_time sec) r7 f# z# q3 t: F, e
    end8 f0 f  W! X" n: O
end' X+ {! i, w5 ]3 p- U4 }: c& g
. l- X0 R5 h; r6 l
begin P_induction arriving
+ P, C2 N/ I/ I    if A_induct=1 then clone 1 load to P_pick1
- M; o- t  T! D/ y    else if A_induct=2 then clone 1 load to P_pick29 l1 N3 j% Y- m8 B0 g' X% T
        else clone 1 load to P_pick3  K9 ^0 f9 y7 u& o" E: {
end
( H6 X. @2 R& n0 Q- w& R
: y) Q+ q0 D. a' {' V+ dbegin P_pick1 arriving. T; b5 P: P6 \2 O1 r) _
    set A_i to 1
$ m7 e, R/ [2 s# _" d    move into Q_induct1
' }) Q3 g& X# z2 N+ Q6 I    move into pickaisle.induct18 a3 q/ n& z& W( @9 p2 u5 M0 ?
    while A_i<=30 do begin) Y1 D3 x) i/ s: }5 I$ W4 A, n
        travel to pickaisle.con(A_i)2 m* s' s: i6 K2 ~/ a! N) a- ]. E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 a, n* F1 Q& m
        else wait for 10 sec) i5 V7 {" Q" y8 u( b, m
        if A_i=A_leave then send to die0 V  k( m% Z% a4 h- i  k- I$ S& S
        else inc A_i by 1
$ H! I# V( y& k    end
3 G7 _5 \6 o1 Yend
/ B# y1 W, D' D7 x! t! s0 {. Q- C( a( \( E9 P3 x5 z6 q9 o4 ]
begin P_pick2 arriving
3 j6 A6 W5 }, @' T% m. q    set A_i to 11
+ t" B4 x* b- b+ S. N+ b    move into Q_induct2
) ?! i3 o; G9 z    move into pickaisle.induct2
- v- g& a7 D' M0 ?6 Z# ^    while A_i<=30 do begin
( ]5 \7 t0 v* A        travel to pickaisle.con(A_i)
- P  L# H* w3 R5 g, r, w  u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 |3 P* h" g( R; c3 E1 L2 A5 d
        else wait for 10 sec
7 R- y3 B+ x/ l; o4 v        if A_i=A_leave then send to die
3 G9 y" M; F8 \% x* I) O        else inc A_i by 1
. o- j1 W' E) g2 @+ U    end
! [" i2 b, E2 l2 z6 H4 k0 m" jend" D. P/ I+ s$ R  T% g8 O

/ D8 ~4 P& L' R1 w4 Abegin P_pick3 arriving6 `5 x, [$ Q# }: B) n, r9 o9 {, w
    set A_i to 21
9 N' Y, T$ J* u% }5 U    move into Q_induct3: ^  g6 q1 X! W9 D% U
    move into pickaisle.induct3+ }! m, @" h* `$ c! |6 e
    while A_i<=30 do begin
4 a6 M' T, H  Y& H* B: n7 Y        travel to pickaisle.con(A_i)
# b+ w. O$ ?; X* B+ d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 k4 e0 A' u2 ^/ A% m
        else wait for 10 sec" u$ c; ^! a. A, `2 ^# l3 k
        if A_i=A_leave then send to die3 b4 p% f- H  {* {" ]
        else inc A_i by 1
+ y" h" }' G& [4 L. p1 j0 o    end% k) `0 B! _3 w+ V) m, C
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是个什么东东?, b/ k9 F8 q4 V+ f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: f" i, B" p/ ?  _- _" e$ w" h" D* I

1 b2 C9 Y# F: O( t/ `AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 ?8 J  o2 O6 ~1 V7 l6 ^+ E
' Z& x, Z3 Z2 f. g/ k/ s) C& {' ^0 n
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. [  S! m5 R( B/ ?" T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, e9 i9 c7 [" k8 k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 e8 ]( ~  l1 d2 R: H8 {$ R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- r8 b1 b8 [8 _, J: L
begin P_induction arriving
% S! G+ j- Y' b. L. _) z& l2 ~    clone 1 load to P_pick(A_induct); G: Z/ y( s' K/ O1 \+ i6 }
end最大的系
! F( |' h7 c9 S2 Q
) y+ A  E; E7 v9 Q; bbegin P_pick arriving
2 R: O9 B2 Z, D8 Y    set A_i to procindex * 10 + 18 |( E! l$ p; w# Z. ?
    move into Q_induct(procindex)
8 w, y% S2 E# z2 a% B( n$ M    move into pickaisle.induct(procindex)
1 i! k" f# x  o, X    /*check the type of pickaisle.induct(i), for your last problem.*/
0 ]  C) n3 {2 H
: @: v8 ]" v) e8 k    while A_i<=30 do begin4 c& A$ F+ {2 V1 W
        travel to pickaisle.con(A_i)0 m) p2 {/ M* j+ u0 h* w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( q1 ]0 W/ V( h
        else wait for 10 sec9 X7 u- g1 x7 k
        if A_i=A_leave then send to die0 C6 B% C9 o0 o+ S/ I# x* Q, n
        else inc A_i by 1' @8 }+ X* l" @6 Q4 R0 d8 y
    end
/ A+ T, e5 z% L1 E. s# |, ]1 Mend0 ^" x8 x- b# j2 B
" {8 B/ s* m. S3 g
其中的procindex为整形,代表当前process的序号。
1 H- M$ L3 Q4 t, T2 k4 Jstation和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-7-16 16:18 , Processed in 0.021526 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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