设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9782|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. W. N- Y# J7 J0 V. E
; ~9 t! ^- o0 N3 ?( w6 l( W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 K' S0 O7 A# c* a  J9 v
7 H6 H, g7 c/ ~- h0 ~begin P_read arriving6 p4 Z1 c, I6 J% e
    while 1=1 do begin
" J+ r0 i3 l- h! s& T* \; f        read A_tote from "data.txt" with delimiter "\n"
  a, x. o; x( m" ]        read A_time from "data.txt" with delimiter "\n") Q2 ?: E6 A/ q7 X8 v4 h+ [# Y% ]
        read A_leave from "data.txt" with delimiter "\n"' f/ E. i! ?+ e5 \  p1 u
        read A_picks from "data.txt" with delimiter "\n"+ R/ Q# J# k5 E4 j* S" R5 `, k' X
        set load type to A_tote
( L1 g# ?2 B& G* F        if A_tote="tote 1" then set A_induct to 1
' Y8 r% G7 z0 U5 G8 u. y        else if A_tote="tote 2" then set A_induct to 2
, t1 o; Y$ z5 i$ R' O' @1 N            else set A_induct to 3   
  _$ X# H9 Z. v5 g        set A_i to 0# B' O6 E% ?- K- q, ~7 p3 C
        clone 1 load to P_induction& ]+ H. ~  L5 d0 L* j8 m
        wait for A_time sec+ x. [8 \% x; m  [
    end4 l6 f; E# o+ U* @' }- a7 r
end
, ]3 |  y' V* q& u! w7 G6 i: o; _' t5 R  j( I! n9 T
begin P_induction arriving- x. }: A5 {. U; S
    if A_induct=1 then clone 1 load to P_pick14 o1 l& `6 k+ i
    else if A_induct=2 then clone 1 load to P_pick2
4 r, r! Q- R0 {; L2 t        else clone 1 load to P_pick3
; N8 E5 l- w- i0 ]3 n, }8 ^$ ?end6 O( _2 ]+ }0 U

, a1 F6 j! B9 k1 l6 w, |begin P_pick1 arriving% {: o: b- [8 Q$ Z7 C% ]# J7 O- U
    set A_i to 1
* k/ W1 G2 m( n7 `6 u- u3 @$ u4 F    move into Q_induct1
+ {  ]3 w( e. y2 l3 g: p7 U% r    move into pickaisle.induct1
7 T3 u) R& ]9 z6 F$ V( u    while A_i<=30 do begin
+ C3 G3 [" W/ l7 z" X6 }        travel to pickaisle.con(A_i)5 v, c' M; U; y& s. a1 T9 U! s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. _6 `! }1 x, U  a# o! F2 }5 n" S
        else wait for 10 sec
; h/ L4 \* G  u6 |        if A_i=A_leave then send to die
6 R/ @4 r; Y$ Q0 q# g  k        else inc A_i by 1: U% h  o, Q# J7 I5 {- c4 @" L5 B
    end, Z& v& @7 l* Q- R+ U6 k' ^& f
end. B7 @9 O) u. v2 Q& J" q7 q

0 I) B, V: H% {begin P_pick2 arriving
1 S; n" ~. W, C  t: ~9 M! M6 q    set A_i to 111 ?/ c7 ]( |& b9 Z- M( h; r
    move into Q_induct26 z; a+ t; Y4 @6 P2 Q
    move into pickaisle.induct2
# O* {9 R" B6 R% b6 r6 r    while A_i<=30 do begin! @9 w! s# l5 \' u- T% N6 R) I
        travel to pickaisle.con(A_i)
0 l/ @' ~  [- ~8 C/ \& W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  b5 R5 I1 e$ s, K. ?: o
        else wait for 10 sec
# K1 b+ O* @$ A        if A_i=A_leave then send to die
" ^- c8 a# V  X- ~" e- v& a        else inc A_i by 1: H- l! E& _' X! \
    end
6 v+ N$ n1 h0 {3 Z) ?9 ?3 gend! I, P. u* V# E  c

* J& F/ }) x" Sbegin P_pick3 arriving$ P$ ?- F  ?1 N$ r* ~5 y: Y: w6 c8 f
    set A_i to 21
0 ^  V; @2 X% C( {    move into Q_induct3
9 P/ }1 z& j( h$ F8 q* J    move into pickaisle.induct32 @5 J) u0 b1 y- W8 G
    while A_i<=30 do begin6 f3 }8 i, W, K3 f7 q$ v) Z! _. Y
        travel to pickaisle.con(A_i)4 w1 d/ X; b$ x* v  {2 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ?# l+ l0 @2 W7 s( l; m. l
        else wait for 10 sec
6 R& ~' m1 G+ I6 @        if A_i=A_leave then send to die
. A: `( L3 C. f" T- ~        else inc A_i by 1* I# ^2 r5 o3 ^8 y1 i1 A
    end
: E  ]' q: W) Q- ^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是个什么东东?
) n, N. z8 A0 ?8 \" o3 t0 Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( F! a* M! r( {- W) n, ]9 q  B) l' k8 V  F! O) c0 K( g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 v- \* i2 Z+ \2 \& n, x$ N

8 k; I2 c/ H- w2 f7 n) [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 f+ z3 O: k8 [# Z, f/ j% O& S% o
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" p* D/ L, \6 s8 m* L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 v: X& y  \, h4 ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' D# }2 i6 `1 O9 {$ N3 _( Ubegin P_induction arriving* r( F0 K# h7 D/ d
    clone 1 load to P_pick(A_induct)
% C" _3 }: l; |. ]% f+ Send最大的系  O5 q. ]4 p5 M0 q" b# P6 M
5 [2 S* I, @$ I; u) Q1 j
begin P_pick arriving
% L' Y0 n1 E: K+ J, K    set A_i to procindex * 10 + 1
' B) A" M* C2 h- \+ T    move into Q_induct(procindex)
+ V  n' T% d6 E+ h+ ^3 Z* U4 Z    move into pickaisle.induct(procindex)4 v9 G3 s5 p4 F7 {4 M
    /*check the type of pickaisle.induct(i), for your last problem.*/
+ v9 P# O2 \: T+ X5 @1 H- @( [
& Z) f! M; q  A. K+ _: p2 I2 y    while A_i<=30 do begin
* M. `# }" h# T- k7 f0 t        travel to pickaisle.con(A_i)
2 d; H1 ]8 R# z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' _: u* I% G1 C1 r9 K+ v. R! w% R        else wait for 10 sec
5 \. j# T  X( w+ k9 b5 T        if A_i=A_leave then send to die1 z# e, G$ u; I' q1 z; Z
        else inc A_i by 1
! G% Y4 _- \" j" h) Z& h1 }/ S. w5 `    end
2 Q8 s7 A3 K1 t8 ~7 w2 Uend0 {! m- d+ W  J2 o  i0 [. c
) B! B. ]  U% b+ @0 Z0 a1 i$ ~# H. L
其中的procindex为整形,代表当前process的序号。' `! l9 H3 k7 z- D! @
station和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, 2025-7-4 08:22 , Processed in 0.015359 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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