设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11681|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 K1 s8 e9 ^& x" _1 ~$ }& c

4 k2 ^4 G6 v& }  x; o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; _/ @; R( g. [3 }: z
' o1 E. }5 `5 X7 h, ibegin P_read arriving
6 }( u+ m& e: G0 G4 U$ T1 Q) H    while 1=1 do begin
' [/ @; ^  p$ h        read A_tote from "data.txt" with delimiter "\n"
$ U( G* S2 p; z: s9 b+ t        read A_time from "data.txt" with delimiter "\n"
# ~% q; c! W' }- @& x        read A_leave from "data.txt" with delimiter "\n"
1 E: f' h1 T. o% D        read A_picks from "data.txt" with delimiter "\n"7 I, b& A: d  ~2 m- w5 _6 I) b
        set load type to A_tote, h' Y- E7 W- `8 T9 m$ t4 @: u' {
        if A_tote="tote 1" then set A_induct to 1! o1 R% ^$ H; m% P/ l
        else if A_tote="tote 2" then set A_induct to 2
8 K: k( R! B  k% s0 U& H6 U            else set A_induct to 3    2 o& Z- K) T1 S) u+ g
        set A_i to 0+ ^* B; }) D" U% q3 h! u" k
        clone 1 load to P_induction) z3 e. M& i' R
        wait for A_time sec
) b- V' i7 e8 H5 |    end3 x$ K( D0 a1 q0 @/ U# L
end
% i% {. R& N( U9 b* d- Z/ G/ Y% c* w. a/ }, U% x6 Y
begin P_induction arriving. o7 P; a; \" J% Q* @
    if A_induct=1 then clone 1 load to P_pick1# P: d* e: F  g7 d! ?6 z4 l2 g
    else if A_induct=2 then clone 1 load to P_pick2
! T+ k, c# o9 \% w        else clone 1 load to P_pick31 ~8 ?8 a* ^0 `! d" [
end
% l4 \: s: F: R" I1 S! e) u- h) j9 z
begin P_pick1 arriving
. U" y/ C! c2 ~* P! I4 l    set A_i to 1
6 @% a; p% _! O/ ~8 h    move into Q_induct1
% \3 U7 _% o6 e* M2 e    move into pickaisle.induct1
7 t8 w! V* @8 o" s! b    while A_i<=30 do begin
6 ~) p0 Y7 Q6 ^        travel to pickaisle.con(A_i)6 ?  m1 K6 A5 Z/ i5 V: ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! b' h3 _8 I& |5 ]5 J
        else wait for 10 sec
( N: z2 k$ v$ _& q9 W        if A_i=A_leave then send to die
, O6 H! U. _* G5 s! u        else inc A_i by 1
  e  N% r3 u6 a) m4 @- \. a$ k    end
5 L$ N. O6 P+ e* R5 I  _end
1 K* [* d4 [  [; W  W
' |+ z' _  o, z( M% Lbegin P_pick2 arriving3 V( E) ?" N* _, b
    set A_i to 11
- F0 u; q. K. H( }7 w& U' ^" i: `    move into Q_induct2
' I& }( I& J$ L! X  Q    move into pickaisle.induct2
$ z( D, {* i+ H/ c    while A_i<=30 do begin
- r$ _. r/ [$ w% n6 g& |( R9 [        travel to pickaisle.con(A_i)
( D8 X) ], E; k! d; l  }, W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* W) Y; o4 k4 b" |- B        else wait for 10 sec
7 v6 M3 O. \3 p7 @8 l        if A_i=A_leave then send to die
) Q& O% c. C( }0 u! h/ u, t        else inc A_i by 13 B$ o. S7 ?( G
    end9 S, z: L4 Q# O# c0 \8 E4 s: F+ `
end
/ V: P; F. _+ R+ \3 b6 p3 u+ Y$ H0 w
. L( U; V( L. W9 Q2 i) }! sbegin P_pick3 arriving9 F5 M; n% K" ~( G% r9 h- G, o4 S
    set A_i to 210 Z$ _  B/ \4 V1 R
    move into Q_induct3$ o0 \/ v# s9 f1 \6 j
    move into pickaisle.induct3
7 @. h8 F% x1 `7 r, e$ g    while A_i<=30 do begin/ {7 J4 _+ U( A8 K, }
        travel to pickaisle.con(A_i)
. l- i) Q: {; F) ~6 Z/ S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* A& e. U( r# L( p        else wait for 10 sec
* P) T! }9 u& C; s1 h2 J        if A_i=A_leave then send to die$ p9 M7 `. @* x1 z) }; d
        else inc A_i by 1
4 Y) J( s% l: _. V    end2 @' C+ \- Q2 A: x, a/ b
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 H( I$ V1 Y. O9 }  q9 D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 o$ Z) H4 k9 k8 t" B8 v) D/ E  |& R( \. ^  k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 ?( a8 L) f4 Z" u8 x5 y+ V) S2 M3 f
9 v, D) Q- _+ q1 P2 r7 K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( k4 h! y& ^0 |  U7 U1 C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 y" a0 f! _' p# S  u- W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ e. _  C# L0 \  E2 W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ U# U' D2 Z" V: c% m: p
begin P_induction arriving1 M' }4 C; z4 y  [
    clone 1 load to P_pick(A_induct). B1 q7 e! B7 ^- l
end最大的系
" ^: J+ J1 k+ _
: w) x! e$ ^* bbegin P_pick arriving7 k, R# I+ P6 Z' \" X; b8 b2 R
    set A_i to procindex * 10 + 1! Q2 u- e- J% C/ T( j5 V  y
    move into Q_induct(procindex)- l& M; x$ |) @# R. g
    move into pickaisle.induct(procindex)* g# D1 b. T8 G+ E; Q% Z* ?- H
    /*check the type of pickaisle.induct(i), for your last problem.*/
' z4 g$ a; L3 H$ A/ j: }  n
  Y  u" d6 ^) E5 u* ~9 v0 I    while A_i<=30 do begin. E) ^9 c/ m3 n0 C9 j% [
        travel to pickaisle.con(A_i)
" w* G: b& B" r8 x% f8 [! Z9 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& p- ~# G/ z5 M' x
        else wait for 10 sec6 O( f; D( K& H. M8 D- j
        if A_i=A_leave then send to die
& `3 T$ V. ?% H$ J  d: Y+ F        else inc A_i by 11 i+ @4 I( O6 y  ?
    end$ A' q* ^* j' h6 {
end7 l7 p; k3 z3 y# t% \" S0 |1 S7 ~
9 P( [( ]9 f" }& d- m$ ^# y
其中的procindex为整形,代表当前process的序号。
9 b3 f, \2 _2 P1 i4 {2 K, Ystation和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, 2025-11-27 07:33 , Processed in 0.019796 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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