设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13740|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 o5 \' T: z, X5 [% r
5 n: [8 p% c' n- W& N我的问题是,在每个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中的数值,不知道会不会有什么不妥。! w* ]5 ]% C. I
8 _0 `2 g$ T# p- [% s
begin P_read arriving& K, o  |( m- k
    while 1=1 do begin
' O5 O  w  u8 @4 A* q        read A_tote from "data.txt" with delimiter "\n"
8 D8 F# j7 x8 |, ?; \        read A_time from "data.txt" with delimiter "\n"! i2 ?1 v9 \& l( p  k0 J. s
        read A_leave from "data.txt" with delimiter "\n"0 q4 `' g8 g( P9 ?7 v  N
        read A_picks from "data.txt" with delimiter "\n"; Q4 _) w9 ?* }4 H6 |2 S
        set load type to A_tote# i/ \: Y( _/ A5 y; K. D8 \
        if A_tote="tote 1" then set A_induct to 14 S* ?+ R. i0 M, s8 @" U
        else if A_tote="tote 2" then set A_induct to 2
" X' X: X8 V7 o+ ]) O* B6 M$ ]            else set A_induct to 3   
1 M; r1 A9 L8 K) ?* p        set A_i to 00 R6 a6 o. Y; }. x7 \
        clone 1 load to P_induction7 @, F- [4 u% J9 A( }
        wait for A_time sec
: o) l/ O: ~5 x5 X1 r/ [    end6 {% _1 P: ?# i8 s  U
end
, ]4 E6 `% T& l' y  ^3 y* k
! V5 t4 h# l  E% _( }# mbegin P_induction arriving, b6 y. l3 b# c# o% A% _
    if A_induct=1 then clone 1 load to P_pick1% x/ g( V7 W- e. x7 E! U
    else if A_induct=2 then clone 1 load to P_pick2
! I+ w- v) |# n9 T- L8 o' i        else clone 1 load to P_pick3
& _9 D4 t6 T' g$ D0 y( cend0 s7 p) Q+ O+ }! f1 _

+ n8 ~6 ?  D* N5 P! g9 Qbegin P_pick1 arriving
0 n) {1 E4 M. O    set A_i to 1# ?; j: G4 E1 R6 K: ^
    move into Q_induct1- Q; Z6 I& n' [6 L
    move into pickaisle.induct17 y% d) Z2 E  t( C  I' W- B7 f
    while A_i<=30 do begin3 g6 {" `. L  X; W& [; y' d
        travel to pickaisle.con(A_i)- c* Z+ N+ t3 Z6 h7 j* ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q. M& U; m' o        else wait for 10 sec
8 h3 I, X& k! P' l        if A_i=A_leave then send to die; F% E6 |$ x- s: T3 ~/ `: I
        else inc A_i by 1
* s3 K7 y; j  ~- F2 j) V. f    end# ~& ]; I  Y+ _, @% g( j
end; `- H) L, q' j8 A2 H# `7 T
0 e$ C: P9 K/ Q9 k& K
begin P_pick2 arriving
6 i. [$ T/ ~1 J0 M7 C  D" @    set A_i to 11
  G, `2 i2 V$ ?    move into Q_induct2
% x( U3 \# V) b9 S; h+ b    move into pickaisle.induct2
3 G4 {' L7 L( o# _7 C+ J: P    while A_i<=30 do begin0 l) ~5 c4 q  s4 x9 W
        travel to pickaisle.con(A_i)
3 g' g' \( S, _3 P4 q: {  r0 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ Z/ R5 x0 Z; D6 s0 h        else wait for 10 sec6 U8 ]7 S# ^6 A: x$ f0 R5 ~+ ]
        if A_i=A_leave then send to die  C* e6 X; T8 i/ G
        else inc A_i by 1
/ E0 Q; f3 C  A6 @/ G. K    end) i" d; N. i3 L6 D6 ?
end3 u( v6 l  w0 ?/ ]3 Q* K) ?
. V$ C' V+ O8 v
begin P_pick3 arriving9 Y' F/ R, N% n' D7 }! y  G
    set A_i to 210 Y7 u- m. l& c# ?. y; `9 e$ H, x
    move into Q_induct31 g4 Q8 k( \+ Y7 b9 M9 S
    move into pickaisle.induct3* p( W" Y! z' W: ^+ d) y
    while A_i<=30 do begin: }1 |2 w- f7 E6 W# C
        travel to pickaisle.con(A_i)  H( [3 y5 S9 _  p/ |  y# {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' i  p) u) p* N+ h. x+ x3 x
        else wait for 10 sec( v2 E1 S  l/ \. C
        if A_i=A_leave then send to die
, O4 F& s6 Q4 e; S1 e/ X! ~. }        else inc A_i by 17 D9 F4 W# m6 V# R
    end
! G2 c9 K, n# b0 G! L1 lend

最佳答案

查看完整内容

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是个什么东东?/ t7 K1 c$ c7 R+ R/ u$ [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 u9 }& L6 P* O4 v' y- I" {
! a$ J- O" H* ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# y$ ~7 \/ w2 Q% w
$ K+ g3 K$ W# s. c& g4 p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, J! s; m$ x& ~* _& \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ V6 {3 [2 v% _- u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 }( S) n# |; _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& j" O% j$ @  j( I# q( pbegin P_induction arriving
# a: y; i7 e0 A    clone 1 load to P_pick(A_induct)
8 G% K+ t* h# ?9 \end最大的系! k& ]) o% c- {1 L

. l* T, [0 g0 c1 T& I+ Kbegin P_pick arriving
; ]) T( j3 q+ ?. H& K    set A_i to procindex * 10 + 1* u' R. w8 g, |8 D% e% J
    move into Q_induct(procindex); H6 i2 _/ B" o1 \. {
    move into pickaisle.induct(procindex)
0 O! c* q/ c. N( N. P9 H4 ]: D    /*check the type of pickaisle.induct(i), for your last problem.*/0 v/ Q9 r1 M+ I- }2 [  `

0 s  Q! \" [# A! ]) T' v    while A_i<=30 do begin9 m5 L5 [6 H5 J+ C% N$ u
        travel to pickaisle.con(A_i)+ {, y' |2 n, @3 L* _& Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, @, f2 ^2 }; p1 v
        else wait for 10 sec9 L8 Q6 r, ^' l6 M0 ]
        if A_i=A_leave then send to die% F  w* V+ ~4 |1 y5 ]) s# Y
        else inc A_i by 1
6 B: u* ?6 R; a$ y    end5 J7 {3 t6 U1 B6 w5 |: J# v% ^
end
, `0 M7 ]+ A3 g9 w0 p8 |  r
6 h8 M, A5 d1 p! x9 A% P其中的procindex为整形,代表当前process的序号。
7 z3 u$ C6 Q- `" T0 N7 M. estation和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-2 06:06 , Processed in 0.014163 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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