设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15386|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 E& Q0 r. p, A# A0 S
, l) I/ i! W& ]6 I7 [我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 ~) {4 ~3 r7 J4 G+ r: w! G: ?: o2 y6 k
begin P_read arriving( R" y% a  u2 ^; E
    while 1=1 do begin- }- R+ [% ]) n1 t
        read A_tote from "data.txt" with delimiter "\n"
0 K2 O9 j/ H& W/ ?/ J        read A_time from "data.txt" with delimiter "\n"
  Y9 j6 b& y- |2 [        read A_leave from "data.txt" with delimiter "\n"
, q7 l# E( c% q        read A_picks from "data.txt" with delimiter "\n"
) @# u7 U' u2 }" n. ^, Z" |% |        set load type to A_tote
* b  M1 Y+ |1 ~8 B8 c2 ]2 p        if A_tote="tote 1" then set A_induct to 10 K# z1 H. y$ B8 a
        else if A_tote="tote 2" then set A_induct to 2" o( L$ g1 J$ D* o( \6 c/ B
            else set A_induct to 3    2 r6 _; Q- ?! G3 k/ H: |6 |+ H
        set A_i to 0$ ]% s9 `( [+ ~* _' [
        clone 1 load to P_induction
" U( Y: G8 D2 W& S        wait for A_time sec$ L6 G0 C9 O# Z( m
    end
& G" J" I& a+ E6 vend
- _9 i- s" F; @& S8 x% h4 m6 k
& b  W* Q/ F, w* l( m/ c+ fbegin P_induction arriving  A1 t. Q0 G7 s- J0 `5 Q
    if A_induct=1 then clone 1 load to P_pick1" S9 \% V* m% o* @
    else if A_induct=2 then clone 1 load to P_pick2$ i* W& I: e1 f/ ?4 B1 A
        else clone 1 load to P_pick3- z1 g2 Y. m7 U6 q0 B
end- I: j. k! t. k. @+ i1 O

) V# |1 h+ R. xbegin P_pick1 arriving
4 c! s; G. Z! k5 t2 ]" P2 A0 m    set A_i to 1! V# K2 Y9 Q) F* v
    move into Q_induct1! L6 f/ W" x$ z5 h
    move into pickaisle.induct10 \6 Q$ w2 [+ t" r
    while A_i<=30 do begin
; e- b6 i% {; {, L        travel to pickaisle.con(A_i)+ R) b  s" s: f% \1 }5 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 c7 ~, B" g2 c8 Q% C. ~" j
        else wait for 10 sec
( h) N0 N% X1 o; T4 H        if A_i=A_leave then send to die5 O8 s8 E" a  V0 s5 t
        else inc A_i by 1
8 J; Z( V2 w5 d* [    end
' a  d  j8 t8 `9 u* m/ nend3 b1 X5 S6 Y4 J# P! z- u; R
+ Y% q7 A& ?2 r  C; p" ^
begin P_pick2 arriving
% X% |& d+ j8 Y3 X    set A_i to 116 |1 X7 G9 h* L+ j" Q/ \
    move into Q_induct20 R* q. E6 F; p1 i7 Q( V- j
    move into pickaisle.induct2
' y$ \6 t$ {  C' D    while A_i<=30 do begin
4 t+ d- H0 x0 ]        travel to pickaisle.con(A_i)* i6 `3 a6 B; P1 F" O1 x0 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 s; m: ^& h  Z
        else wait for 10 sec! w* N2 \# |: d* x2 w
        if A_i=A_leave then send to die" r! ]0 W+ R- C: M: C2 b9 [
        else inc A_i by 1
/ O( e5 K* l# p- s; v' k    end& l- Q/ r" t& W
end3 l, b) [  j; j( y

3 }' |; A3 B# P7 \$ D. xbegin P_pick3 arriving
! [: G7 Z+ @) v3 }1 Y9 A1 z    set A_i to 21- E9 [' t" J0 @0 ]
    move into Q_induct35 n. W; R' ]# g% q3 }5 o9 ^
    move into pickaisle.induct3
3 n& Q/ Q- n9 w! \6 l( S7 G    while A_i<=30 do begin+ Z6 I) w3 I( R1 T$ }9 o# G3 F
        travel to pickaisle.con(A_i)" c% i! I" y1 P' H, M% C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 d9 b7 W) L* K8 A$ H" {2 s. ?
        else wait for 10 sec; h* I4 n5 ~+ A6 i
        if A_i=A_leave then send to die
2 i; Z! G& s9 B" b1 w# E5 x        else inc A_i by 1
- {) W8 ]  ~4 K0 Q! J( V) {    end8 p9 l% a1 K4 M) Z$ t2 j
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是个什么东东?6 I4 V1 n+ u6 @$ B7 L* [* H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( b9 K" w- w) W7 R8 `2 n
8 Y; ~2 t8 I; }- iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 e/ c  _5 A, s; H  l4 Z4 f
6 M4 t; T" D0 c+ D& L4 F% x( a& c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 ]1 Q! d& u7 Y. g2 U7 l" O3 V0 V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" V) [$ M; P- D! ]2 W9 q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' g: t; e3 n6 G8 g; Y8 P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- s3 p* r& }3 _9 u8 k% \; Ubegin P_induction arriving) L  s% ]' }3 K7 I
    clone 1 load to P_pick(A_induct)
8 E+ L8 U& s+ a7 iend最大的系. h& R( S0 ^5 [8 D. i4 _9 o
5 i( T" w% d- Y
begin P_pick arriving# {0 S; T( o" ]
    set A_i to procindex * 10 + 1
4 m; P# k" Z9 f$ W; M& i    move into Q_induct(procindex)
8 U5 k, q  I# A0 f    move into pickaisle.induct(procindex)
' T# Y3 T# Y; v# @, x    /*check the type of pickaisle.induct(i), for your last problem.*/
7 {7 L" a& y' ^( P! b& K! y# V/ G8 i6 K
    while A_i<=30 do begin* a0 s& u% s; t& N
        travel to pickaisle.con(A_i)( P; I7 |% K; y7 o0 h3 {. Z- \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 U1 v2 J" d7 [: F" t$ }  a        else wait for 10 sec( E. m; u% ^8 U/ G
        if A_i=A_leave then send to die
) {. M" ^- i, M- Y0 `, c& h8 I8 Q+ L        else inc A_i by 15 ?% V* m8 Z% p( c, Z" m
    end2 S! e3 P' w. z1 @6 q
end
! A6 m8 g0 M7 E  R3 K( I- B+ b0 `7 Y
其中的procindex为整形,代表当前process的序号。) _2 G* F7 U; z0 M  t& _
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, 2026-9-8 01:46 , Processed in 0.015972 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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