设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12654|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; _2 V$ D/ e4 e+ X, V
& G1 S% Y) P4 @6 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 V3 v9 F* S" ?& S( H" K: t. G+ C/ y+ ]
begin P_read arriving# F# \9 i0 |; l! O# \
    while 1=1 do begin" l; _% ^. q( J% g0 Z' p
        read A_tote from "data.txt" with delimiter "\n"
1 D- ~  j6 e. u  {        read A_time from "data.txt" with delimiter "\n"8 s2 W) N  I4 A
        read A_leave from "data.txt" with delimiter "\n"
! s5 A2 U1 O+ F& P        read A_picks from "data.txt" with delimiter "\n"- }; c. o* t8 Y' Y8 R# `4 G$ B% S
        set load type to A_tote! U0 n  U! |9 M+ x
        if A_tote="tote 1" then set A_induct to 1
( o8 g; m2 B3 M4 F5 t; Y* y        else if A_tote="tote 2" then set A_induct to 2
7 b2 R+ a8 e1 x. }2 O            else set A_induct to 3      e; R: ~# Z5 U; b! `& O
        set A_i to 0
5 r. C  k" d3 H        clone 1 load to P_induction% {  @& M. h$ A) O, [, h
        wait for A_time sec
( y' @: D+ W8 s( P& H    end9 M: C: R9 p& O$ S$ ^4 S
end
1 x" R* d5 o6 I; e3 u* @
3 I) Y0 R1 T9 F5 }/ t0 Bbegin P_induction arriving; ], i" |; n: K8 w2 _
    if A_induct=1 then clone 1 load to P_pick1
! t5 A2 q. C2 ^) b3 l6 J    else if A_induct=2 then clone 1 load to P_pick2
5 E. o5 {8 u+ c) Z" \' z; x        else clone 1 load to P_pick3# A' w3 F2 p; u  a, ]2 ^/ o
end! B+ @7 |, d) F9 X; E) S
* o2 x! c$ Y% X1 `( v$ k
begin P_pick1 arriving( B" b; o3 j3 {; f' g$ Z% f
    set A_i to 1
) W  c3 G& G! G) a: C    move into Q_induct1
  q" m3 \( S1 n& N    move into pickaisle.induct18 |: L& X/ d2 M) Z
    while A_i<=30 do begin6 Z4 Y6 y& R+ y' q) ]' `" h2 Z
        travel to pickaisle.con(A_i)$ W( j& c5 ]# J% d! n, A( i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* c5 G5 A* |7 |& O* t! E1 v        else wait for 10 sec5 k* q& K+ ]1 k- h7 H# Q
        if A_i=A_leave then send to die
) ^2 e0 j. Z  s( O        else inc A_i by 1! G! w7 [: l+ c1 A: f( ~
    end( I- r: j- z3 @" ?
end
" W- A: ]+ ~+ x+ N; y) i
0 a# I3 G* P" c8 q, ibegin P_pick2 arriving- v7 q# c% X+ g9 _
    set A_i to 11) W+ [4 Q/ y8 D3 h7 N  E: b3 ~
    move into Q_induct2
! H5 S) Q; J" Q3 ^5 p+ e, K* L3 \" \    move into pickaisle.induct24 [, j; Z1 s  `0 @1 w' j
    while A_i<=30 do begin- R+ H7 U1 k: N4 e4 C
        travel to pickaisle.con(A_i)
$ H2 Z/ l7 H  ~/ A0 w3 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 B; N# a7 H) H; O/ {& i) F
        else wait for 10 sec1 W: B8 s. W: a5 ?
        if A_i=A_leave then send to die
& p8 Q% y& ?. P# g- f3 X        else inc A_i by 1
& t& X4 j- d; t/ z- S% @1 j% L    end
7 [6 j, }! b& l7 {6 t$ aend
0 N6 x& e1 f* E8 D7 G
! T. t5 j' M% O/ K% F3 }begin P_pick3 arriving
* B8 u* g; C$ t( m- x4 x  @    set A_i to 21
4 Q5 q; e0 ]+ }3 E- b    move into Q_induct39 I0 z: Q% t* e7 }
    move into pickaisle.induct3  p! o8 P* A0 L
    while A_i<=30 do begin0 m% n2 j) l$ S9 p0 f5 N, C
        travel to pickaisle.con(A_i)  P9 T) b2 L' q" E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. `: U  @- @3 X* E+ W        else wait for 10 sec- u! V5 G; V4 X
        if A_i=A_leave then send to die; k- X2 i2 e! D3 Q( Y# g$ {
        else inc A_i by 1
0 ]# p) d6 c/ [4 I' h& G8 X8 F    end
! h% Y, W% e0 n, i+ u0 u5 send

最佳答案

查看完整内容

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是个什么东东?
7 o0 R( U# A5 N, t2 J' Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 s6 l4 \% d" J. K7 g3 X/ U1 p* r( S5 A; ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" D! i! K+ f" {* O  a- ]

  k4 a) ~7 s% @9 E7 b- v另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ f( |2 s+ Y, G* V, p
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& x- p. ?$ U& L$ _2 s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, X/ A3 }) m1 t6 n9 H* x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 ], K( ~1 A; c
begin P_induction arriving
. j2 j! h( e7 m$ C" z/ M    clone 1 load to P_pick(A_induct)
9 ^( [, }+ e, Eend最大的系
5 G6 ~( I1 G4 d7 ?) E7 J% ?8 |5 k( i$ @0 n; P  S/ d
begin P_pick arriving
" u/ ?  p. Z8 r! P    set A_i to procindex * 10 + 1& D+ N2 c( h  b0 Z% l
    move into Q_induct(procindex)
+ P, x' m1 A; Q$ O& F    move into pickaisle.induct(procindex)0 |7 l, ]( Y) \# Y* a* D
    /*check the type of pickaisle.induct(i), for your last problem.*/" x7 g: ?; e$ G8 Y, R
& k. A/ Q& P8 i! j2 \* U- F  s
    while A_i<=30 do begin
3 ^- q+ P5 v3 W4 o4 M0 Q2 C  g        travel to pickaisle.con(A_i)5 P" ?& k$ `) K! l4 m) }- `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 U4 d$ d3 u4 P( n' D! ~$ H
        else wait for 10 sec
' @9 T5 D" Z* P1 [        if A_i=A_leave then send to die2 C: g% j% E  L9 s3 h
        else inc A_i by 12 V; @* D! z4 f
    end
' V0 V$ H$ d  ?" m' Z' g0 Cend
3 R1 d2 c1 ?: W" |& K6 |# k1 @
/ h% j, {- _7 R( W, j其中的procindex为整形,代表当前process的序号。
4 @, }, I" m8 q" x' rstation和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-2-8 12:45 , Processed in 0.016134 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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