设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13447|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 s" i/ f( ~/ M  {# b+ }2 j" [- ^" f; V5 N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, J0 z6 X4 B7 P1 c1 g1 _' K
1 J% T, \( k6 M, ybegin P_read arriving
; r6 L7 T6 J4 A( t    while 1=1 do begin4 B0 i8 N; G% q# z/ G
        read A_tote from "data.txt" with delimiter "\n"
% }# v& _; u: b6 J2 D        read A_time from "data.txt" with delimiter "\n"
1 R/ V: T( [; I& k        read A_leave from "data.txt" with delimiter "\n"! W3 ~* R, ?8 U: G6 P) m
        read A_picks from "data.txt" with delimiter "\n"# w: N! W7 E' u- s  q$ d
        set load type to A_tote
, F/ W/ o& D% T1 Q& w7 R7 u        if A_tote="tote 1" then set A_induct to 1
, j! S% T1 Q+ `5 q2 [3 [        else if A_tote="tote 2" then set A_induct to 2' T8 H7 k! y6 a* t$ x
            else set A_induct to 3    ' A2 @+ u/ ?' r, {4 G5 y0 w
        set A_i to 0
3 _3 c, r6 i4 \        clone 1 load to P_induction" h% _* S- W* E  h+ ^
        wait for A_time sec/ V& T( H& ]/ i
    end6 B2 F+ d* X; K
end
+ Q, L, x* _$ m( O( v0 c* a4 g4 K$ B+ j
begin P_induction arriving! E! Z8 A  {  b* c# m& I/ H
    if A_induct=1 then clone 1 load to P_pick1
8 y0 m' x8 P, c( n  p1 P" ~6 o' Y" n    else if A_induct=2 then clone 1 load to P_pick2+ u, s* {: j  M, E( X
        else clone 1 load to P_pick3& i1 ^! `+ O9 i/ j% k0 R- X& ~
end
9 i8 e1 G; |$ ~+ ?- Q! u$ g
; R, i2 z5 e7 w) @8 u- f, ybegin P_pick1 arriving
: N4 Z+ r+ g, x5 J    set A_i to 17 I  t( U* h& v) A
    move into Q_induct1
* g' J5 C* k! O) `; V    move into pickaisle.induct1% k' u, f# k% Y, V  L
    while A_i<=30 do begin$ L( J$ ?- I, y5 t% B9 c+ W
        travel to pickaisle.con(A_i)! P) R  [9 H8 R  x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 J/ n/ \$ {. ~" O" c/ j. l, H
        else wait for 10 sec% i% S2 T8 `' ?( W5 w
        if A_i=A_leave then send to die
% @" @) S" v3 x        else inc A_i by 17 a) w" E/ x& A+ ]
    end. V2 }" c+ U. B/ I
end
6 y; E9 e+ a- l' {
# O! `6 m9 H( d' i' ^+ @2 E8 h2 ibegin P_pick2 arriving
( h' m  f5 U3 I( [    set A_i to 11
, {, _1 B& _$ J3 }- L    move into Q_induct2) ?! T, y% Q1 e
    move into pickaisle.induct22 b- e: }# t9 k6 e- {
    while A_i<=30 do begin; W% g8 P: s2 w% f. U# ^' l
        travel to pickaisle.con(A_i)
7 s" s4 m8 G+ [$ M- ?; N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; h" _$ p! F- Z5 K+ Z5 I
        else wait for 10 sec
* c. `4 x5 s. w* X        if A_i=A_leave then send to die
* Z& I; R: R  M        else inc A_i by 1
' K7 ?' O% I/ s; @2 `: v1 b9 l, M7 H    end9 e/ u7 r3 J. t- d: R+ X1 G0 _/ n
end
5 z6 j: N# a! h% g, A1 I: W3 L6 G0 S! R. q) A6 V8 K
begin P_pick3 arriving) q7 {5 H5 V: `2 L* v: w
    set A_i to 21! W. R  q/ i6 i) f- t  s
    move into Q_induct3( a8 r  v8 ~9 r0 W7 i0 S) r
    move into pickaisle.induct35 V- t& O; w, o) r/ f6 q
    while A_i<=30 do begin  H5 W0 s) q1 p5 I
        travel to pickaisle.con(A_i)1 _7 B8 A5 ~. P0 C& d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 Z( X& F8 Y' ?! G. K3 M: ]) n
        else wait for 10 sec  O* d; {* T2 b9 q* A. U& o* X
        if A_i=A_leave then send to die. Z- e2 V2 f, B  _9 l5 ]
        else inc A_i by 1
- B; ~) ]( o+ H' _' L- B5 Y( C    end
3 L6 U: z" s; T' x2 \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是个什么东东?
% X7 H* d. b  i2 g$ {/ P1 I" O/ Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! ^$ @* F$ L) A; j" K; u5 B$ l( W( \( r
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 P+ u/ T- k; ^0 s9 _. A3 ]

( \- A& }0 W3 c3 w- g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: @) A) m! x# f# C, L. f$ b% T8 ^
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% d5 Y! K+ ~# d9 r0 ]0 N" I/ P( ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  Z6 S- k& s4 J& ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 A3 k9 T4 M7 d+ b( v0 Hbegin P_induction arriving
* S; y- W$ u" K( u$ `    clone 1 load to P_pick(A_induct)
- w  l' g" ~- n7 iend最大的系4 ^% y" B7 h3 ?8 I+ ~/ p6 o
, I# y; H. ~' m$ \+ m
begin P_pick arriving  P0 @* C4 x! y0 p" i6 a
    set A_i to procindex * 10 + 1
" f7 Y* b, x, ^/ r$ F: P. f    move into Q_induct(procindex)4 I6 c* G% l. q2 s- J
    move into pickaisle.induct(procindex)5 ~. V7 F# |' r
    /*check the type of pickaisle.induct(i), for your last problem.*/% u7 D' h6 C7 `) F

/ U1 |7 R  x: l! h  c    while A_i<=30 do begin1 W4 M3 l% K# v( H; T8 z0 M, @* v. Z* P
        travel to pickaisle.con(A_i)
/ m# f0 G# B9 Q1 U" ^- ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' `( s' l+ h5 P' W; F1 Y# I2 U- X
        else wait for 10 sec
) {# m9 H1 d1 G3 [, d$ c        if A_i=A_leave then send to die
' \" p" S* t( C8 I% p        else inc A_i by 14 T* i8 ]. w8 G/ a
    end
+ l. Y* n5 ?0 ?9 q2 n" Gend; N. }8 F4 j: ?4 q% ?
8 W4 v; G9 ]  L
其中的procindex为整形,代表当前process的序号。; U, n+ d; B" S8 T: p
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-4-15 03:47 , Processed in 0.015779 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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