设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6344|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! v  i0 X( p+ b( ~  C5 M" P; a5 e2 ~' ?: ?* 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中的数值,不知道会不会有什么不妥。! v) g2 B: b! S" I4 i  Z7 f

9 g& s. @6 {7 e) cbegin P_read arriving
) f7 s" ^9 N  J  e    while 1=1 do begin
0 t. f. Q3 Y& F$ \5 A- z        read A_tote from "data.txt" with delimiter "\n"+ |+ H% z( g' ]# i/ O9 H4 j
        read A_time from "data.txt" with delimiter "\n"$ ~' I; I% I- r! z" A* ^3 A$ N
        read A_leave from "data.txt" with delimiter "\n"8 \4 i7 Z2 ^9 ~. A- b
        read A_picks from "data.txt" with delimiter "\n"
6 q2 ^! U, C2 P; R$ z7 }0 X8 B. }        set load type to A_tote6 |  y& t$ C9 l' T# X
        if A_tote="tote 1" then set A_induct to 1
* `  n! Q" U, `7 Z        else if A_tote="tote 2" then set A_induct to 2
2 k+ L( X$ _: I$ ]2 A            else set A_induct to 3   
' y9 Z, m1 a& a" Y        set A_i to 07 ^6 b! i% e: Z
        clone 1 load to P_induction# y* }9 S% Q- J1 Q7 l9 V
        wait for A_time sec1 s# l1 i' X9 F3 l/ I: t" h
    end
; ^) ^0 k$ F0 }0 G. s- z% Send- k& h- c2 C& y- T0 X

; c4 z  _7 d( y! dbegin P_induction arriving
5 q* Z9 x! v' ^+ a9 {& Y9 o0 r* W    if A_induct=1 then clone 1 load to P_pick12 i- I9 E8 m5 ~: a
    else if A_induct=2 then clone 1 load to P_pick2
; E- m( f- K+ p& O( ?& e        else clone 1 load to P_pick34 M+ I# ?: X# e7 f; I
end
4 @, O8 U4 i) r' G+ g
; c% R0 k; y1 [begin P_pick1 arriving
$ ~' T1 K) u& j    set A_i to 1
7 D; d# h5 _& f' X    move into Q_induct1
7 e0 U, h, ~" u5 X1 N! Y    move into pickaisle.induct1* f3 R- i  |) }* u5 _( q
    while A_i<=30 do begin
7 @" i8 {5 V/ Z& _! B3 a4 |        travel to pickaisle.con(A_i)
  G) c! U) z! E: e9 T/ p0 g! R$ h/ E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: d3 f2 h" M/ ^
        else wait for 10 sec3 `* l& \/ @" F. q5 h( ?
        if A_i=A_leave then send to die
' s. l. B. m; A$ V+ b* U6 n0 l8 x2 C0 Y        else inc A_i by 1% ?( O( u! f+ W: J
    end
- D5 x  e: T- Wend6 K- E9 f! Y3 I' Z& ]: c+ `

/ h8 g+ ]/ b, i; K; _; J4 `begin P_pick2 arriving6 `1 M$ x  Y/ ]& o% U6 p
    set A_i to 116 W: ~. j% A9 L
    move into Q_induct2
& h( V1 v5 \: |+ A* `4 F    move into pickaisle.induct2
6 i, c. A2 D" G8 M2 q3 }9 X5 J/ `' U    while A_i<=30 do begin
3 q, v- v3 T' ?4 ]+ I4 Z        travel to pickaisle.con(A_i)  i* M7 |# \& I; a- B- S: `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ }/ I% V* A# {! Z5 Q" D3 q
        else wait for 10 sec, I4 E% k! M, P' \
        if A_i=A_leave then send to die
; H8 b) R# C9 g; Z& X8 r! f* j        else inc A_i by 1
# g" i1 q5 T7 d( b5 U/ x    end
9 H. d% L) O8 x2 ~/ m0 l! kend
7 w, D; Z0 f! y# F
( O8 i' @& ~8 D' M& h7 `begin P_pick3 arriving
, h. e' z6 k/ w% h    set A_i to 21
$ g3 a6 k; L( O" G. C& O    move into Q_induct3
! l: F3 P: y7 ~% z0 ]. u) d    move into pickaisle.induct3! v. r, E5 e3 G' h2 h
    while A_i<=30 do begin# D2 d6 w$ L' W+ o
        travel to pickaisle.con(A_i)
/ w& I7 u9 Z" p; t- a' }( y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: T; m) f. ]8 n1 w3 }, b7 k        else wait for 10 sec
! h# n. E% g) t' E+ ~% e        if A_i=A_leave then send to die
8 i- @9 ~; n% c) {/ K5 z. J        else inc A_i by 17 n6 Q# w$ ~$ z3 s
    end2 ~' h. |0 W- P& a$ g
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是个什么东东?
8 A, A7 w4 X2 g$ a2 l6 [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 S1 {) l: o' |. U! t8 H% a
& `7 Y# h2 j' b
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- S( R5 S' S+ {, m3 J+ {2 m
2 L/ `& H! B, N9 L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 |) O# L$ a% E2 V1 t2 ?; I
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ [/ s& S7 z  _6 D( k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 a, B4 x/ i. o+ b3 v# m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 O. H, O. c: S' x* ~6 Vbegin P_induction arriving2 x" `( }. O1 g  t2 t+ T. w. p& Z
    clone 1 load to P_pick(A_induct)
) _" m6 |- W: q7 f6 L( b. Yend最大的系
- ]$ J; P/ L  \$ s& V% \
' \$ a- k8 |/ @' l( y$ ?# `0 _begin P_pick arriving- c& `) B: Z5 c4 D6 x8 _
    set A_i to procindex * 10 + 1
5 r+ Q) |' E! c    move into Q_induct(procindex)$ {  U' z6 Y: M. H# j
    move into pickaisle.induct(procindex)
: ~$ w/ V4 p# O7 A8 S+ Q    /*check the type of pickaisle.induct(i), for your last problem.*/7 j1 X7 P( H: h: n; a% ]
+ L2 P- @/ S+ a
    while A_i<=30 do begin. u1 x. l8 `7 m: M' ^/ v7 R
        travel to pickaisle.con(A_i)
* r7 A2 L% A3 s; P6 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ A3 w6 y# }: l2 Q! x; C) T        else wait for 10 sec
4 a+ q- u9 E1 f1 {' S6 e5 V. Y, B/ ]        if A_i=A_leave then send to die
! [7 m8 R) \; P6 z        else inc A_i by 1# r0 f* s8 A9 j; G0 N
    end0 j7 Y9 X, z! \; Q  c6 F
end
8 T7 e: e/ l+ K9 v. i
' y( i5 q# ?) C. y5 h+ y: e% l其中的procindex为整形,代表当前process的序号。
; T; K, J$ c6 c7 A6 {3 B  o) ?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, 2024-5-12 19:26 , Processed in 0.011791 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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