设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14006|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% P0 a2 @( h, D4 Y' H. ]( e4 y: @0 u3 C8 m8 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 d- {. R/ A9 r% {) B) v
+ S7 |7 s4 Z9 S: ^) h7 W
begin P_read arriving9 J8 n% I8 s4 E
    while 1=1 do begin: K" s2 l( ?! R4 U3 I* Z
        read A_tote from "data.txt" with delimiter "\n"
- d, x( Q! \/ v, v1 g. C        read A_time from "data.txt" with delimiter "\n": W8 X% o) B+ {, j
        read A_leave from "data.txt" with delimiter "\n"
: L0 Y  U: d/ F        read A_picks from "data.txt" with delimiter "\n"# N5 ?0 Z3 k! _
        set load type to A_tote+ C; P. e, l6 G2 M3 x2 k, U
        if A_tote="tote 1" then set A_induct to 12 o5 C! k) d( N) n3 u& ^  w
        else if A_tote="tote 2" then set A_induct to 2: b1 m3 T: |& l& ~8 W" u3 V
            else set A_induct to 3      n8 t( e- V( b! p- H$ ~& r
        set A_i to 0
$ z% h! }% x9 V# `1 r7 l* C( Z* d) ^        clone 1 load to P_induction/ Z# ]4 N; m8 r0 ?5 T/ F  _- |( `1 d, L
        wait for A_time sec
' x. P, e9 {8 y3 M  ^    end( N; w! _$ W0 G3 D
end5 ~. i6 D4 T5 z% ~

1 m/ X! }4 H2 Y# b) n5 H. obegin P_induction arriving5 T# e- j1 J4 K8 ?$ c, d5 y% P1 n
    if A_induct=1 then clone 1 load to P_pick1
" M8 _3 y) _) K+ x    else if A_induct=2 then clone 1 load to P_pick21 ~7 F: B* C6 j+ K" I
        else clone 1 load to P_pick3
+ M4 ]$ D, \% z, q6 Uend
4 @* X) Q* m/ a1 v6 P  M
' {) c0 ]7 S: x9 ibegin P_pick1 arriving8 o; G* i% S5 |8 C( P
    set A_i to 1+ }+ u% D. g2 J0 _7 y8 A: w
    move into Q_induct18 g# M6 ~' {( w; b
    move into pickaisle.induct1
  p& w" m! D9 x; _: M% t    while A_i<=30 do begin
% q6 g7 c9 x) {5 \$ i        travel to pickaisle.con(A_i)
, s" F+ B0 \! \5 B4 D, T# ^/ k7 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" g4 w( ~* b! W, U/ M6 {
        else wait for 10 sec1 v# w) c: Z  b  C
        if A_i=A_leave then send to die! ?) ?& I6 `% O+ P" v8 z  b9 f
        else inc A_i by 1; G. q' ~& N4 T. y
    end+ A4 G! N* U+ c
end3 M' g0 |. U4 A
! C9 v8 e" @2 p5 J3 I$ @! P% C
begin P_pick2 arriving
5 r) u& q$ z0 o' q    set A_i to 112 {% v. _- N( K
    move into Q_induct2. h: Z; L( j/ t7 o! a- y/ D4 S/ i
    move into pickaisle.induct23 v- w4 C7 W8 Y
    while A_i<=30 do begin
- _9 f! @4 z3 ^" e( C5 L        travel to pickaisle.con(A_i)" W" q: a5 n& m5 N! b& J" V* n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. O) C5 m( p+ q. F$ P: M
        else wait for 10 sec
$ W3 f' N4 p9 @& }3 r  U% {        if A_i=A_leave then send to die
) K6 r$ f9 P) W0 Z. D        else inc A_i by 1, ]6 D: R9 O/ x! w& F
    end
- x$ T4 }# v3 K) l8 e4 q5 ^5 ]end
( p) L0 q% Q6 o+ ?3 u8 |) g) D: C1 t9 C
begin P_pick3 arriving+ f. V; J$ f. s9 V! k. y
    set A_i to 211 X+ s% [, Q1 K; x" h" B
    move into Q_induct3# f# I- c5 t! F% q+ x+ V: y$ b
    move into pickaisle.induct3
& [- K) M& u. d4 n& b4 x    while A_i<=30 do begin; j1 B% z+ c% P' I5 i
        travel to pickaisle.con(A_i)" L1 o9 m5 `+ ?  {  ]  `% V3 X$ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ~3 o* V% P% b2 V6 V0 u% s
        else wait for 10 sec1 @9 p! j  b: c  F( }$ Q" M
        if A_i=A_leave then send to die" K, x, `$ t6 f/ m1 r3 F
        else inc A_i by 1
3 s4 V0 J7 g2 X5 j7 H6 v$ m    end! X7 l6 ^. j) p* l2 ?: w1 x
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! }" d2 Z1 N( o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: C3 `( ?! v7 n0 w4 |  w0 P) _/ Q7 M

" C  D8 c) \5 S$ ]AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 |  h1 ?; D# e
5 m% n' e7 t  M  @5 q7 y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ R* S7 O9 F) ~. M* _+ V- V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 q; y& M$ K8 e- R+ Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 G$ X( }( Y4 E: S* j% @9 w3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 x* ]! j, L9 W/ G3 vbegin P_induction arriving
) o" f( |. `( K$ P% D2 c# F    clone 1 load to P_pick(A_induct)
* h- c# S- ~2 @. Tend最大的系
5 g) K* E' ]5 k0 O* P. P# o/ _. s! P& x% a5 x0 H
begin P_pick arriving% C% w: G, e: E
    set A_i to procindex * 10 + 1
4 ?  h& F- d+ P; C5 F" ^    move into Q_induct(procindex)
7 z0 S- `6 _. |: I) J' T    move into pickaisle.induct(procindex)
# a- o3 G" d4 f) `% q# I    /*check the type of pickaisle.induct(i), for your last problem.*/* j! v# a& s, G9 a! g1 e$ i0 S
% S. b9 \2 R0 o7 h( ~
    while A_i<=30 do begin
3 g8 L- {6 Z$ i1 W  u  v* |        travel to pickaisle.con(A_i)
8 G( u1 J! O  }6 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 a% K% m; N. c4 f
        else wait for 10 sec& y+ g* C8 A) H) N
        if A_i=A_leave then send to die
& K* y7 }3 a& `4 d7 s& g9 O        else inc A_i by 1( \5 I& J) o* x
    end4 `: U% R) Q/ p, Y5 p9 L1 G
end
& q* G- l  h0 V, V# V+ N( I6 `0 }- {8 T6 P$ e
其中的procindex为整形,代表当前process的序号。  o/ x" C3 i1 k8 i2 h0 R; x' K+ S
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-5-30 00:40 , Processed in 0.014874 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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