设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13538|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 h5 t) O2 b5 e7 p$ d0 R4 D. d+ p  T. 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 G9 ~8 c0 v2 t2 w5 |* S0 E$ E

. D  b1 w5 q: g0 S4 |$ rbegin P_read arriving2 \; W/ g; R9 K; D  N' J
    while 1=1 do begin& o! i& F8 @7 u0 \' J% i
        read A_tote from "data.txt" with delimiter "\n"
3 C7 Y9 |6 h6 l3 Y        read A_time from "data.txt" with delimiter "\n"& q, {$ g; P3 \' d- g% o
        read A_leave from "data.txt" with delimiter "\n"6 T# n. T3 l4 |3 d6 ]6 j
        read A_picks from "data.txt" with delimiter "\n"! b% d5 M0 u3 D* K+ {) s( j: J
        set load type to A_tote! W5 s) D2 @7 |( q# C5 |' H0 _
        if A_tote="tote 1" then set A_induct to 1
0 w  h! x# r8 X# v% H( ^        else if A_tote="tote 2" then set A_induct to 2' A9 K- X" F/ k0 L- D/ ~* |
            else set A_induct to 3   
) e' t0 W9 _9 J( S& S% P        set A_i to 09 m+ O- _, y  O
        clone 1 load to P_induction
1 b3 C* l4 a, {8 J  f) H5 Q$ N* x        wait for A_time sec9 P$ S5 l; a( Z8 @+ Q1 ^
    end
% r/ j# w) o. C3 _# yend1 I2 l/ p0 Y! }4 K. T
! a8 J. q: J# o; y
begin P_induction arriving: V- |4 L8 R: G2 s1 I
    if A_induct=1 then clone 1 load to P_pick13 `$ S* H* A- i, P" y# N
    else if A_induct=2 then clone 1 load to P_pick2
/ Q8 P1 X0 }; O5 ^' H        else clone 1 load to P_pick38 b% I5 \- q7 X: r5 j& j
end7 f8 G2 K$ \. s! n0 v

' G; l) z3 O) jbegin P_pick1 arriving
# F) g7 `; G: M: n& Y6 L" ~! `    set A_i to 1
" r: K* t9 o0 j7 Q/ ^5 F    move into Q_induct1" F# {& o; ~9 A$ L+ G7 V  Y
    move into pickaisle.induct1$ t) t$ X; S3 e6 g+ J: j8 l3 Z
    while A_i<=30 do begin
1 F* J& j- x5 p* V        travel to pickaisle.con(A_i)
$ |0 G! Y" {, d7 V" Q( O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! k; n/ e. B- x6 F! [6 d0 [7 D
        else wait for 10 sec
& ]9 E6 R% @8 r* A. K        if A_i=A_leave then send to die: A$ g6 y  w/ a5 Z
        else inc A_i by 1
2 p0 l& i7 E0 l& \" |    end
- V4 h, |# l* e0 S) y# e+ f# P3 }end3 c4 ~5 ?9 O* `/ r5 z( l( Q
3 a! V- B) _4 x  ?
begin P_pick2 arriving2 O1 E# m: q7 W+ u# i
    set A_i to 11
; ]3 r0 a! a) b5 g7 s    move into Q_induct2
: T$ ~2 J! P, L    move into pickaisle.induct2. e5 j! y, m2 d5 z
    while A_i<=30 do begin
& F3 N8 Y! q6 A        travel to pickaisle.con(A_i)
: Y/ t3 p. I0 \/ S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 J+ {- @7 K' Q# |" W8 O0 g        else wait for 10 sec+ {. u! ^, t0 k% v
        if A_i=A_leave then send to die" Z; V4 ~  k& ^
        else inc A_i by 1; Z1 u# i; m0 H, a! M. \
    end1 H7 Q. X- U+ @& V- ?; ~/ n
end
/ H- V# ]2 E3 W# j
5 a  u1 y0 Q3 {  {# ?5 z6 Rbegin P_pick3 arriving1 [+ z# o: M6 u* ]. T' z) B5 z
    set A_i to 21
# t$ B. H! z" Q9 _    move into Q_induct3
6 I$ N, d0 {! t. ]    move into pickaisle.induct3
1 M4 X' C' K1 C9 [4 I    while A_i<=30 do begin$ m. W+ `. T5 S) l1 v4 V8 u
        travel to pickaisle.con(A_i)( o( R2 Y0 J' `$ H0 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: D* A: y. B- m9 E. }( p        else wait for 10 sec
2 i; c- G3 A. E5 N        if A_i=A_leave then send to die
0 A9 ^. {" l% k8 A) T& q1 |. T        else inc A_i by 1' V' ?( P1 u9 o
    end
% C, N) M8 ~8 {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是个什么东东?
7 y8 J2 }3 S+ g2 Z3 t: i8 Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. k4 g* k  W: F+ d( \& X, N

* r. ^8 t. y! D: cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% E* a5 h4 A" g1 S! @
3 {; a! J' A- D, Y! R8 v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% T! g, u% j3 U7 U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 b" ?' z$ U' @7 L9 K* E% j
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! F8 r. v1 h# |: J. h$ C5 m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: M) i3 B! a  L/ P) M4 Wbegin P_induction arriving
/ E7 O4 s. z, A6 ^" a3 p0 p    clone 1 load to P_pick(A_induct)
+ ]8 q, f3 U0 Zend最大的系
' S6 G3 }& b, U# `
" V  N- T( N' j: ubegin P_pick arriving
- q0 O  ?8 d; k+ p    set A_i to procindex * 10 + 1
9 d8 j2 Y) G, K) I& v    move into Q_induct(procindex)6 y$ ~! `; [4 o/ x- X
    move into pickaisle.induct(procindex)
: E! ?: o! r% p9 D2 ?. n    /*check the type of pickaisle.induct(i), for your last problem.*/
1 Q5 c2 W6 m% Y
. \. L: R- T2 L) N4 b! q& a: }    while A_i<=30 do begin
. K; M# m/ _( T. t. S  ]5 u' M        travel to pickaisle.con(A_i)& g3 T7 M/ H. H. x" _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" I" b6 a3 ]/ q2 x
        else wait for 10 sec1 M. w: \6 x0 `% @7 s
        if A_i=A_leave then send to die) A. Z/ P! T  y. h4 G7 B2 ~  E; e
        else inc A_i by 1. X8 ]4 A7 b1 U, ?% s3 D  W: K+ h/ g
    end% R; E, W0 D/ P! d% W( [/ _# [
end9 \' G# F+ a9 ~% m' O
1 V( v, ~" {) d9 d
其中的procindex为整形,代表当前process的序号。
) i/ R# p/ q$ u+ G8 bstation和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-4-20 10:52 , Processed in 0.017966 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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