设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11617|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. \. o! K& Q2 J0 }4 B" x" D) L
" I, q. M3 `& O* K( ^% m我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 O( c  w8 X7 a  O% J1 f) L2 H2 l: I+ Q4 b2 m
begin P_read arriving* |$ K/ k$ ^) J6 M$ Y3 b8 A
    while 1=1 do begin) T5 J- ~9 R( J1 j
        read A_tote from "data.txt" with delimiter "\n"% R4 D* V+ y" a, s* ?
        read A_time from "data.txt" with delimiter "\n"
. I& F" }1 x! w& u. l, U& E% R        read A_leave from "data.txt" with delimiter "\n"
1 S* ~* |1 T; P        read A_picks from "data.txt" with delimiter "\n"; ?. E2 c# ]# o; T2 O# @
        set load type to A_tote
( Q: B. ^/ O  e$ `+ ^        if A_tote="tote 1" then set A_induct to 1: c* X; V& }% {; q, T/ J  r& {
        else if A_tote="tote 2" then set A_induct to 2
. }( v0 t/ z. X. W& W            else set A_induct to 3    + i3 z. R' x$ R3 l! Q
        set A_i to 0( \3 ^" }( w3 V! \$ U) @6 f( d) b7 t
        clone 1 load to P_induction
# Q+ J) R) o4 D! u: T: g        wait for A_time sec* e2 L+ J. A/ b- ^5 h* B  J
    end2 F1 ~8 n; ~" q  t
end( |% X) n% A! F# J0 p$ u& x3 ?2 K

! z2 o" W) I) e# s2 P) Q" \) zbegin P_induction arriving
# u. Y: b. x. \: s  T' ^    if A_induct=1 then clone 1 load to P_pick17 @8 ?; c5 r4 ^
    else if A_induct=2 then clone 1 load to P_pick2* X, B8 u; F+ g# L6 R
        else clone 1 load to P_pick3
$ l$ V6 m1 J8 p3 `end$ a# q; c$ k8 ^, Z9 [* E

8 x( G: J: C4 L& C3 Q3 Tbegin P_pick1 arriving' L# ?2 X: n* Y& V: _
    set A_i to 1
) c, k: b7 ?8 b! W/ x8 Q( |( ~    move into Q_induct1
! F5 }( ^4 u0 P: |4 F    move into pickaisle.induct1) y! R1 `+ `% |4 i2 f
    while A_i<=30 do begin* F6 L' C1 H" m2 v/ W8 V) a( a, K
        travel to pickaisle.con(A_i)$ M6 y+ n* U2 R& ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a" @+ U& z, l3 y  ?6 w        else wait for 10 sec
% p& B3 L' B3 y6 K: E        if A_i=A_leave then send to die0 E1 @1 K) |" R+ j; C8 N
        else inc A_i by 1
0 L' y0 j( u8 S& A7 I) e    end* ]8 W/ J5 \7 i* `. W' J
end+ c- M) P" Y) r6 }- d
  G. ~: f) O  [3 y) u
begin P_pick2 arriving
* X6 S8 L5 x8 j" q. E    set A_i to 114 ^2 ^: |- Q3 p
    move into Q_induct22 Q0 ]. f& Y# K2 e3 p( q
    move into pickaisle.induct2; K$ R8 `$ O! H) m1 K( g5 x% B# e& {
    while A_i<=30 do begin* L, z# Y0 Z* _; Q5 p$ B
        travel to pickaisle.con(A_i)
3 t  t# P% }' Q7 m5 b6 R/ J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& p7 k5 b# H0 Z        else wait for 10 sec7 _! P2 f6 n# Y* P" b  u
        if A_i=A_leave then send to die
8 e5 o  f/ s. v. K3 s        else inc A_i by 1& i+ t5 {7 ~3 y' f+ O
    end
1 A1 N4 r& I7 h% ~" Q& Xend6 W+ d  T. `" Y4 E/ F; s# V

# a1 E# O% X' Z: ybegin P_pick3 arriving
2 A: ?  `+ W' `2 s    set A_i to 21
9 o" ^8 |8 U; s! ]' p3 ^    move into Q_induct3
8 Z% w; _" V) z    move into pickaisle.induct3
% }+ t1 h, l- B% j$ B( f8 [% B+ n; F$ o    while A_i<=30 do begin* b3 h8 H/ S. ^1 v
        travel to pickaisle.con(A_i)
1 M  Z- z3 H3 P/ q: j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P$ i# _' H6 z; F; ^: ~& k
        else wait for 10 sec
9 X# w9 D7 c: h/ T  r        if A_i=A_leave then send to die
1 y% Y% v+ ]9 P, z( j        else inc A_i by 1/ f3 u, g( D5 F9 j  e4 [
    end# r6 _5 u$ }2 ]/ I# Z9 w
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是个什么东东?) k6 m$ `9 H& G5 b1 {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  Q6 G" c: q- ^6 ?& Q

. D: V! E& s  ~. ]+ U7 T& ]6 o" qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ \) R) w( r& C4 I: s
6 {, H3 W7 v- d4 c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  u/ A0 B/ k2 L. F" X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 f9 z* W) G. ~& l- k' w! K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. ^% O, F7 H& K; |6 y( _& M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  c& ~: Y$ [8 K6 ^& e( r& R0 D4 Ebegin P_induction arriving! B9 a3 w' v( H% G9 c: h3 ]
    clone 1 load to P_pick(A_induct)
1 I% I) V( Q- Y4 ^5 _& [- {& V9 Cend最大的系, b0 Y% Z' n( |- Y5 Y

0 O; r( q) G) `; lbegin P_pick arriving, J+ |$ R) J" }9 B% A
    set A_i to procindex * 10 + 1
" S. Q, L$ Q4 g9 Q" g# K: o+ d    move into Q_induct(procindex)# {1 j/ `! \/ {( z# B/ g2 s
    move into pickaisle.induct(procindex)
* j' V1 `3 ^5 T8 ]    /*check the type of pickaisle.induct(i), for your last problem.*/
/ V& ^- x, B. X: M6 ^6 k$ c# F( T8 y9 }" [
    while A_i<=30 do begin8 I4 W% V( Y3 p* F# w) Z4 K4 i( W
        travel to pickaisle.con(A_i)5 a5 Y5 a5 E8 P! W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: n  }7 g6 r- }- u) r        else wait for 10 sec
& E6 U3 |6 C* V1 P9 F        if A_i=A_leave then send to die
; O  m; d/ g# S# V' \0 g) V6 S        else inc A_i by 1) {! _( ~; _. C6 L! L6 W3 g: U
    end) }$ c6 L6 ^7 p# q
end' J' j$ m( I4 f0 [6 |

+ N" J, p+ J6 H4 ^其中的procindex为整形,代表当前process的序号。
( J( y0 r7 U8 ^3 P- kstation和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, 2025-11-23 20:42 , Processed in 0.019134 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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