设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13819|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 H# {/ ?, F9 Y' O0 c" Q7 q) f; F. l9 m- M$ 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中的数值,不知道会不会有什么不妥。: Z+ @$ R) P$ F8 O, u. E
' g7 i* {+ u0 P* ?
begin P_read arriving
2 {1 K% i" j; c" o    while 1=1 do begin& l6 M" x' g6 ^6 }% R" w% G) y
        read A_tote from "data.txt" with delimiter "\n"2 l7 k, ]( b! T2 j) @. P6 ~0 i3 h
        read A_time from "data.txt" with delimiter "\n"* E3 V$ j1 V! |3 J8 z
        read A_leave from "data.txt" with delimiter "\n"
. G: h4 J) h0 F6 z/ ^* z        read A_picks from "data.txt" with delimiter "\n"; g1 z2 |; c: b/ d; g6 X( {
        set load type to A_tote5 M8 i3 H$ H6 ]3 m6 H/ z
        if A_tote="tote 1" then set A_induct to 1; n, j: z1 Y: E6 p( Y
        else if A_tote="tote 2" then set A_induct to 2
1 ?4 Q5 E: J9 O, {9 r" w            else set A_induct to 3    4 ]* y0 |  Y* n
        set A_i to 04 k+ o3 Z, [& n; z4 b6 x: d& e
        clone 1 load to P_induction, e- Q. Q, H( {9 z+ a: u1 ]0 e9 \
        wait for A_time sec
, b$ {9 J' n9 A    end
* a" E! Q" U3 [  D* ?+ send
! n1 u/ u. S; `+ D9 e9 N$ R: S6 B- H& M# w
begin P_induction arriving
2 N( }! C* P4 Z7 `" ]2 A    if A_induct=1 then clone 1 load to P_pick1- r4 Z- n0 d0 i3 J2 O! e* u
    else if A_induct=2 then clone 1 load to P_pick2
- s* i- K7 y1 m8 F  K: ^" a3 D        else clone 1 load to P_pick3
- P0 c; \. m; n* w! s! Z6 lend5 r1 O) G# y3 c- p( G+ I

  y/ V1 V7 W% H$ s" [begin P_pick1 arriving8 k& a( W, R" p# t, Z
    set A_i to 1
- ^5 I% [) q5 P# [! Z5 L    move into Q_induct1
( g0 L5 F* A7 \% ?  e" \    move into pickaisle.induct1
1 D. i/ D, E# K, b/ b- @  H5 v    while A_i<=30 do begin
9 ?2 ]4 @5 |4 `' \1 r* R/ O        travel to pickaisle.con(A_i)# s# D0 W8 t; ~" B( K4 i) z# f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 J( h$ a6 f! j# T
        else wait for 10 sec
* W) q. Y0 S2 x        if A_i=A_leave then send to die
: m# k( n9 S( F& L        else inc A_i by 1
; l) W/ H  B5 x% o, w9 ^. B    end0 U; D1 G' r/ r8 _
end
# _4 v6 O& L# d% ~9 N- p1 S2 e  w8 t# f% c+ Q
begin P_pick2 arriving
/ I7 q/ Q- ?; `    set A_i to 11
7 L- I0 E, g1 r/ D  A    move into Q_induct2! \8 o6 c+ B6 I$ T4 k9 Q
    move into pickaisle.induct2
3 w& U8 w2 \* W# U7 Z7 r3 d% G1 I0 l    while A_i<=30 do begin- W9 e, N. T7 ]- ^4 m! ?' O+ N
        travel to pickaisle.con(A_i)" X# W1 E  R5 @1 \+ l7 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 E# O. z. \5 i8 ?! a
        else wait for 10 sec
3 f- S& H) `! l4 |* Z8 A        if A_i=A_leave then send to die! ~8 D/ A- n$ y5 {  @/ W0 \: s
        else inc A_i by 1, |) J& j0 D3 m( E- R  ?1 u2 d( v
    end$ Q$ b* f- r4 j6 `7 Z+ ^! {! P
end
; X3 x/ ^: u+ w2 z& c2 H6 p- G" `' e( b, g/ y: ~
begin P_pick3 arriving" R& \) u0 r5 Q; O1 R+ A  a3 P
    set A_i to 21. A. L  }! f) d7 D7 y+ T
    move into Q_induct32 U, p+ n5 l; g8 J5 o  T: H, z
    move into pickaisle.induct3
# v1 q3 \+ S3 P  q, O    while A_i<=30 do begin5 V' U  c% f( l; D, F( l, g
        travel to pickaisle.con(A_i)
& y$ B9 j, [. s  I+ G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% b6 S* A/ s6 ~8 Y* ]        else wait for 10 sec
7 W7 h9 X+ |7 B& R! v/ u        if A_i=A_leave then send to die
/ T# K! y2 j0 [% x& C        else inc A_i by 1
% u# e2 w, Q) S7 l: {5 b& A0 X    end/ e1 [: q% V) }3 x! E
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是个什么东东?
; @' L& \7 s1 o7 M2 x: A# p& lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 a! S" F4 U: S' B
. C( w6 D5 j( R3 Q  |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 l9 }5 i  }% e* l% Z6 q
& p1 }* x" X8 F) Y* Z7 e* p! }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, l( a- V1 k8 k$ M# ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# C; G2 _+ x5 }  f( ?- j% E
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( s1 G6 I5 f6 j1 V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" D5 w" `. g* Y3 f* D7 _& ]* y+ _
begin P_induction arriving7 P) A# k5 `$ C( L2 B2 p
    clone 1 load to P_pick(A_induct)- C- F1 f% N' v# P# @8 R
end最大的系6 b3 i/ E% Q0 S. r7 [
6 f# a: K/ w. y# e: F
begin P_pick arriving
: W4 g, V+ Z( {1 \    set A_i to procindex * 10 + 1
/ U% d1 O9 |, Y! K. Z2 I    move into Q_induct(procindex)
' I) q' f# z: S/ _- t; |    move into pickaisle.induct(procindex)$ m# m& H" S# q- W. x3 L$ _! Y
    /*check the type of pickaisle.induct(i), for your last problem.*/8 s- M6 E) x  |  d- ~& L

* C9 R3 }6 J6 E4 M! Z, L    while A_i<=30 do begin9 n9 ?) l% }; |# B* ?
        travel to pickaisle.con(A_i), Q) U& j$ h% `5 ^! A9 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: @; h! T/ q0 m+ a+ h$ i
        else wait for 10 sec; y) u! @% [1 C4 E$ V" \7 K3 m4 T
        if A_i=A_leave then send to die
6 d+ ~0 B/ A" p4 {* W        else inc A_i by 1
& X" H2 U) J8 g) Q& o1 G; X4 N    end2 h% i. @& ^0 \/ V6 B% T0 s* x
end
! M/ P& |% {4 G. ]$ d4 C# h2 g0 E9 J* t/ R+ ]( z) m/ J8 ^
其中的procindex为整形,代表当前process的序号。
# a# D( m0 \" P& S1 X* [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-8 08:49 , Processed in 0.017631 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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