设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14347|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: l# r# i" K- f- R# _# A
7 C. R6 K( s* @, M' t
我的问题是,在每个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 e" w% C$ P* M
: @0 d: u7 Q" ^9 o, n2 nbegin P_read arriving0 h& `) O4 Y8 B3 v
    while 1=1 do begin$ ~1 B% ^; R% K0 X- n% C2 Z+ X
        read A_tote from "data.txt" with delimiter "\n"
% Z1 p( ?3 I6 `  K        read A_time from "data.txt" with delimiter "\n", S. e6 W) R' ]' Z' z
        read A_leave from "data.txt" with delimiter "\n"
; ~. K8 r+ [5 E0 `8 L9 Z        read A_picks from "data.txt" with delimiter "\n"( ?5 Z* z; k# W! Z6 U
        set load type to A_tote
9 l7 P3 N8 P  J; t" V8 e        if A_tote="tote 1" then set A_induct to 1
% h, b" {" `, o. a. E, d        else if A_tote="tote 2" then set A_induct to 2
; E+ @9 G' R6 C" h            else set A_induct to 3   
; h. v- R2 u) u$ K. j/ F        set A_i to 0
) I; H6 L. v0 P$ R        clone 1 load to P_induction
/ f% `2 q: F+ v; p        wait for A_time sec/ c( B( e' m. u2 x6 J* K9 k
    end
9 Z- B2 ^; |/ G/ k7 U! K& wend
" a# i. i2 @8 z% p: u3 J3 w1 V( @+ R; H" m3 x( b2 O$ y; g
begin P_induction arriving
" T4 R: {% V- a& l7 O2 Q& {    if A_induct=1 then clone 1 load to P_pick1
6 q+ ?% k& |  ]6 B" R    else if A_induct=2 then clone 1 load to P_pick2/ T2 d$ Z& o+ S+ V4 s! `1 r
        else clone 1 load to P_pick3
0 l, F- J& h3 D- M  tend
' i; C6 H9 B9 m1 E8 l
4 r  J3 S+ M& `  z: I; ]begin P_pick1 arriving
6 W5 s6 U& T7 s    set A_i to 1
: F! O( w' `- m/ t4 s  @! O+ [    move into Q_induct13 o0 r1 @0 O; Y$ x
    move into pickaisle.induct12 i1 f9 |- |: {
    while A_i<=30 do begin
- @- [9 A6 k, q; `, l( J        travel to pickaisle.con(A_i)
% D& m" P2 Q7 M+ h: Y$ H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) A/ }! {4 O' |) _7 B4 Q: E
        else wait for 10 sec
3 y: X, [; V1 V0 c% n$ ~0 J        if A_i=A_leave then send to die8 Y# E% t! L  D( n
        else inc A_i by 1/ |8 \- x1 h/ r6 x9 {) Q" J
    end
: Q  o/ v/ G% a5 D7 E' Mend
+ v& e! b# T9 D% y9 \4 V7 {) H5 g# S2 A; u
begin P_pick2 arriving
: w* ^/ z' r9 i    set A_i to 11
3 L$ ]' x: h0 C/ A1 r! y    move into Q_induct25 K9 ~$ \/ w0 G0 S9 ]0 f
    move into pickaisle.induct2# v- @$ k: h0 C
    while A_i<=30 do begin# H4 K- i" s6 A8 N+ |
        travel to pickaisle.con(A_i)
& \2 m7 w  h1 Y# K: b+ f9 S- [! E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. \# X: j% ~5 C/ N        else wait for 10 sec
' K  n: P5 h: U        if A_i=A_leave then send to die" s, o" }/ \  ^8 I
        else inc A_i by 1
; L# B; E4 Z& P7 b4 y7 r0 Q) T    end
3 l. H" p) g9 Iend7 c% Z8 N) c/ k2 ^& ~
0 U& a: o5 x. |9 d0 `* F
begin P_pick3 arriving. E; ?3 p% T* \0 Q) D) B( L
    set A_i to 21
3 [+ r4 M. q2 T/ \# W/ C7 N    move into Q_induct3
$ I+ H% T4 i/ c! s8 o    move into pickaisle.induct3: d7 _3 W) v4 E( Y- X9 n  X8 ~6 ]
    while A_i<=30 do begin. H( Z- }/ T! n9 i
        travel to pickaisle.con(A_i)
* D- w9 a0 N& C1 B. N( K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ]! \$ L7 f: ^5 z$ a
        else wait for 10 sec
  _! y( `( X( C5 }        if A_i=A_leave then send to die  L$ u9 m! D, G5 j0 A
        else inc A_i by 13 i: f" l3 [( B  D$ {5 `
    end
. o" B# V* _/ U8 a1 p2 }0 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是个什么东东?0 O1 P, P; V) E; Y5 G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( g; O" I0 M& E$ @, s  `5 k( K

& _- F* u* Y6 ]% y& `: L, ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( r: l7 d3 y) n( z2 @- S6 B
: L! p" c6 b$ v: Z+ R, q7 I6 s
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 d  R9 k$ T' m/ S* w1 \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 s# S' B% k; w4 z% X3 a
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 e& @& ?- Z5 I+ T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 x4 \. k9 W: c3 C5 i: ^4 Ebegin P_induction arriving
5 s% C; h4 ~9 ]( ]    clone 1 load to P_pick(A_induct)
; x8 X" ]9 L4 g, B* D( A" Pend最大的系
- c, A0 W* a: t+ }: {
9 q9 n$ s2 ]1 |! zbegin P_pick arriving( t$ u: v# h+ }1 B; ~5 A) b
    set A_i to procindex * 10 + 1
, ?/ F5 G) y- F/ I  H    move into Q_induct(procindex)% A9 h& @. i( g9 }; S4 }
    move into pickaisle.induct(procindex)
1 q+ ~8 x% x* n" R    /*check the type of pickaisle.induct(i), for your last problem.*/
0 ]! n* }: N, P$ Y; `# u3 y" t. a) q" X& I% A9 A
    while A_i<=30 do begin. {. m( V7 |3 _6 L8 ^
        travel to pickaisle.con(A_i)& _& L/ O- I! S; f- I3 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# m% q  `7 W& ^! F9 f- [5 u
        else wait for 10 sec! m6 ]$ |1 y5 D6 B/ C  Z' R
        if A_i=A_leave then send to die
; A' u; H" x1 z" A/ D! t* [        else inc A_i by 1
& H# V" t+ i6 O8 q; U    end: N* g% i/ d3 Q  T
end
  ~* Y1 `+ @7 {4 d# v% u3 {- I# s
% ]4 t% Q, ?5 ~$ D其中的procindex为整形,代表当前process的序号。
0 x' ]* N# g. W0 mstation和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-7-5 05:52 , Processed in 0.013007 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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