设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15492|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, g( e( ?) n  G$ k9 n1 C0 s  s
5 ?* ^1 U! N$ e% s) 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中的数值,不知道会不会有什么不妥。; w. _, \: M- `" N: U4 J" M6 V

; I* ?1 |) Q7 X3 Pbegin P_read arriving2 r  l; G0 Z5 t
    while 1=1 do begin
$ k. a" l0 |" c6 b7 k& d        read A_tote from "data.txt" with delimiter "\n", }9 l# X$ ~+ I# Q
        read A_time from "data.txt" with delimiter "\n"% b1 _6 e& J$ O( \" R9 A# G& H
        read A_leave from "data.txt" with delimiter "\n"
1 C: H& ]& u; I" Y* }+ q        read A_picks from "data.txt" with delimiter "\n"
7 m& K5 \2 i: k) J( X* m- D        set load type to A_tote
: M) W; Q) g' S& u        if A_tote="tote 1" then set A_induct to 1# L8 f+ d$ P; F) q0 E9 f
        else if A_tote="tote 2" then set A_induct to 2* A8 t* j4 {( f/ S: s2 X
            else set A_induct to 3    ' D0 N. m  ^) K( b8 }) |
        set A_i to 0
7 S; T! U! _; H  T0 _4 Y: Y        clone 1 load to P_induction
, p! w* j$ T7 m5 _* t        wait for A_time sec
7 a; O  i: x4 f4 _/ H3 ?9 T    end5 _" R5 y! z' V% e5 i3 T* ^
end
( e, ~1 S2 k5 z" S3 e3 w8 u1 Q0 o, x* T. N* N  ^* ]0 e5 B
begin P_induction arriving
7 [' G( I4 Q: Y    if A_induct=1 then clone 1 load to P_pick1
3 I- |! I$ U7 x% C  _  P" O# Z    else if A_induct=2 then clone 1 load to P_pick2% L" i* W  W0 H' Y1 [9 w
        else clone 1 load to P_pick34 N: C! Y. W: K
end6 W7 J  |. ?3 t& ~/ J

9 o) ?' |# g3 \begin P_pick1 arriving+ K. K' s2 R9 d( i/ z) o
    set A_i to 1
7 ]8 n8 V! F. r( @. j    move into Q_induct1- a$ s2 T' o4 J( x
    move into pickaisle.induct1
: _: h& a( o2 m* t    while A_i<=30 do begin9 V- ]- Z8 Z5 l5 b6 s* s' J; j
        travel to pickaisle.con(A_i)& H/ ^( k& j. k: D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ \/ w5 X0 f1 R6 t+ I( y
        else wait for 10 sec- d, t# L# w1 r! c4 c- P
        if A_i=A_leave then send to die* ~, z1 [8 _) `% B4 J: O# l
        else inc A_i by 1
) B7 C- A1 v  N5 f! x: A' p: N    end
2 f7 n2 s3 b8 n# C) oend( j# g5 R* S1 j: N
3 }7 _6 i) y$ C) A. l
begin P_pick2 arriving
+ d/ s# l7 V7 N6 _4 j: Y2 `2 X    set A_i to 11
! X0 I( A1 O+ q    move into Q_induct22 R1 p) {. u! E: S5 V  A% u1 G
    move into pickaisle.induct28 T' @7 G, ]$ c
    while A_i<=30 do begin
0 a" k7 C& R) t  |. X. E" x& e        travel to pickaisle.con(A_i)
2 i4 h8 X, t* A5 k& s: k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 O4 t! J/ N! a1 z$ V% F
        else wait for 10 sec
8 u) m4 \8 Z' n9 `! L        if A_i=A_leave then send to die9 I$ D1 g/ w1 F: m- W/ J
        else inc A_i by 1
' V4 _: [: A" E    end" }: N* {: @6 |) L2 c0 B
end
7 R2 ]3 z& o/ g/ T. |" Q$ N, z) G9 u8 Y& k3 c4 ]
begin P_pick3 arriving
1 A- ]: W7 u: x% B6 W8 ^2 ~    set A_i to 21
+ {, S$ K! Q0 S) R7 J- v9 `  r( H    move into Q_induct3
  f$ a! a) F/ T( K$ ^; ~9 z3 h$ P    move into pickaisle.induct3
4 ]. r+ e. W. `* M) @  Y3 U    while A_i<=30 do begin; w( N1 @/ K  s2 p/ q5 Y
        travel to pickaisle.con(A_i); y$ K7 h, k. c6 o( W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. K$ N" F, a* N8 G
        else wait for 10 sec8 G' b7 A+ j  {! L0 K: R+ |3 v- o1 Y
        if A_i=A_leave then send to die9 J8 `! H! G" \! ?2 l& k
        else inc A_i by 1/ D8 _" c- w9 c2 i
    end
) n/ Q; _9 H3 L& k7 o7 M$ K# z! F* 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是个什么东东?
6 L7 f3 J" {0 ?/ gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 m+ P& N' X4 q. k* `

, F  G- f- ~' \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, p, L' b2 L' f1 f) i' G, X
9 n% @! J7 V# g0 G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& N. w6 H5 s. j2 F! p8 C# N# [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* o. J0 J3 D' m( `6 B7 F, D
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% \4 m& z/ h  w( w* ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) y" p! j/ t" E
begin P_induction arriving" S- f& B7 J9 f- Q
    clone 1 load to P_pick(A_induct)
$ H& J4 r+ p% U7 s1 Q+ ?end最大的系9 C0 W1 T; q$ l2 f" s; `& r/ d

  j: T- x# z: c3 Abegin P_pick arriving
9 ~& |. ~+ f8 B! [  B% e/ n    set A_i to procindex * 10 + 1
% d: l: O6 H0 v* z    move into Q_induct(procindex)2 I/ l5 d7 x) D' B4 }# ]9 Q  P
    move into pickaisle.induct(procindex)3 J$ x7 Y# `" ^; Y# V( D' p
    /*check the type of pickaisle.induct(i), for your last problem.*/8 E7 @0 |" n" u+ Z! g

  r4 A' E- s" R' {0 ~6 }. l    while A_i<=30 do begin
0 j. P5 i  z1 [: G        travel to pickaisle.con(A_i)) R9 S7 u2 q2 ]/ y' ]$ ~5 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' P0 r+ r" n( g9 y        else wait for 10 sec1 \0 `- L* o& e5 a
        if A_i=A_leave then send to die
. X, D, Z; K3 E  @, x        else inc A_i by 1
- ~# Y( k) f  J# _, E# @+ O    end
. V; L& E2 a; U% d5 fend
' b8 ]+ D2 o- s0 L* Y0 A
2 l' c/ B# Y) B0 `5 B其中的procindex为整形,代表当前process的序号。
( W. V4 ]% w  ]- J8 T0 T. D6 ]% ?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-14 19:02 , Processed in 0.016477 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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