设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13978|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 _3 c) V6 U8 t  X* R5 D8 o# U% t
9 ]* M( d# P5 Y- q. \* z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  o* W  m9 ^- Y" w0 R
/ H, n, l# }0 C4 ~) u: _3 f6 v
begin P_read arriving
; G+ M! s$ d- @- u9 n2 w6 j    while 1=1 do begin/ h( Z. i/ T& u! l& d1 D' G4 Z. z
        read A_tote from "data.txt" with delimiter "\n"
8 d; O4 V5 ]7 _' F        read A_time from "data.txt" with delimiter "\n"! u% c- ~3 a4 s5 P0 s# s- Y
        read A_leave from "data.txt" with delimiter "\n"
+ G' ~/ U/ V: ?0 n$ `  D3 K& Y) ^        read A_picks from "data.txt" with delimiter "\n"
8 t4 \0 x9 g1 w9 v" K8 m# y: u, d        set load type to A_tote
6 F9 ^+ h7 A- I* ~9 n. J/ }        if A_tote="tote 1" then set A_induct to 1
& y$ u+ Y% h  x/ d        else if A_tote="tote 2" then set A_induct to 2
/ N3 _: g6 I, C0 f4 [            else set A_induct to 3   
. Z5 c: V7 Z. l9 Y' Q        set A_i to 0
2 D* b, I. Q9 q5 V        clone 1 load to P_induction6 }) O8 ?3 ~5 l" X. X8 J% Q. {, @' K
        wait for A_time sec6 |! n3 G. h9 n9 }
    end
, _. u# {% {' hend& r8 q: }- u( N. G3 }
6 f2 A+ o" ~* V8 M
begin P_induction arriving% n: G6 z- P8 M! [- G( _% @6 e
    if A_induct=1 then clone 1 load to P_pick1
& m0 c* C! l7 }, k    else if A_induct=2 then clone 1 load to P_pick2
$ [7 a" h7 U6 s! R* `' D% b        else clone 1 load to P_pick3: }1 z4 r6 ~! r; C5 w3 f" S- d
end
2 k2 `" m1 x  W' |* w* Z5 z$ z; ^! D+ P" p! ~  }
begin P_pick1 arriving
3 q: {7 N3 v# f    set A_i to 1
8 `8 s( E- F& a0 y" `( u. [8 i/ W/ G    move into Q_induct1
3 ?1 Q, }4 @. L( s    move into pickaisle.induct1. k1 \1 b/ Z( a) r& s1 [
    while A_i<=30 do begin
/ E/ L( s. x/ Y* I9 p3 Z, d        travel to pickaisle.con(A_i)
, l. s2 k$ Z: O; N  d; }/ ?0 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ K+ n9 E6 @* r7 N9 d! X        else wait for 10 sec* Q0 ~" M* I+ X0 A7 k8 T
        if A_i=A_leave then send to die' T! |7 h( ]9 Q3 T9 T: p
        else inc A_i by 1/ W/ m& F- }% D+ k) C! p; d
    end" l+ c) @5 y$ v* h- O. W! Y# V
end
- }9 E5 v& {1 j% F( G2 U- E+ ^' W( o, w1 Y6 q& G
begin P_pick2 arriving* z, u) N) o) B( t
    set A_i to 11
" |, E) O# a5 ~) f' X4 p9 P0 n    move into Q_induct2
, N6 l4 V% e1 S; |8 A    move into pickaisle.induct2
( `' u% w. t& P2 c' D& Z    while A_i<=30 do begin
, \' \' x8 W4 S3 M+ B        travel to pickaisle.con(A_i)
0 S" z2 y! H- i+ C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 N' S+ m* ~, l
        else wait for 10 sec
% g1 ^7 P9 Y7 D3 k7 U  P        if A_i=A_leave then send to die2 d! T4 o5 i7 w  B- V- ~
        else inc A_i by 1
0 U8 m+ l$ p; k    end% D5 W7 U! f' [2 ]' G
end
+ M3 o/ A6 o& N5 ~
7 ^) V% D( p# P& B3 zbegin P_pick3 arriving
2 f8 Q5 ^1 ?% v    set A_i to 212 n5 d8 M/ i* f4 ~6 @0 T
    move into Q_induct3/ p0 f. Y) [2 e
    move into pickaisle.induct3
8 q8 X4 Y9 R& ]9 F    while A_i<=30 do begin
) B0 A4 c  c, ~4 H/ ~& j$ k        travel to pickaisle.con(A_i)& K% N2 ?9 x& ^) I: w7 g' A& C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' N) L9 d7 I1 R: T; Q& d, k" Y" W( D        else wait for 10 sec
  _6 r, T2 n6 B& H* G* j. p        if A_i=A_leave then send to die7 P& @  h) s3 D/ W. v% d
        else inc A_i by 1  Y5 T7 V7 I+ `. L9 F& b
    end& T! N6 `$ ?; r8 H3 K( I2 T5 O
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是个什么东东?
, r; {$ p# b# W( vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 a& q! R- v) B7 y* G* \- X
! o1 H/ g3 f3 Y" IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" Q$ L7 P7 U/ A% U" {

# A& X) S5 E7 Z' r另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, c, \: b6 Q. E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 S' |! R: q( k# x) w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ [0 j/ L9 W: s, U) O  V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ z" V/ ~1 j! I+ ?* _9 p$ _begin P_induction arriving
# [1 a+ x1 C: B9 \4 z( l) d: w    clone 1 load to P_pick(A_induct)6 T! c5 l1 H$ C2 r# v4 h
end最大的系; u: v2 ?) W  x& K: C# Z
5 L4 _1 \5 `! |0 t' n
begin P_pick arriving$ H' k+ Y, x( R3 g  c7 \# L( J
    set A_i to procindex * 10 + 1
1 x( |! @" `. F1 Y0 l9 n2 e    move into Q_induct(procindex)
' a( U/ P6 O) [8 f2 c, L    move into pickaisle.induct(procindex)
7 {- h6 [  n- Q7 n    /*check the type of pickaisle.induct(i), for your last problem.*/
( u9 l* ?; J  H* r( s" v, d$ B$ {3 G3 [' c$ R
    while A_i<=30 do begin
% e. e1 p0 l) F$ L; b        travel to pickaisle.con(A_i)
1 T3 f# K5 B$ l1 P3 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ I* i9 Y* h% [' P8 Q/ M
        else wait for 10 sec
  ~2 e/ g. l! E& h; B        if A_i=A_leave then send to die
- ^' Y- A( l# R3 b+ s        else inc A_i by 1
3 V: f9 H7 X4 T. j% `6 _# ~  V& G7 s    end4 V* x# I/ s5 A- \
end* _* X3 J$ l/ E( t0 r! I

, Q% @7 R. `5 I' c4 q其中的procindex为整形,代表当前process的序号。
- _5 Z" d9 y4 o% C' ~7 cstation和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-26 22:34 , Processed in 0.018369 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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