设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13915|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( L9 ^, [$ p+ f
1 M  q, O$ ^+ z7 q7 c
我的问题是,在每个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 s+ H1 E4 ^
. p3 x( c0 {, Q; \4 d; Xbegin P_read arriving2 w# a2 y& A& A/ g3 z1 ?
    while 1=1 do begin2 d7 h' Q4 i* K6 B' [9 E
        read A_tote from "data.txt" with delimiter "\n"
, a; S0 u+ e7 v. q1 S3 r4 `        read A_time from "data.txt" with delimiter "\n"
$ z" z! z) x+ q6 E: k9 {- j        read A_leave from "data.txt" with delimiter "\n"8 S# ^9 W$ P! F6 v/ H: v8 p
        read A_picks from "data.txt" with delimiter "\n"
) i' J* \9 i! `% }" C3 b  _' z        set load type to A_tote
& |3 b5 I+ k& P6 Q: c3 {( K        if A_tote="tote 1" then set A_induct to 1
+ G8 Q$ U# L" u        else if A_tote="tote 2" then set A_induct to 20 |; h. n5 v1 S' \% g5 c0 P) l% \$ [8 U/ }
            else set A_induct to 3   
0 R) g  z( d7 ?- R        set A_i to 0
' l# d8 _) Y- O5 f" {        clone 1 load to P_induction; U4 _& C/ H! }4 ?; b7 Y
        wait for A_time sec
9 v6 R" ~: \+ j$ \    end0 O+ i2 |& w( N
end: D3 ^5 q9 e/ {# f
$ N# E; Y5 }6 }( W9 H- ?' ?
begin P_induction arriving
/ Z) R$ n5 \9 }: X" c    if A_induct=1 then clone 1 load to P_pick1
9 z, v& S# t( o4 A6 n    else if A_induct=2 then clone 1 load to P_pick25 z( B. C3 N; O4 {: y( u5 \9 N
        else clone 1 load to P_pick3
4 D1 u" D$ J2 p/ V- H/ o1 t  Mend
" Z$ B% ]/ l4 J; ]1 R* K: t( g4 r6 L( H: R0 V# H+ O& S
begin P_pick1 arriving' E$ Z# W+ g% g# }4 g' w
    set A_i to 1
/ q* O& X1 s6 M; [$ ]    move into Q_induct1# z  f) E8 e2 ~
    move into pickaisle.induct1
' @4 l6 M) r( a4 J3 z9 y: @* A    while A_i<=30 do begin
. E1 U& L: n0 K( h3 x9 m        travel to pickaisle.con(A_i)
/ |7 Y1 ]8 m( `; a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. Y6 `6 B8 K8 T        else wait for 10 sec& Z/ w# Y0 |9 [" K
        if A_i=A_leave then send to die% F; q6 F/ d& c' R
        else inc A_i by 1
4 u8 s; Q- @$ D    end- O% M5 h8 L1 J3 ~6 [9 V
end& i, D2 ]* u% ^4 W, i

. t5 a9 h. z, t0 y* z. Rbegin P_pick2 arriving
2 U1 K  z- [, l5 V( b. m( J" T    set A_i to 11* S/ _5 ?5 T3 }2 H; y3 M6 B
    move into Q_induct2
2 n# T$ k: c" G0 Q: j    move into pickaisle.induct2
' E, }2 v8 b6 ], v" t    while A_i<=30 do begin2 L$ F/ }2 W( H8 I
        travel to pickaisle.con(A_i)
0 @6 c* Q/ a2 a; C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 ]) [. T# @2 f' o        else wait for 10 sec7 K% l* o0 q/ w. _5 D6 h; l% c
        if A_i=A_leave then send to die
# Q+ c0 m$ Z! l: I! P        else inc A_i by 1+ [2 `) X7 F1 Z% \. R# H
    end& r/ o/ D3 m+ N; u: z
end
5 F$ f; Y5 E4 Q9 a: C( Q6 B* Q/ H/ f- ~- d2 o
begin P_pick3 arriving6 L; S" ?3 C9 w8 ^
    set A_i to 21
8 J8 z6 f& G- a6 D; n1 ]) m    move into Q_induct3# h% b0 Q. n: k. q
    move into pickaisle.induct31 K+ o$ l/ I6 V7 K* g5 E1 y
    while A_i<=30 do begin2 _" N/ k: ]! k3 j$ ~0 l& f
        travel to pickaisle.con(A_i)
7 @4 _3 G5 C0 {0 ~; \7 @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 R+ K, H8 G- _# y
        else wait for 10 sec/ E0 ^) `2 B- M* X+ [& z
        if A_i=A_leave then send to die
% A9 z0 ^$ s& d0 s% [        else inc A_i by 1
8 v: }; l& x8 H    end4 a# o0 j! _( k4 V  ^/ h
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是个什么东东?
0 P  q6 r- E* U0 }" zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 K- W) d  x; ^9 O! H
* d! g9 n: p: f+ PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' M- Z" C5 R$ s' g4 g8 Z' W
% B7 ]2 O3 W# p' g" P% \, h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 J8 j2 B0 K( `6 w" e7 Q& S( t
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 E. f" z, @0 ]( h5 z& v4 c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 @9 ?0 Q$ C7 B9 K( M! l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 ]8 E& }, j- p) c8 N( I
begin P_induction arriving
: {0 G+ F. K# B! \    clone 1 load to P_pick(A_induct)
# \1 @8 C4 v) S0 D; e' aend最大的系  D7 w0 a6 E2 E0 C8 g
+ w3 ^% J  y0 I% [; A' E, Y, [3 }, a# Q
begin P_pick arriving
! a6 A  [% ?/ P. j' v    set A_i to procindex * 10 + 1
+ N: d2 t  ?- U' G$ ^1 O; E    move into Q_induct(procindex)8 |0 E1 C& y6 ^' L9 I' ]6 O
    move into pickaisle.induct(procindex)
" W+ {, o2 z* u* s+ q    /*check the type of pickaisle.induct(i), for your last problem.*/5 X; C2 L: ?. G" p3 ]

9 U1 W4 i! |+ s/ s1 |/ O; X    while A_i<=30 do begin
& F4 e4 i0 q9 n' y        travel to pickaisle.con(A_i)9 c% i' E: U9 l, g" A" t6 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) x' b0 R$ g- r: T8 t
        else wait for 10 sec
3 P; V: u4 Y' v2 _0 _        if A_i=A_leave then send to die
* M( |- n. ~. }7 A* }        else inc A_i by 1
# }% r4 [3 i: y1 t2 o    end9 \% `) Z: j/ p$ o+ Q0 s. O1 X
end, h% _3 ]+ `0 [. S4 M0 v: L

9 O% z: D0 Y' [9 K8 L; p其中的procindex为整形,代表当前process的序号。
5 V2 a- u( ?+ t# ]& x2 pstation和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-18 16:46 , Processed in 0.016346 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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