设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12746|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. f5 v9 H/ N1 Y* x
6 G6 H) c$ N$ D. A$ ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 n' J  J5 `: y
5 _* {3 |" [" V4 Z1 Rbegin P_read arriving
, @! ~! k) F8 ?1 m6 i    while 1=1 do begin
. _$ ?& N' s( k; b( o        read A_tote from "data.txt" with delimiter "\n"
' T) i  q/ M- ^1 z3 o; [        read A_time from "data.txt" with delimiter "\n"
( ~% W, \5 v) S7 \' x  T! g        read A_leave from "data.txt" with delimiter "\n"
4 ]: s& A5 |2 h8 l        read A_picks from "data.txt" with delimiter "\n"
* T9 M1 ?  G% }        set load type to A_tote4 a  ^7 z. H7 n6 H3 Y7 P, i) w
        if A_tote="tote 1" then set A_induct to 1
- @4 ^' ^2 }/ U# h2 |        else if A_tote="tote 2" then set A_induct to 2
2 B' C9 r1 E' K) }2 U            else set A_induct to 3   
6 D0 G9 |3 A% E        set A_i to 0
: E, M1 h; N. F" c" x  ]6 |        clone 1 load to P_induction3 [6 z* d3 d1 E2 ]* x- X
        wait for A_time sec7 A9 W1 p$ N0 `2 l
    end/ @% f5 l7 k* o8 e7 k  q
end; I& i! p5 M0 D

7 F( m4 z' ]0 N* o3 bbegin P_induction arriving; _0 W; r$ M, b5 `: A* l( v, ]. D
    if A_induct=1 then clone 1 load to P_pick1( _2 [, S0 \* U- I2 C# A
    else if A_induct=2 then clone 1 load to P_pick2
1 }" k* \2 I  l        else clone 1 load to P_pick3
& m2 T" }; }, P8 t7 t7 G, V; Iend
: @$ X( Q, F" K. _& r4 O: ~$ p+ C+ N- H7 R7 G# f; H6 a3 ^! v+ s
begin P_pick1 arriving. w) J2 G6 c+ Z  t% b8 E
    set A_i to 19 d" e4 ?1 i; p, k6 J0 f0 Y
    move into Q_induct11 S3 S. R) q) M* u
    move into pickaisle.induct1
8 }, V0 G1 B& h: D& X1 j0 [4 d    while A_i<=30 do begin( V6 D9 L; ^- t) z  q% v+ }
        travel to pickaisle.con(A_i)6 T7 S( |5 F6 G) q, G* g' q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ N# r4 }( D; p" w1 j( y& E        else wait for 10 sec
) o, J: d% ^  l; m- i        if A_i=A_leave then send to die
5 v4 U2 _7 L- v" y  @        else inc A_i by 1+ G+ c7 s+ H  ^" z  o5 ]2 a/ l( l4 Z
    end; d  t  [8 I: \6 P; F# P
end
8 k  h6 g1 F5 h* w* B. a1 {1 u) X
begin P_pick2 arriving
: }  b5 t4 k0 E8 y) j    set A_i to 119 ~9 N  P) V% V( E. h. U, R
    move into Q_induct2
1 V! U  y7 A. \+ T3 g    move into pickaisle.induct2
' n2 |* g7 ~! m    while A_i<=30 do begin/ s! F, f; p7 H+ f4 b- T; ^
        travel to pickaisle.con(A_i). g% h. t' e& O" j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 b) w; r" O; q% w+ @1 h        else wait for 10 sec# O7 G- p2 K/ f7 {' ]3 c  E; s
        if A_i=A_leave then send to die2 E" ]6 F6 T1 E% z; `4 k$ W' d0 r. v
        else inc A_i by 1  z  \, x, ]- X( x  s" a
    end
9 G2 m. P9 s$ w% {; N1 S" @) `3 gend* M& h- d) t( {0 ^/ R9 `

/ w) Z( `: D: w  hbegin P_pick3 arriving4 F5 N* }/ q. k  {
    set A_i to 21
$ ]5 x& w+ G# _' ?8 C# u. L    move into Q_induct3# `+ |% l0 L# p. R4 K+ A
    move into pickaisle.induct3! E- r0 I9 [3 |" e: I
    while A_i<=30 do begin3 p# U; g- `  Y
        travel to pickaisle.con(A_i)& [8 e: d# v8 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 I+ A# {& K" {
        else wait for 10 sec
1 }2 X8 P% p% S3 t3 ^) I        if A_i=A_leave then send to die
" N& n# a, O8 J        else inc A_i by 1) N; S. w0 ]4 m2 \) O. M
    end5 g2 [+ h; \$ i' `; S1 l$ F, d. 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是个什么东东?' c; P0 V: y9 F9 n& K7 C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  s$ F" j& T4 a& U! W0 Y9 J. |9 Q5 C

' K1 `3 ^: I9 T- D! T, R8 ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ i6 ?" ~% @; G- p6 W4 h: p& G  Y% U4 Q7 m& y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ {) {3 N' G9 g
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 {* ~* f$ c+ t: [' ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 Y) j4 N5 x& E  i  c/ b. N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ W# Z) s/ p2 D
begin P_induction arriving. G) Q+ t! P/ I0 I% U' I
    clone 1 load to P_pick(A_induct)+ w, s" B3 K) A7 h/ u% P" I5 E
end最大的系- W" |; z' G0 ]' _* t( f  `* D
3 h) k! w0 W; y, J
begin P_pick arriving" e  @5 d% @; u1 f  o# _: O: J3 p+ ]
    set A_i to procindex * 10 + 1
/ `! }8 l  F" c/ H( |    move into Q_induct(procindex)
% k$ R. q$ ~" d' }    move into pickaisle.induct(procindex)1 T7 Y# w$ i: h1 @# y8 |0 G% R3 I
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 r! }6 o# M% e& c4 F# G: p: w, ~
    while A_i<=30 do begin9 T+ q  D. H$ u! u' j" _9 V
        travel to pickaisle.con(A_i)
5 @. {: z+ S4 O$ ~7 {+ w. O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, f& g/ B' x4 V) C
        else wait for 10 sec
! V; `" r3 `( T' H6 z0 C! T. D        if A_i=A_leave then send to die- J# R4 K6 r3 V! G; N7 q; t, ^
        else inc A_i by 1
% E1 q5 P) G7 L; x7 ~    end' C0 A: U$ l7 W+ f$ n6 n* ?
end
7 |# ?$ K* ?+ e4 H- O" `# w1 n. k  f( A7 Y* ], R
其中的procindex为整形,代表当前process的序号。- @9 c  k) {7 Y  G
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-2-16 22:10 , Processed in 0.014218 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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