设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15319|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ X! }7 F) P, t  E* E

" r* k. L6 `8 @- N( k我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 t$ K1 M" A4 b; h& `# c) U! |% e/ Z$ Y: b$ L
begin P_read arriving1 A2 \* |/ b) d$ b' N
    while 1=1 do begin; K4 p: V3 z( q! W! I+ }' N4 U
        read A_tote from "data.txt" with delimiter "\n"3 ^; N5 M- N1 Q
        read A_time from "data.txt" with delimiter "\n"
' j8 l" a% S0 K9 N/ h0 l  k        read A_leave from "data.txt" with delimiter "\n"& \# D7 c( d5 P( u' ]1 Y
        read A_picks from "data.txt" with delimiter "\n"
' {$ Z+ `, f& g& K        set load type to A_tote5 d/ r4 s% [5 s! m
        if A_tote="tote 1" then set A_induct to 1+ B4 e0 @2 U6 a- E8 P. x  Q
        else if A_tote="tote 2" then set A_induct to 2
2 `. y& {  E7 M/ h$ H* I: S5 c            else set A_induct to 3   
0 N' B/ o9 p1 d" E9 F$ U! O        set A_i to 0# c  c3 Z  A6 m) |
        clone 1 load to P_induction
% r* k* l& N, B$ g4 h- [        wait for A_time sec8 S" {- s* n: f0 {3 Q, |+ i$ @
    end3 z, t" n7 n- p3 [/ V
end* _( H. P: O' L1 V9 E  |9 ~
; k4 o# o% ^' n+ K& Y: R0 ?
begin P_induction arriving' \: k! B. [9 k$ ?3 G- d% ~3 C
    if A_induct=1 then clone 1 load to P_pick1- V) u3 ?; H/ {/ t% W+ n) l3 X
    else if A_induct=2 then clone 1 load to P_pick29 w& P% ^& l. i( h' s  s3 ]
        else clone 1 load to P_pick31 ?9 a" d  v$ A
end, V$ u& @# d. a/ C  ?7 R# T
. }% e; o; g* {$ s
begin P_pick1 arriving
- {+ J" |/ N# J% u    set A_i to 1
6 U3 C" H; t. v# Y! t/ b6 r$ c    move into Q_induct14 }  L5 i* V, i; }5 v
    move into pickaisle.induct1+ [. T0 [+ t! S" ]
    while A_i<=30 do begin
/ l- r- X' C! w) d        travel to pickaisle.con(A_i)" _0 X! \1 o) y' y3 z7 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; k( Z! Q( g5 k& d) l
        else wait for 10 sec
' i% y! O; c5 y1 E4 ]# V        if A_i=A_leave then send to die! v0 c. `6 ]! `
        else inc A_i by 1
1 O! I6 w% @9 e: E& e    end
6 U! `. `( ?2 n2 n! F2 rend! x$ g; `' y# s) `, \' U4 c& E
: r7 N! O' l2 W
begin P_pick2 arriving
' |9 @6 O" L' X, E    set A_i to 11- A9 u) `" x5 ?( K
    move into Q_induct2) }3 M( m4 Y" i9 [
    move into pickaisle.induct2
) \/ |! h. x; W: I0 {" V    while A_i<=30 do begin
/ a3 z  _- I, h0 `' _& c        travel to pickaisle.con(A_i)$ Y) D6 V2 m- J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# p& I3 {1 ?2 ]* W! e9 n4 v
        else wait for 10 sec
, S3 ?( [, I' k& w6 Q) t6 d        if A_i=A_leave then send to die
3 w1 l  a) h' ]6 f3 |7 r: K        else inc A_i by 1) Y' B5 q, p) G' M$ q: G+ W5 O7 Z
    end) h$ q( Y6 k3 l- \+ p' O
end6 y+ P, b5 p1 r/ }7 z
, {) H; q) f% [& m: |8 ^- |
begin P_pick3 arriving9 a( o( _  M( R- \9 x/ V3 F
    set A_i to 21+ U" M0 \: t  g. C; X& a
    move into Q_induct33 d0 N' }$ \5 Y
    move into pickaisle.induct35 ]# g, `+ e+ A& k; ?: c( p
    while A_i<=30 do begin* W1 \7 X5 E/ C( G7 f1 |
        travel to pickaisle.con(A_i)7 a, A* b; v2 [, E6 v# L; @7 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 O9 o/ k, h) @
        else wait for 10 sec
: Z, _2 y$ n1 Y, G! R        if A_i=A_leave then send to die
  A1 J' R  c4 e" \        else inc A_i by 1
5 }5 Y3 p9 l& k8 ]; ^) d    end- j9 i2 K. H8 r1 y
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是个什么东东?
! x. s% R2 M5 C3 u: i- \  qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% r. ]5 `. x: p7 e- q. N" m& y

" p: m! N1 H1 C( ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% k, g) u" j' ]5 e% s3 b( n2 ?4 h1 y
( V! |# P7 Q$ m$ I4 X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; r' h% b# g* d, j7 T
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) D! q8 @; K* K7 W' R' s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- s( {0 x/ m. K% G6 P$ A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) y2 |" O8 M, A: n$ A2 Z
begin P_induction arriving
. n7 b' P! S* f, \& l0 A/ @% g2 N    clone 1 load to P_pick(A_induct)
, c4 C! Y, Q7 E7 x; dend最大的系
5 i6 T# _, f; K; D1 o, s* t
, A% X% f& f7 e) zbegin P_pick arriving
9 O! B& z7 O1 b1 J( p    set A_i to procindex * 10 + 1
4 |- H3 ^! }/ Q4 O! u5 N; g    move into Q_induct(procindex)4 |' m8 H" Y5 e: Z$ H1 ?
    move into pickaisle.induct(procindex)2 j. o# z2 F% ]+ R  Q
    /*check the type of pickaisle.induct(i), for your last problem.*/
# \" C4 S8 q. L0 ?1 E1 y: p: f1 V. Z" U& u, M
    while A_i<=30 do begin
' I! {/ K1 B" @" a  \' f$ Y        travel to pickaisle.con(A_i)  n# k' w0 y" J2 i* e& h* l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 K' t# i3 S) }; ]' m5 y( W
        else wait for 10 sec5 w) `5 _* o% m4 Z8 W+ p% {
        if A_i=A_leave then send to die
3 M' @- H7 V' t        else inc A_i by 10 R! F) C6 @7 c$ i( e7 r0 ~
    end
) E) O/ M+ \4 q- P# r. oend
3 o9 C& R' G. `& p! |5 w/ y1 d0 S( {# g, G5 ]  O% O5 C' U% c
其中的procindex为整形,代表当前process的序号。" ~5 k, R, J7 `
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-2 09:30 , Processed in 0.015879 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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