设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15382|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: M1 _, o5 O  u# p

& @9 G3 a8 o' E我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 j7 `0 g- S/ p6 V

/ N, c( N7 i7 r# k% Nbegin P_read arriving( N, o% n2 y8 _& q, A/ P
    while 1=1 do begin6 W, T+ F9 K& i  M8 H0 Z
        read A_tote from "data.txt" with delimiter "\n"- M, R( e0 m/ t: K) k
        read A_time from "data.txt" with delimiter "\n"' x0 M/ @- H% g
        read A_leave from "data.txt" with delimiter "\n"8 `9 N7 k, Q! u5 E4 U: Z# v% u
        read A_picks from "data.txt" with delimiter "\n"
1 y' ~5 V; Q7 m$ m        set load type to A_tote7 R) N2 F/ H% F4 i6 V) U, D
        if A_tote="tote 1" then set A_induct to 1
  F' ^. H" Z+ J1 L8 n2 d        else if A_tote="tote 2" then set A_induct to 2
5 E+ K; y" k) Q            else set A_induct to 3    5 w- g& E2 z8 k! `7 U) I* e6 W4 ], _
        set A_i to 06 B  ?/ u4 I+ k) R/ R3 W$ O7 j% F
        clone 1 load to P_induction
! X! V+ R( `$ D, K2 M" F        wait for A_time sec4 y1 i" G) G. ^' Y
    end2 |( f1 i# k/ N6 U# W
end
  U+ B2 x5 C  J1 O. \  Q  p6 r3 Z4 k5 e% s3 c* J
begin P_induction arriving
; L. m* s% l: j7 E3 h# F$ L0 b    if A_induct=1 then clone 1 load to P_pick11 m% E) ^, X* X+ w/ X7 ]
    else if A_induct=2 then clone 1 load to P_pick2
7 B$ I4 M+ U; _3 m3 ]8 y, e: x        else clone 1 load to P_pick3
0 M4 K3 ~0 [) cend3 P. _" b& p8 }9 {
! u- o: T! y8 r' X6 I& l' G7 b
begin P_pick1 arriving5 A8 }- m5 b* \; y5 Q3 G
    set A_i to 1" Y1 E" i  M' g8 B
    move into Q_induct1& a9 U0 W6 W, C; p+ ?
    move into pickaisle.induct1, P% s% q' s0 b" Q4 a4 J
    while A_i<=30 do begin
. c% W, U% a2 s8 K' |        travel to pickaisle.con(A_i)' C6 \2 L" t+ x8 b/ i& I" w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ^2 }3 G% e/ B3 o7 i        else wait for 10 sec
' Q5 J; v7 B/ d8 r1 H        if A_i=A_leave then send to die
- X8 X$ z, l6 g& J: ?        else inc A_i by 1
+ e* K$ h! A! _4 V6 Q    end
8 b% \, |! v6 `& n/ _( g5 V  L6 U0 o' ~" \end
1 h7 m2 A: L( l+ i" F1 @6 y9 @2 Z& S* Q) K- Z- U0 l
begin P_pick2 arriving
, X! R4 O. g  |    set A_i to 11) l% L( h! o' t! F. }
    move into Q_induct2
( G. s! D6 m, {* i0 F: \    move into pickaisle.induct24 T" s. ~. i, e+ H, D
    while A_i<=30 do begin# f- ~0 D/ o- @9 ^. V
        travel to pickaisle.con(A_i)4 M; _+ ]0 V2 V  B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ~) X/ M$ n$ I# s  W4 t: w
        else wait for 10 sec( e8 u* k: l# n0 P# u6 Q2 J
        if A_i=A_leave then send to die
7 c) S, x: d. B( ~# {+ k        else inc A_i by 13 N; S$ @( n5 S" ~
    end
% s8 |& ~7 |) ~% z" C3 Jend$ g5 t3 s  R* T

5 u' z4 H9 N0 h$ Q$ F3 `3 a3 Cbegin P_pick3 arriving$ d. i% P8 n1 }+ a
    set A_i to 21
  `8 I/ E% ?& J) [1 t    move into Q_induct3
# X) _' m. r  e7 l1 _    move into pickaisle.induct3
, r7 u, z5 B( P4 y* v1 ]    while A_i<=30 do begin
6 ?0 d2 L1 m, N+ j+ b, [        travel to pickaisle.con(A_i)
' P  J, H+ F3 q5 J3 B2 l# Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  G1 |' `: ?! R" t: s
        else wait for 10 sec; R$ S1 t0 {/ \, f( s8 k! P% C- l
        if A_i=A_leave then send to die0 m  M8 d+ S) Z+ G/ u
        else inc A_i by 1, K! q' [; D: p# c/ N
    end9 s" K1 X, L1 H
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 {: p) q8 B8 i3 E% W" R& H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- }( P( d4 N9 S( Q9 g) d8 |, B* q. o

3 i1 H6 T8 V: G6 I, o/ l8 NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 _/ R+ Q- X3 v( ?7 F

6 @3 z8 j& I! P, O- R另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% C8 {/ {4 @, n/ P1 p% H9 |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) j5 m& H6 b% ?- r. i( S  Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ e+ e; E) |' g7 ~9 a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: w* U5 d& V+ abegin P_induction arriving
) r" |) {- i# t" x; s5 K* H    clone 1 load to P_pick(A_induct)! X  h6 N/ Q& R0 l
end最大的系
+ u/ e/ I0 ?  V" {. K6 h8 x9 Q0 U4 J* Q( w  p! @% ~
begin P_pick arriving1 m" `4 z* @, P' O: p- |# m
    set A_i to procindex * 10 + 1* s+ P% T  f1 K! L6 R* E# r& m; R
    move into Q_induct(procindex)
, D( H6 z6 Z( o8 D% \    move into pickaisle.induct(procindex)) k( i% i- @8 z& [
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 a: `' K, R  s$ A+ ~% t/ [3 t! [1 Y8 g
    while A_i<=30 do begin2 [/ `- ~# g' h+ y* T. Q( O
        travel to pickaisle.con(A_i)
1 h. w$ t% T/ c( p% ~; X, O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* o7 O3 g0 x0 F; L( U  o
        else wait for 10 sec& f1 [' m  g: X' F
        if A_i=A_leave then send to die
% `6 ]5 T; p+ V, f& Q) J- h        else inc A_i by 1/ Y$ ?3 n+ B( @$ e0 Y6 |7 W
    end
+ ]$ M  L. o% send
4 ^. W- j( M0 b% U" I' W$ K. c. R1 |. T
其中的procindex为整形,代表当前process的序号。; ~( U. J" e  u
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-9-7 19:39 , Processed in 0.018424 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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