设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12463|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& g# T' r' Q% u0 Y! E6 Q7 R

" Q+ ~1 b; O- k; o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" R! _+ F0 \2 j0 b
1 g1 {+ M$ L& e5 N* Tbegin P_read arriving4 O' y* ~1 b+ v/ _2 e
    while 1=1 do begin* f7 L) `& O0 s, F3 k& ], C% {
        read A_tote from "data.txt" with delimiter "\n"& h5 y9 t  E- W' K0 G1 v+ ?
        read A_time from "data.txt" with delimiter "\n"+ U+ G9 B# l) d$ v
        read A_leave from "data.txt" with delimiter "\n"; }% L" n% t, v& v' w
        read A_picks from "data.txt" with delimiter "\n"( ~& U7 V3 n( d; O# ?" x
        set load type to A_tote
3 x$ a9 `  X$ u5 q, D0 N        if A_tote="tote 1" then set A_induct to 1
4 a; h2 o4 Y; ?8 m- W        else if A_tote="tote 2" then set A_induct to 2! Y3 [8 N+ S5 `0 ?; S% @
            else set A_induct to 3   
3 \1 n) O* ~; B        set A_i to 06 g& r0 E$ q6 I+ x) K/ m
        clone 1 load to P_induction
( F5 ?! B2 E7 A1 r7 Z        wait for A_time sec" v& F0 C) A: e  s. [3 a3 |8 I7 c
    end* h/ j  E( z% z# Z. ]
end
0 A: W6 Y7 e+ j% F0 n6 e; c) A0 }* h% C$ `" H
begin P_induction arriving0 K6 L. R/ _4 F7 u+ l3 l+ r( l
    if A_induct=1 then clone 1 load to P_pick1- ^7 m0 B- y# _$ e3 O' i- B
    else if A_induct=2 then clone 1 load to P_pick25 J( C/ I. }' B& W' H4 C5 Q1 J
        else clone 1 load to P_pick3
9 D' a1 E, n+ pend
  [# ~. K5 F3 J& @$ F( ^3 g6 U# ]# I, h7 Y
begin P_pick1 arriving+ i0 O8 {6 G- N( f: |/ u$ r
    set A_i to 1& E4 {$ s) F% l2 {; i
    move into Q_induct1
; i% y9 ?  N7 Q% X( u    move into pickaisle.induct1( F2 n) [& \7 W2 I
    while A_i<=30 do begin
$ `6 Z5 \4 Q$ [! Y( c4 C        travel to pickaisle.con(A_i)8 Q. j& O& Q# Z1 T/ A/ \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: }: t1 B& u" s; @" ^& `0 [        else wait for 10 sec
- z8 ]5 g* P" L0 N0 d/ e        if A_i=A_leave then send to die
4 Z- s( I% n, @- h/ N  K        else inc A_i by 1; n) V- R2 ~$ Z4 T- t* G' E5 W
    end
. E, s+ K5 C0 H' J/ J9 E; Oend( v4 f+ ~; _' K, ~7 E

4 z; K. f# l3 O  T6 ~. ^$ fbegin P_pick2 arriving
( @6 E/ ~  r' _  h% F    set A_i to 11
6 k1 r/ _/ [3 E0 d    move into Q_induct2! Y3 F6 r  T7 D% `: A
    move into pickaisle.induct2
9 O+ H7 m, p, W  m4 |, x- r& b    while A_i<=30 do begin
& p9 ^+ m# Q( z* W; c. M) |        travel to pickaisle.con(A_i)8 N, M7 C, ^9 m" i6 ?( `" K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 U  |1 S$ m+ P9 r) N        else wait for 10 sec
, u: k6 i6 F3 @; S        if A_i=A_leave then send to die+ N- Y1 W' ^8 n( u1 j. W" ]
        else inc A_i by 1" Q7 `& v1 o5 T. R" F
    end
' n1 z4 c. J$ f, ^, `- M6 W7 |% rend1 U9 I. z) {  {" s# }0 M, m+ u# a

; Z8 r  }/ G3 z8 b& Bbegin P_pick3 arriving
7 s7 Z6 L! \- W+ D    set A_i to 21
( O7 |! H- Q5 f    move into Q_induct3  R- R; o. C* n5 {9 V' d) y. u$ c
    move into pickaisle.induct3
+ Y( Z1 A; r; {& b5 Z" {. j    while A_i<=30 do begin
1 P1 H1 W+ h% K3 D! Z        travel to pickaisle.con(A_i)- @8 u* f' ~/ s3 K  C' S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 a% U( i% M" f5 j8 s- ^( {
        else wait for 10 sec( r5 L% E! h) G
        if A_i=A_leave then send to die
) a  {% D- F4 C2 _& b9 c" }0 E$ \        else inc A_i by 1; n  w& m7 V( b0 S$ ~6 A+ N% ^
    end# ^( q( s8 s1 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是个什么东东?
; S; @' v( B! k) p( wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 j  ^# b3 w! j, A

0 s' w0 _) L8 X& u7 E+ a* \0 yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; C* X% P/ l8 {6 V: v; L6 @9 Q# R" z5 Q7 j' Y5 S
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! e" Y1 L; k( ]. z  ]1 E$ L1 k  R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: K9 W8 Z. B- e) k' J4 P. R0 U" L6 v% z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 B+ P- k. f* w( M  V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 B+ m3 `8 S, B/ N# ?begin P_induction arriving
% I/ D' v3 {) |7 h8 N" t8 t    clone 1 load to P_pick(A_induct), r; K4 E. G; A% e0 o. I2 e8 g/ M/ j
end最大的系4 h" `# S) u6 [" }! ?" e
/ f3 P9 [/ |: K$ {% Q* A
begin P_pick arriving
. V! J6 R# S3 X0 U9 d- W    set A_i to procindex * 10 + 1  r  r+ v5 m! Y; G( T& s. W3 ]
    move into Q_induct(procindex); C, ^! H6 W5 O7 T& E/ h4 a
    move into pickaisle.induct(procindex)- C6 E8 Q6 U/ h! g7 n  s9 l
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 E! C; h3 W9 x/ k5 C  o1 ^1 F9 @- z8 w" [
    while A_i<=30 do begin
5 C5 n% L2 X' I$ g0 m; y- ^        travel to pickaisle.con(A_i)
! g$ x( x$ X; B/ ^0 m5 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* T) R% g  b: B( l  e6 l        else wait for 10 sec
" c# }& l0 _/ `- c8 o: X/ B( d2 I        if A_i=A_leave then send to die
' G2 I0 q3 E2 f7 k* p" `        else inc A_i by 1) r, X& r1 G+ u# ~( Z) Q
    end7 f! B0 `3 m8 ~
end
# x* Q  P" f1 w. x8 X) P+ E- c# _6 V" e, q5 i0 {" L- k
其中的procindex为整形,代表当前process的序号。
, R5 b: H6 `8 n5 ?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-1-26 09:21 , Processed in 0.016282 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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