设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12608|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 i$ [. Q5 l+ O' g$ D) B$ n; S

5 k: S( J" B2 w3 j% U8 A! `: 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中的数值,不知道会不会有什么不妥。
% ~5 p2 E& s: \# p( P9 o  [' d; g6 c$ p
begin P_read arriving
4 X: R1 U6 d& i5 G    while 1=1 do begin
  H& s: n6 f: X8 k        read A_tote from "data.txt" with delimiter "\n"3 F8 s1 Q. s8 m
        read A_time from "data.txt" with delimiter "\n"3 W- R* V1 P+ X; e
        read A_leave from "data.txt" with delimiter "\n"
4 L. r! S( k$ n0 ?# Y3 ~        read A_picks from "data.txt" with delimiter "\n"" L) J7 O! K5 [8 N! q6 X  ~* Y' i$ [
        set load type to A_tote
2 C! i4 ^% q' g) q) S: Z        if A_tote="tote 1" then set A_induct to 1' _6 d$ I/ A( O+ m9 F4 i
        else if A_tote="tote 2" then set A_induct to 2
( m9 W+ G9 a, s4 a( a9 n* ]: R            else set A_induct to 3    ; s$ n( A, u: {: i) {) _
        set A_i to 0- S3 f& C; P( p3 K2 \
        clone 1 load to P_induction5 @- E" ^" }5 _& ~; T, X1 p
        wait for A_time sec- B4 _, O3 {+ Y  @! ^/ }0 _
    end
; A& K& D" f/ j1 a  R5 Eend
) j3 Q" }8 C9 k' T3 G6 j1 X& _1 ?( ~
begin P_induction arriving9 [6 o; L) |6 q" |  s  y! i7 b
    if A_induct=1 then clone 1 load to P_pick1
& W2 m2 {0 c. J0 ]1 I    else if A_induct=2 then clone 1 load to P_pick2% E; Y: k' m1 `& I  J
        else clone 1 load to P_pick39 a9 ?: R% ]" R
end
/ J" r/ i* p. O! M) U4 Y5 c" F( e
/ K! o" X9 R4 x5 {# k- f1 Nbegin P_pick1 arriving
9 s- k3 H2 S4 C    set A_i to 12 D0 h# A: b8 H  A+ S
    move into Q_induct15 \/ y/ C$ i9 Y. Z+ {8 Q# _4 Z
    move into pickaisle.induct1& u! ]) O( [3 r9 r2 `
    while A_i<=30 do begin
& p8 S+ x+ n/ Q$ O) T        travel to pickaisle.con(A_i)7 m/ M" i  S1 U+ k* t& M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 [; v5 l( b/ Y3 ?- u- P/ }' i
        else wait for 10 sec
+ N" ]3 h  U0 o% O        if A_i=A_leave then send to die
! U2 R0 Y+ @& M' |; g7 ?        else inc A_i by 1/ G0 d2 e" F" X/ |) K# e
    end' D. Y/ R4 p& p$ _) y; ^
end
9 f) \$ e% v; n( E; ]' L: b% G$ K/ L* J
begin P_pick2 arriving* J9 K2 ?! R! M1 U! h
    set A_i to 11! u0 C# Y5 f* [) A1 @2 W3 k. Y
    move into Q_induct2
  a4 R" n; f9 O9 r( O( @    move into pickaisle.induct20 Z' J$ ?% w9 e: ^) _/ `
    while A_i<=30 do begin
  T# G# t. P* B7 p0 t" i& r% O; N        travel to pickaisle.con(A_i)
8 x2 u3 A( n/ q6 }4 {9 y$ `" R" l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ^9 V! I4 J0 l  a. a) b2 t# e8 s        else wait for 10 sec
5 [5 Q0 y& R. S( d- M% `        if A_i=A_leave then send to die
2 b6 Y5 Z" N- K* T6 p3 @        else inc A_i by 11 n0 U# Z2 s7 _. h& V: j  s
    end2 @# f" ]: }* ?) H% e, j! a2 \+ j3 ^
end
/ p6 h& q8 q5 ^; K1 ]% C4 z& B% @
8 A- Z8 d% q" D) C1 E2 y2 Ubegin P_pick3 arriving7 g7 q6 G) E7 C1 n
    set A_i to 21
* C- K2 W2 V+ O1 d    move into Q_induct3' O8 D& a0 N8 b$ u, l5 D
    move into pickaisle.induct3. b) E; z) g+ l
    while A_i<=30 do begin  {' a+ c1 _- k! X3 ]2 O" T
        travel to pickaisle.con(A_i)- b5 i. x7 K) a  J- }# I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 }* q; q( V  d4 z
        else wait for 10 sec
6 Z, n2 b- |, L0 Y8 @2 h        if A_i=A_leave then send to die% i+ W5 l: M: v
        else inc A_i by 1$ m3 x# o- n. z. f) x; M
    end
1 p; O) i9 w0 [+ C# x% k1 [# send

最佳答案

查看完整内容

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是个什么东东?
7 ~3 g% d- |8 x5 d$ mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) Y* a. s9 r6 G
# R; a' M7 M: A! }( k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 ?/ u# P) j; M3 O
# }+ Q/ U7 W( {, d1 t, {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ r$ i" _1 b# C) w1 S1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& P8 e" l* e4 H! k) k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  ~  U0 N! I  Y/ \9 X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 l2 q7 A3 M. `1 a. ]; j* J4 t
begin P_induction arriving
+ n# a% V# w5 R% _, I9 T: o4 I    clone 1 load to P_pick(A_induct)
0 x4 |8 X; Z" S* Q# ^8 mend最大的系& t% m2 h4 G/ `  r  a
( i+ B' f/ b0 V6 E4 y
begin P_pick arriving
$ b! P# s4 [5 T! l' Y: c    set A_i to procindex * 10 + 1  z9 J) j1 e9 w) a1 M$ }
    move into Q_induct(procindex)
, C# f! r; X+ |- z3 O& L    move into pickaisle.induct(procindex)
" m& ^- x' ?  |& J! \% r* i) a    /*check the type of pickaisle.induct(i), for your last problem.*/8 _6 s8 X; q; G7 R" {0 |

) l% K' V( K6 s+ w# z    while A_i<=30 do begin
) S- J- D2 X" {5 [        travel to pickaisle.con(A_i)
% n" ?8 ~3 a) x- g3 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 u! c- g+ j- {1 L5 a        else wait for 10 sec  H5 v+ j' @8 u' @2 \
        if A_i=A_leave then send to die
/ s# I; _- N7 t8 M" `& Q        else inc A_i by 1
* C* M3 K2 M0 \7 }: F% M    end* {% ]* w# a' p# H. T
end" {5 K# h- R8 K; y1 ^* z
- N: u. z0 v& o: P1 A
其中的procindex为整形,代表当前process的序号。
, q0 S( A2 }8 H4 ?0 E4 rstation和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-4 10:12 , Processed in 0.022704 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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