设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15224|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( [8 V) Q2 ]2 _8 W. y) t( c
% a. B) ?6 y5 ]  c1 P  H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 }$ y" @) j( }4 ~4 @
0 T" J* ~7 P+ }begin P_read arriving' m, c, [$ E$ D) R! U
    while 1=1 do begin6 G: O2 m& [, q
        read A_tote from "data.txt" with delimiter "\n"+ {; b6 N' N$ m+ `% @7 r# k
        read A_time from "data.txt" with delimiter "\n"/ X' g% \- v+ P3 M- A2 m" \
        read A_leave from "data.txt" with delimiter "\n"
! Q6 {( x7 C* w1 y4 n        read A_picks from "data.txt" with delimiter "\n"$ r- }# |! `# M, Y4 }/ Z
        set load type to A_tote
1 q- j. L' C' X) \* d        if A_tote="tote 1" then set A_induct to 1
# y; m: j  k: C; R( h7 z6 E        else if A_tote="tote 2" then set A_induct to 21 _" ?3 \; W1 ~' I, z
            else set A_induct to 3   
9 d4 G. D2 A6 G* K3 G$ v3 A1 H        set A_i to 0
- _' ]( D: g/ X" p$ {        clone 1 load to P_induction3 ~7 I# F* [, t" N
        wait for A_time sec
+ P  h: M, W1 p1 P    end
  |$ h& K* @: b' R/ x2 s& V8 uend+ q: P8 x; [/ T8 j" s% {4 D
/ m5 Z: {! H2 W% c2 h2 |0 R
begin P_induction arriving
- Z" B' X/ ?( l8 @, H' ~" j* p    if A_induct=1 then clone 1 load to P_pick15 C7 [0 W7 S5 Y% Y. O# j7 J: }
    else if A_induct=2 then clone 1 load to P_pick2
4 ]: C, f2 ]4 U- H1 `% W$ U        else clone 1 load to P_pick3) Q- B! n) Y- {% d! x' x6 U; W
end, ^1 s( Y/ h+ E. U9 p
0 G! ~$ s* A4 g; Z
begin P_pick1 arriving2 g7 r! m6 F, I% Y3 h
    set A_i to 1
2 H* i/ L; k. ?4 R7 M+ Z( d8 v    move into Q_induct17 x) p) i8 R- d
    move into pickaisle.induct1
* g) Y; t8 J+ W+ D# c    while A_i<=30 do begin
# w4 _9 s' _8 X% `2 ~( l0 f( L        travel to pickaisle.con(A_i)
+ x$ ^- _6 Y9 _' }) D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* l- ?, M7 N( {
        else wait for 10 sec
3 h& ~  H2 G" k. t2 v; C        if A_i=A_leave then send to die
4 k+ g2 H; ]9 H. a        else inc A_i by 1* D- g9 C/ H" M8 r
    end: ^0 d, G4 n# R9 g4 y7 I" `
end1 P# H; G" N: Y) R( ?2 }% K

3 Q( t* q# E6 I' Ubegin P_pick2 arriving
+ ^3 t! w1 j) r. P% I    set A_i to 115 H# e0 g5 ?) H
    move into Q_induct2
, ?$ k9 W$ K% f: d8 P4 _1 {- [    move into pickaisle.induct2! y# L( r; D# O# \
    while A_i<=30 do begin
+ p4 G2 s  \- m) @2 p" d        travel to pickaisle.con(A_i)$ V8 G5 Q! E$ i4 h) y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ?5 I6 @6 q4 G' @
        else wait for 10 sec9 L. Y5 X2 F+ I: d
        if A_i=A_leave then send to die
+ W  {9 J, |! \6 @' H- ^. Q) S/ \        else inc A_i by 1
6 P3 m( J$ q# p" T- F    end
3 a  e1 B; Y( }) T. }end" j8 V' @- o1 Y, e- A5 t
& c9 @8 b! [) k
begin P_pick3 arriving+ L9 s  s9 Y! U
    set A_i to 21: D% m" T0 h) N- t, }9 }; P
    move into Q_induct36 J! s, W  i( h: m) b, X
    move into pickaisle.induct33 [7 |1 J9 M0 }, o
    while A_i<=30 do begin
7 g, x* J* P; s4 f  F7 a        travel to pickaisle.con(A_i), l! Q  ^; G( {2 q" }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X3 C- P$ \) X% A8 B3 S
        else wait for 10 sec
& M5 J& ]% C) C  }5 h% u7 ^# V+ `        if A_i=A_leave then send to die
$ E5 {+ E0 c0 p' ]        else inc A_i by 1
5 w" a) B* ]5 |8 L: s& b$ D6 E% ^$ `% B    end/ Z& X4 J- S# M% T# C
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是个什么东东?& ]5 \# N. A4 M& @3 N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) C( \' R: y$ ?$ z6 A8 k6 k2 e
5 I7 [% [' ]  b
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" H4 }2 t0 {+ d" s# n4 C" H- s
# K( H% w% x% N+ b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. Y8 T# ~7 R3 G6 x1 u7 }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# K1 ^' w" v# S3 C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& o% S6 w  J1 s" p1 D5 n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 t! `* }: }# ]begin P_induction arriving
& S  {- [- [, ^9 H    clone 1 load to P_pick(A_induct)
5 ^% U6 e+ J; @# _end最大的系5 W6 c) k( D0 M4 `4 @) q" g; E
: A( G5 k! P0 [" M
begin P_pick arriving6 L: k+ w+ P: b- b' v, w9 {+ ^
    set A_i to procindex * 10 + 1
/ R) q9 S9 {5 Y+ z    move into Q_induct(procindex)1 N) E: ?, Q' |& j- U& _2 W
    move into pickaisle.induct(procindex)
* Y' a8 J* p, f    /*check the type of pickaisle.induct(i), for your last problem.*/
' i( c. Z" V- @) v" _7 u' {. W, ?% w& H5 j5 M
    while A_i<=30 do begin% ~- m& {+ l) E
        travel to pickaisle.con(A_i)
: v3 v# n; w6 a* J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- ?2 ~: z. |8 q1 f        else wait for 10 sec
2 n. }9 u6 U0 Z        if A_i=A_leave then send to die
6 W- m* p6 V2 t. k$ h        else inc A_i by 1
! U8 `5 S* c4 k+ w( @2 X    end! D2 ?( P7 a  j/ [
end- l2 J% A/ ^0 b6 f
" o( U4 l  w: b: S& K" i" }5 d  U( ?' J
其中的procindex为整形,代表当前process的序号。
1 c5 t4 Y* u) j6 t, G; v) w) jstation和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-8-25 03:13 , Processed in 0.053700 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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