设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15097|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 T  V9 t6 ~! E, o' k, y6 J

$ {; T/ \& @) `3 }1 F& o% A我的问题是,在每个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中的数值,不知道会不会有什么不妥。) y% Y( \, D$ \: T/ ~7 D0 |9 Q
9 O  F$ D$ Y- m$ T
begin P_read arriving+ a+ Y( d7 {! k% x
    while 1=1 do begin
0 `: g3 b% E# R6 s( V0 Y        read A_tote from "data.txt" with delimiter "\n"
$ Z3 {- V9 Y$ S  z0 c8 G8 H        read A_time from "data.txt" with delimiter "\n"
1 ^$ y7 a* `# n) S: f. N& h; J& h        read A_leave from "data.txt" with delimiter "\n". u# H  D$ H' H# N2 B6 i7 x
        read A_picks from "data.txt" with delimiter "\n"
* ~) u; g/ h6 k4 w1 f$ n        set load type to A_tote5 ?7 B) ^3 _' n# c! y9 q- R  }6 {
        if A_tote="tote 1" then set A_induct to 18 ~' w* I, e. ~% E; b. @
        else if A_tote="tote 2" then set A_induct to 2# _. h/ x  e$ R
            else set A_induct to 3    : i" F  {" e# q
        set A_i to 0/ ~. d! H# U" E) }$ ]( V
        clone 1 load to P_induction
/ F' C& \. l- V$ x9 u* a" ^# R* D        wait for A_time sec
7 |; n) y7 d0 N( p; U7 E! L6 U0 I. V" h    end
$ r1 d* i6 `% T8 Z4 X  Xend/ C6 [" {" Z, o7 ]% Z+ T
7 J  K% t/ _  B' d0 O
begin P_induction arriving7 H8 E6 n& z/ z, B  G5 c0 T4 `
    if A_induct=1 then clone 1 load to P_pick1
9 ~8 h- i- u( J+ b6 @    else if A_induct=2 then clone 1 load to P_pick24 W3 k/ z( A! s* V
        else clone 1 load to P_pick3
2 T. l* Y7 |% l* ]6 D7 dend: k4 ?0 u+ R  F' t# F
, Y+ ~- R6 ?2 e4 c9 ~
begin P_pick1 arriving
; ?9 H( w. E+ W. ]4 a) O2 A    set A_i to 1
% T5 _! n1 A; @# r7 p% u/ q' _    move into Q_induct1
& N3 W4 J. U8 K2 I( o    move into pickaisle.induct1& z  y- R+ C) A. ]* d$ Q6 d
    while A_i<=30 do begin
3 I- I0 g. ]- [! K1 M/ b        travel to pickaisle.con(A_i)
/ o, z- `' o* `8 @" s& M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Y3 [7 L2 z7 y& a
        else wait for 10 sec
4 u" A/ ?. F$ W# m( q        if A_i=A_leave then send to die& w' a* w! s# S/ ?
        else inc A_i by 1
9 R' j  W* V! p. W    end1 e1 O4 E$ o" ~6 ~5 q( P1 H7 T
end0 `! D7 p$ l" n% t
4 \" S- \7 v/ O' A: \
begin P_pick2 arriving- ]0 N7 W' h, B$ C$ ~
    set A_i to 11
9 v% F% k( T5 d  g5 Y    move into Q_induct2
. }5 Y3 |5 d, O4 C* ~+ A' ?    move into pickaisle.induct2& w0 L9 e" O, b
    while A_i<=30 do begin
2 ]3 a, v( d' e( Z8 I) x; o" p' W        travel to pickaisle.con(A_i)
3 e' x- z4 K; S4 y( G' q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ^7 O# b. x+ n' ?2 f1 h        else wait for 10 sec, S2 [8 ?- X1 V3 \+ @6 Q& c
        if A_i=A_leave then send to die4 C! F; A; M: E, k" f( d+ C
        else inc A_i by 16 G5 E9 Y% p/ k- }& T( {
    end4 D# _$ g, ]4 A; n
end
; C$ T: L' d& b* d) M3 B, @3 G1 ?! Q* m
begin P_pick3 arriving
0 k, g+ W5 c) a& P8 A    set A_i to 21/ D% H" |( G. x+ [3 w, A9 D* Y, d( i) P
    move into Q_induct3
0 B: Q) k: W+ Q3 {$ S    move into pickaisle.induct3( E% m. _& t9 @) q% L
    while A_i<=30 do begin
/ `6 h( \& T, X4 Y* `  b  N        travel to pickaisle.con(A_i)
  o2 V; u  A% u5 M( p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- N: c+ d# h9 ?. ?6 h% n" f) T
        else wait for 10 sec
) u5 G9 m/ Q' t0 Y' d! C        if A_i=A_leave then send to die
1 }; Q6 D8 V, ?( c. B$ l* q        else inc A_i by 1
9 ~* |' X8 k6 a* ^0 W* ^/ y9 X    end1 J5 F: k) V2 h1 Z5 S8 a
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是个什么东东?( ]1 L! l7 [8 A' }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) c4 ]  R8 B7 y) v" s
) M. Q& h, |2 l  |* I) w/ z& g. lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ k  `( d$ Z7 Y$ {" U2 x6 v  \5 p4 b, `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 @9 M, ?5 U6 y; B! ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" F, k  q! q4 t" S: a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 }2 E- e% I4 o; o, H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; r8 a# a5 ?0 Y3 Gbegin P_induction arriving
/ e  {8 N* T# w    clone 1 load to P_pick(A_induct)% {  }' Y& l+ A+ ]. U' t0 w
end最大的系
. B) p* l: n+ U; ?$ x4 g
9 i5 ?' \& R  wbegin P_pick arriving! }  e  [, ]: \4 h: H
    set A_i to procindex * 10 + 1
$ p4 I- B' c; Z. \& X0 s    move into Q_induct(procindex)
) U* f* x, r7 y8 x5 r% t$ t8 S    move into pickaisle.induct(procindex)
$ h; g% E, L* v' f! @    /*check the type of pickaisle.induct(i), for your last problem.*/2 S* C( V1 H& \0 E% L3 A, g

/ J. [+ U  k9 s    while A_i<=30 do begin
. q/ c/ v7 X9 F) C6 }6 a% m        travel to pickaisle.con(A_i)% ?' U1 M& f( \* E  e  ]; R! W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ m/ b" Z( y! W" `6 k
        else wait for 10 sec  K$ f2 r; z/ n* ?% S
        if A_i=A_leave then send to die# W: h2 B+ N! [  L0 ]
        else inc A_i by 1! ?& G; m+ \& K* M# v& g9 m, T  K
    end
: V  h  R1 o' m9 x' e2 k9 K; @end
/ S1 G& ^$ p$ s6 J% D5 w) Q
- `. y1 T' T7 U其中的procindex为整形,代表当前process的序号。! X* o' N4 k6 G, x6 y$ u+ f
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-8-10 10:13 , Processed in 0.023728 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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