设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6370|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 b% |( p6 T7 _: w
5 r" [1 w% v5 Z  ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。  T% U% K2 [, Z; m* O* U1 k

' T" a! @0 ~# G  w7 Fbegin P_read arriving. o( P( N3 M" V5 r
    while 1=1 do begin- I. A) a4 `+ x* h7 _
        read A_tote from "data.txt" with delimiter "\n"4 B. j+ m+ A8 j7 q4 Z" B$ |# Y
        read A_time from "data.txt" with delimiter "\n", q, p2 X8 l5 x1 J
        read A_leave from "data.txt" with delimiter "\n"
  e# c' W" b) f6 K0 P  e        read A_picks from "data.txt" with delimiter "\n"
, |3 V  [+ i9 ~9 V0 F        set load type to A_tote* D) |% ?8 ]8 r2 J! {
        if A_tote="tote 1" then set A_induct to 1
  [/ a1 r9 o2 M2 e2 [        else if A_tote="tote 2" then set A_induct to 2
1 ?4 h0 e& F5 Z+ \+ v            else set A_induct to 3    - y/ g' O7 S. Z9 j  j/ X
        set A_i to 01 d( v( A0 q/ L) L  L
        clone 1 load to P_induction
' l7 t9 R' U/ K3 E  w5 F        wait for A_time sec
, [+ h/ Z: G8 i3 i( d    end
' M0 C: Y: @+ J8 Fend
) {0 V* v3 ?% [) Y
$ K8 H+ [9 f1 abegin P_induction arriving
0 R0 E# Z& B4 R    if A_induct=1 then clone 1 load to P_pick10 e* ^+ K/ g4 m3 I: [! Z1 V0 `# n8 z, K
    else if A_induct=2 then clone 1 load to P_pick2
  ]3 T' F& e3 q! I+ l  V3 K        else clone 1 load to P_pick3
7 v) ^( X1 K. k. ?end
+ r/ D! T4 J2 T$ m( f( D/ _/ T$ j2 O/ X9 M
begin P_pick1 arriving
! V7 u* Q# N# P+ M' q  q; b    set A_i to 1
6 U- I3 G3 p* l9 S    move into Q_induct1
/ ]3 h* L8 P4 o% y7 S    move into pickaisle.induct1
! d) V" S1 O$ E7 p$ D7 y0 x, M    while A_i<=30 do begin
" ^4 j$ s, @& _0 _/ `  G' R        travel to pickaisle.con(A_i)9 }, L4 s7 w2 b6 j' Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 t9 G* ?- I6 @
        else wait for 10 sec3 h. G# G& z8 O. ~- s' M& n3 r
        if A_i=A_leave then send to die
: ?( h# C/ Y+ k- K        else inc A_i by 1
: B+ y! ]7 l- A0 a    end
% Q, x3 G8 D# r0 `4 t. ?3 y- Jend
  S( ^- `1 C; I6 {! X6 W2 Q, v) p$ {% _8 }0 B: y7 s' o( K2 e
begin P_pick2 arriving' c! Z" E- p  `. I
    set A_i to 11
  Y. G: w7 P2 A7 A8 O: b3 ^. A    move into Q_induct2/ a5 y; ^4 J* a/ \& L
    move into pickaisle.induct27 Z8 i6 e; @! u0 a2 ~) f
    while A_i<=30 do begin
" _& M3 k0 F5 L6 z9 G3 W        travel to pickaisle.con(A_i)) |) R1 F+ z( p9 _5 O, r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 h% U" w2 ~1 `! h9 p& Y# Y6 o
        else wait for 10 sec
- m- r7 q; O0 r0 A        if A_i=A_leave then send to die
/ z2 ]/ l+ Z2 [; G; q( u        else inc A_i by 1
7 I! X/ c+ _+ [; r) t    end) f  R; F& y4 x. d+ Y! {" D/ A$ m
end
  O1 P) _& c# F7 L
" }: d+ t$ T0 _- e1 @. ~begin P_pick3 arriving- t) }, K% A; `2 f9 ~
    set A_i to 21  J) {2 a  }$ l
    move into Q_induct3  ]- r' m; |- J% O+ D
    move into pickaisle.induct3( b; N0 R' F, y2 W/ b
    while A_i<=30 do begin
* t, Q9 `0 y8 J2 I  _        travel to pickaisle.con(A_i)7 r2 _) I& U! [1 c" ~$ t  ^/ V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P4 O. i. H+ A5 r: o  ~8 P
        else wait for 10 sec" L) H# o5 q8 s9 c! e) m$ N4 X, Q
        if A_i=A_leave then send to die% W0 t" h4 m  S9 L) \, C
        else inc A_i by 1
9 v1 D- D6 m" J; H    end  e0 c- F. D/ d
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是个什么东东?
# w! F- s# H9 z3 w3 ?- q  N" {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* s( R' L) h& k; D" R- h/ `
# T4 v) g( f/ _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: v- u# f" C7 s5 q7 D1 n# e4 Y  m, c

: a' e) \5 y. W  o8 K5 E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& w. U  _0 l4 z) j$ m% R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. G6 t7 t2 ]: S- U. q. H* R) g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& b' U* h6 Y5 k5 H! x: H  I3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% x; Z$ T, q+ K$ @* |1 G) j6 X
begin P_induction arriving1 n# c8 N7 x: x( Y6 t  N3 C3 B# N
    clone 1 load to P_pick(A_induct)6 p+ m0 Z, C8 |2 z4 I/ d- w! v
end最大的系' k; I" [0 Y0 [0 {  s
, e  e. u' z5 g/ L: ^  N" h
begin P_pick arriving# H, f4 \/ z4 @% z2 G- v0 h/ J
    set A_i to procindex * 10 + 1
' i0 Q1 ]6 w6 D! T1 B5 g0 W% T    move into Q_induct(procindex)
" i/ h* I9 K, |0 r' t' @3 \$ |    move into pickaisle.induct(procindex)1 t; q5 l3 x# v: A
    /*check the type of pickaisle.induct(i), for your last problem.*// g- J0 Q9 j0 N7 S- _

3 w: H* o9 q  ~6 P    while A_i<=30 do begin. T# E) Q# t8 ]3 U* S
        travel to pickaisle.con(A_i)
1 W# ]5 Z: I- Q4 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Z7 F; B! B$ n' h  D        else wait for 10 sec
+ a" j  U# ?) R/ B        if A_i=A_leave then send to die
4 I% T$ K0 V% B! x, A% p! m0 L        else inc A_i by 1
* C+ V3 ~9 ?, Z: I7 w# w7 T: ]+ Y# }    end  I2 ]3 p6 x  Q+ I5 M
end
2 Q8 a1 Z8 F! V1 B8 U% U9 x) M0 F$ \  g1 S7 G/ M
其中的procindex为整形,代表当前process的序号。' c5 w; _; v0 o. K; W/ T
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, 2024-5-17 18:55 , Processed in 0.013835 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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