设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12615|回复: 2

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

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

$ l7 h7 a8 h8 q! f# O$ r7 N% H我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ L. p! a$ ]( E+ F2 [& m; Z9 c# e8 ]

/ b7 r0 ~( S9 x$ }begin P_read arriving& v/ x( ?8 o5 H0 \
    while 1=1 do begin
7 o; E% I$ z0 C! v& p% V) @% P8 A        read A_tote from "data.txt" with delimiter "\n"/ R1 T) ?+ q- U/ }3 E5 M1 c
        read A_time from "data.txt" with delimiter "\n"
9 n( A6 g- O8 u; E# R! i; }        read A_leave from "data.txt" with delimiter "\n"8 x1 L2 D" Q+ P. u, B7 ~
        read A_picks from "data.txt" with delimiter "\n"3 G0 a9 s* p+ R
        set load type to A_tote, O$ d1 h. Z/ }5 ]0 ~
        if A_tote="tote 1" then set A_induct to 1
/ |/ G4 j& e0 ]% Z0 Y2 z        else if A_tote="tote 2" then set A_induct to 2
, |. m! V9 H' U* v  ?1 S! {1 ]            else set A_induct to 3   
& J! W& M8 s  t  V8 t        set A_i to 0  [: |/ b; Y* [0 c' a
        clone 1 load to P_induction
" c; }7 B& m( O. o4 Q7 H$ [        wait for A_time sec
$ p9 S! ?( z/ T1 ~( z7 i    end6 k' x+ |  |, r5 ^: _0 ~5 R
end; c0 d0 N4 U7 R( B2 n

" q# I( e' {8 _, w4 W4 [. ~begin P_induction arriving
0 V- ^  D% O9 c  S2 f2 T    if A_induct=1 then clone 1 load to P_pick1
' j+ w, t9 b$ m( t    else if A_induct=2 then clone 1 load to P_pick25 T6 L- k7 C, H) u2 O) ^
        else clone 1 load to P_pick3
4 f, Q7 [! h+ _6 ^0 fend# v% U: X6 L9 i3 j' i

: T/ e* `$ y$ m" r  h. @9 gbegin P_pick1 arriving! g: ~+ S  y$ X( u: w, p& G$ W0 U3 I
    set A_i to 1
% c: h$ d4 a& {4 t    move into Q_induct16 R7 C" a6 L" H( g! \% R
    move into pickaisle.induct16 ~+ }" n5 b, N3 ]
    while A_i<=30 do begin- D7 R$ \5 S" D+ d. X& V$ G
        travel to pickaisle.con(A_i)
5 ~- A8 q, \! m6 S5 c# q3 i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ }8 t' d9 B  E        else wait for 10 sec! Q; v0 }7 M6 I7 K8 o7 u
        if A_i=A_leave then send to die
5 h9 l* J# C+ v" E: |        else inc A_i by 1
0 U6 p5 X5 l, R7 q4 S( p    end
9 S3 t7 @$ ]: a- oend
2 k7 `. P" {  r8 ~
1 M- u3 |1 W( Ibegin P_pick2 arriving
# \* f0 l$ ?: }4 r; ^) }1 l1 A3 f% Q; h    set A_i to 119 z" D$ P, t- x8 V5 h; o
    move into Q_induct2
4 c4 Z5 i/ [3 V; S5 j7 F" d    move into pickaisle.induct2& [3 b9 T' |# g
    while A_i<=30 do begin. R) @2 |6 x7 ^9 `" Z  R9 x7 U4 a
        travel to pickaisle.con(A_i)
/ Z7 i. k$ w4 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; y; t4 h' {- v4 b  S$ e& P5 g
        else wait for 10 sec' p/ \/ b+ y* G; A: [) b1 t7 I; R
        if A_i=A_leave then send to die9 ^, z+ a& U; ?& a  O, s/ z" R' v
        else inc A_i by 1
* P4 w* D3 o2 H. ?7 u2 |7 S# M0 K, S    end
# ]  k$ b7 b5 A  ]; bend/ x% L3 {- L  v) c+ C1 k4 e5 a
: J& e/ f! m% [# b6 R4 Y
begin P_pick3 arriving1 x) f& R+ V' q# I. D* z6 B( p8 a
    set A_i to 218 x  _" F; p/ ?( o$ `" x4 F: _
    move into Q_induct34 ~! _; V, @- O* N) ], }, Y/ I
    move into pickaisle.induct3
  K7 ?) B% Y4 A! F1 y* G! u    while A_i<=30 do begin4 ~% w: \3 n' ?4 M' V$ U3 [  i
        travel to pickaisle.con(A_i)$ w' F( v9 t' m2 D' |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 a. f2 O/ x# b9 I# |: J4 j' e        else wait for 10 sec  R& M6 k6 L# H  |
        if A_i=A_leave then send to die9 `# z% \/ Z8 b
        else inc A_i by 1# m4 F+ c& i3 R3 l6 k0 s% H1 Q- k5 ?
    end
- c5 l1 X  S4 j( E- E1 Hend

最佳答案

查看完整内容

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是个什么东东?
, q% B7 L8 [' m: k9 l" _& Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ O  s* l  }4 g6 W. u
& e2 }& [/ J# m  X7 s/ s* b- x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( z# f, c9 y, s, F) n+ j
, G5 C4 S- R0 I6 [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% l" v! H! ^9 t' C: O9 c/ \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ l  Q' e# y9 d0 U8 z+ @. P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 i9 K9 l  K, ~) W* i6 Z# d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* C1 p* {3 P( p- f7 l6 t% a
begin P_induction arriving
2 n6 `1 l( E% p4 m; S( n  ~    clone 1 load to P_pick(A_induct)
2 B: _9 l3 E5 \. Kend最大的系
* O+ S) C- r; }2 R. @# z# M3 l" ?
begin P_pick arriving
' A4 ]# G7 x- `5 ~7 G0 O! U% M    set A_i to procindex * 10 + 12 t: U  U/ n! W/ H1 [1 E4 N1 Q5 G6 P; ]
    move into Q_induct(procindex)
! S8 Z3 V" `, P. Z0 j0 S: K8 N. v; ]    move into pickaisle.induct(procindex)6 ]  s$ {& o" t7 E% ?5 t2 q2 A
    /*check the type of pickaisle.induct(i), for your last problem.*/' D: r( W8 `1 j4 S: F3 @0 B
8 H4 |- O1 f2 ^+ P' ?1 ?0 N! e
    while A_i<=30 do begin, R( d- F6 ]3 `/ ~1 v( h
        travel to pickaisle.con(A_i)
5 y  w6 E+ R6 {- S# K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a% _; `  W( {# U5 J        else wait for 10 sec4 G2 m& D) @9 F2 p- y
        if A_i=A_leave then send to die5 T% [  q6 s1 R% m
        else inc A_i by 1* H8 }! C) Q: u
    end
) W# b# d" l; L$ w3 W& T  jend- F1 \9 Z$ X; |) B* k; \

. K! M( G& N. W3 }5 i; u& j其中的procindex为整形,代表当前process的序号。3 ~0 t& C5 _2 T
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-5 05:49 , Processed in 0.020067 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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