设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13958|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 n9 s* D' D3 t3 g
+ _5 f% D9 d  O# ~9 V' U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 l9 q: X( k, S/ f9 \
  o) I" G' y- z5 c; [
begin P_read arriving
; W0 h3 p8 x; K& C- S    while 1=1 do begin
0 U1 X1 ]% n7 }        read A_tote from "data.txt" with delimiter "\n"
( Y' w+ s1 g6 w) ?        read A_time from "data.txt" with delimiter "\n"" P) t( f; a) |  ~- N9 ]
        read A_leave from "data.txt" with delimiter "\n"
( d0 [: F& n9 q4 r        read A_picks from "data.txt" with delimiter "\n"
: k$ t, a. u2 a/ r, k. J! U        set load type to A_tote) t4 Q" Y0 K: U$ a0 w! i, H
        if A_tote="tote 1" then set A_induct to 1$ Z+ }) |, S2 L
        else if A_tote="tote 2" then set A_induct to 2+ a0 j. z0 A5 R  i% U) v  ?
            else set A_induct to 3   
5 n: d: K$ P) N+ u0 p( h/ S        set A_i to 00 z/ ~5 r9 m& K) Z4 F! i# g6 l8 t
        clone 1 load to P_induction6 O9 Y2 S( e9 Z" U2 o: Z" U
        wait for A_time sec
* P' I$ O) ]6 x* G! e4 `9 p1 t1 g    end
: h9 m4 W' r1 Yend. ~4 N& @3 K8 q* u
" ?8 M, W7 l; W
begin P_induction arriving5 P. y: q! i8 B, @( q9 g
    if A_induct=1 then clone 1 load to P_pick1! }0 Z8 `% d2 Z' @& T6 W4 \
    else if A_induct=2 then clone 1 load to P_pick29 S8 n* s5 P+ Q9 P; z0 W7 S& C' Z& z
        else clone 1 load to P_pick3
/ I" ^  Z" I& eend: b: J3 b8 J* x6 D2 o# [. T
3 ]; D: [2 H$ O: B
begin P_pick1 arriving
. h4 U1 T: u1 Y" T5 Q9 x6 K) p    set A_i to 1
9 a2 Y$ u  U. P& k. L# O. X% ]    move into Q_induct1
, z+ b. R; {6 j* W0 P' s# V    move into pickaisle.induct1' O7 q8 D$ Q9 s# z6 {
    while A_i<=30 do begin$ `, `0 M: G, ?* J% W; K9 n
        travel to pickaisle.con(A_i)
( ^, @$ l* i8 s5 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: R  e; q8 C1 @4 {% W7 A" R        else wait for 10 sec
/ p  X1 L+ f0 P) {" o        if A_i=A_leave then send to die
7 e; M, x& {$ q. ~/ t" ]' c8 x$ P* h        else inc A_i by 1
' _+ q( t/ u) E. ?% }8 m" n: n! K    end
) N2 z5 _, ]- v" `- tend
; K1 A: {, D8 t& R0 J; \9 {
7 P9 h# Y* f  R4 B: E/ S# fbegin P_pick2 arriving
; i6 M8 g8 k" e8 d( p    set A_i to 11  z3 J( B$ r% @% j+ I" d
    move into Q_induct25 D, t! l1 ^8 P0 x: d9 h/ m0 ~  P& X
    move into pickaisle.induct2# l7 c1 ~& ?0 [) r; c
    while A_i<=30 do begin, I  v3 A+ j7 w% k! ]( m- i
        travel to pickaisle.con(A_i)6 \$ ?, |, Z6 B; J& a5 e: s  H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 m( W9 {) k, x  n% n# ~        else wait for 10 sec0 {0 K( P- k0 n& q
        if A_i=A_leave then send to die
$ W  i) v4 s. k0 @5 v        else inc A_i by 1
& q3 W6 j7 m6 M- _! C    end
7 a& O! \' w5 G' j! j$ C, bend& d/ o3 Z' s: w/ c( ?* y
7 D9 u: J) \# \
begin P_pick3 arriving
! c; v( [6 I" K' y, N    set A_i to 21
$ d( s" H6 I+ V( f/ ?    move into Q_induct3
# @2 J* E# v8 E5 n% _- f' {    move into pickaisle.induct3) {8 o  w; R0 a8 Z4 S
    while A_i<=30 do begin
) v# N$ u% _% ^& ^5 ^' d& X        travel to pickaisle.con(A_i)
% V& X- B& t! |# h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 P  R! R- Y/ x1 C8 w
        else wait for 10 sec( j; n8 \9 r' H+ G+ K- u, J
        if A_i=A_leave then send to die' n3 E* f2 u5 A  d2 m
        else inc A_i by 1
: H, K- g; E$ X# n1 o    end
2 e  U. w0 m8 p6 _6 Zend

最佳答案

查看完整内容

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是个什么东东?
2 d) R7 M2 r! d% P/ i7 b/ ?2 Y6 ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 l. p! ^+ }, @

; E+ M& E: b% kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, \+ I0 l: O6 x, U) ]% ?. c0 h7 }/ Q5 t# P5 h8 g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( ^* h! N8 d' A0 J8 t1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: w  g+ d, ]* I2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. |  o) h' B0 Z4 Y- d) X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; L6 H2 d9 z# I1 _
begin P_induction arriving: i" O& Q" K- T+ v2 q6 e
    clone 1 load to P_pick(A_induct)
( O  a# S% y$ h6 tend最大的系% }. s/ Q. F6 _; `8 ?1 _& b
! X( z/ H  D. X1 S5 \
begin P_pick arriving
9 }) }3 o1 `2 D5 q0 y+ |    set A_i to procindex * 10 + 1
# l/ F: V5 n9 O+ O6 h    move into Q_induct(procindex)
+ ]0 m  b# E% @# e    move into pickaisle.induct(procindex)3 Q, V3 c( h1 ^
    /*check the type of pickaisle.induct(i), for your last problem.*/  m% b* }& K( F$ h% D

, \! j9 E3 H" i- i- @% e4 W9 N    while A_i<=30 do begin; Z: J' T3 Y2 V+ c3 b
        travel to pickaisle.con(A_i)
9 F; M2 w# S2 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: A, t9 W: x/ }1 H* G& y' V; o: T
        else wait for 10 sec
9 Q9 m. J7 g7 h. d9 t* _( ~0 }" Q        if A_i=A_leave then send to die. _9 w/ ^) A+ s# R
        else inc A_i by 1
, ^2 t) P5 a# [5 w    end% l( m6 b6 Q5 ]( ?. [" y
end9 i) n4 H0 B, R$ ]& b
4 e/ j5 H8 y7 t( f/ n9 N
其中的procindex为整形,代表当前process的序号。
+ Y! |/ p9 [, Y: V. F) xstation和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-24 17:39 , Processed in 0.017470 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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