设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12750|回复: 2

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

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

" J2 t( M, ]' K3 @; W  X, p* A0 F6 {5 D我的问题是,在每个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 k) V1 t7 @* s' R, [$ D% a
7 }9 ]7 }9 d/ z2 O/ qbegin P_read arriving
  F, H+ n: E( ~9 t    while 1=1 do begin
2 o) X8 E- I# ], S; p( j        read A_tote from "data.txt" with delimiter "\n"
  ~) |7 _6 V! w$ W6 C1 y" h% v3 x        read A_time from "data.txt" with delimiter "\n"" e% f5 N9 w2 p+ u- j5 t8 N
        read A_leave from "data.txt" with delimiter "\n"
4 @* Q% V& Y0 d# r4 R1 A1 z  Z2 V/ o        read A_picks from "data.txt" with delimiter "\n"
1 u# M/ q1 |* Q7 ~; U9 `        set load type to A_tote' w$ L2 N6 @% _0 L
        if A_tote="tote 1" then set A_induct to 1; _' h' |. ?( q
        else if A_tote="tote 2" then set A_induct to 2- l3 y7 k9 g' [) H
            else set A_induct to 3   
4 t( P7 S+ G! E4 q  X" ?6 I1 t        set A_i to 04 k; ^* Q/ C, c2 o$ p, A1 Y# a. t  l
        clone 1 load to P_induction6 U, C: L2 h5 \
        wait for A_time sec
/ r& \# I. n: U    end
' Z+ Q0 Q  x8 r2 x3 D# @end+ L# u4 m# ~8 V5 u; _
. }+ F4 J3 b0 n' x
begin P_induction arriving/ O/ B5 q9 m7 I8 l
    if A_induct=1 then clone 1 load to P_pick13 |$ R% t: n2 z" B
    else if A_induct=2 then clone 1 load to P_pick2
/ z; S( h* k) e/ A        else clone 1 load to P_pick3
3 J) R) s) u; B) i, B+ d; V6 c  V8 Q0 Send! k; c5 U- p$ H$ S( Z

# k, @) F2 f0 {% h" tbegin P_pick1 arriving
. V+ ]# N* e2 @% P) |4 I    set A_i to 10 f" e& z, W* _( ^9 c' X2 [8 K
    move into Q_induct1$ Y9 F5 v3 h5 ?. n) m
    move into pickaisle.induct1* Z; E* p! Z# O4 [6 [) B. U
    while A_i<=30 do begin, x& \( ]! N5 X5 {/ B& f
        travel to pickaisle.con(A_i)# e% }7 [% i2 P2 x- X$ n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 B( h4 v6 k. V; I9 f
        else wait for 10 sec
" i1 L$ _5 b) S; e+ o        if A_i=A_leave then send to die
2 i6 w$ H/ d  m. F0 f        else inc A_i by 1
! J; T2 i- O' P; `    end+ C' j$ U1 o. L; i* E" ?; L% x
end
5 C" W3 m' B( e' B; [  T& A
- B3 }5 Q5 j+ V0 k# }; S6 bbegin P_pick2 arriving6 \# k! `' f) K- t  @4 v
    set A_i to 11: d7 U& b# L7 b! |8 i3 u& b
    move into Q_induct2) n# m8 }4 S, O* X* X
    move into pickaisle.induct2
  j+ H1 a2 r. r" w8 Q4 q. _1 \    while A_i<=30 do begin. p2 {; f- s) I3 ?* k- T
        travel to pickaisle.con(A_i)# {# ?' C6 r. n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( Z, v2 G, l) k* V1 q3 S6 z        else wait for 10 sec9 j2 N1 I: T9 H% @! V: Q
        if A_i=A_leave then send to die
) a# S5 d# _; ]        else inc A_i by 1
' k& n- n/ @8 a; p. U1 J! {* M    end* ^$ r" B* W. n" }3 }" P$ n6 v
end
- O% C7 L5 ]4 [- W: D4 c" u# J3 B5 z
begin P_pick3 arriving7 \' q7 R4 R) u" B2 r
    set A_i to 217 l, f+ b6 W+ U$ s- c. \+ o
    move into Q_induct3
8 [9 P6 o$ w( P; L' ?  c    move into pickaisle.induct3% V' }) S0 @& w# i1 G3 Y' Q5 I; b
    while A_i<=30 do begin4 l5 L; n# Y9 b
        travel to pickaisle.con(A_i): Y" Y7 \6 m9 L9 K% f6 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ N8 |! e0 [; K, m4 w        else wait for 10 sec
2 e- i$ t0 U6 x4 }8 A        if A_i=A_leave then send to die
' G. a; M8 T. L        else inc A_i by 18 l* X0 X/ o6 y& n2 Q$ M+ D
    end* W) R7 R1 W, j9 w9 i( a% j' ?" x- m
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是个什么东东?
. D7 `2 f. a2 d9 s* c# ]  Y. ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 C( I0 k) p$ M5 Z, J8 y* N0 v1 o! }& C, u% c& [3 \5 }: F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 f  o# j9 z4 G" ], I5 r' n! [, J" ~6 M5 \0 [+ V
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' G& k) v: C7 u+ G/ D; \! r: f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 X. Z5 c* [" Q7 b3 s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: W( G# v6 K" X/ E3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( ]9 V2 Q5 r  }$ g3 A
begin P_induction arriving
: }9 t* @6 b! _, t& K, d    clone 1 load to P_pick(A_induct)) p- l; S) h/ ~3 o
end最大的系; V4 D( P2 r4 e) K4 ^5 ~; ~2 w# x

/ N. `% z5 ~0 Hbegin P_pick arriving( _" i, B8 T3 o
    set A_i to procindex * 10 + 1
- Z  W' J4 H; {; j    move into Q_induct(procindex), O. M' E& M. v; W
    move into pickaisle.induct(procindex)( W1 e: ^/ ^6 p: h2 p3 c
    /*check the type of pickaisle.induct(i), for your last problem.*/6 T2 n- z" ^+ d7 o/ o: |: r

9 U  |+ g% V5 v! f    while A_i<=30 do begin5 u- c7 M/ j- [
        travel to pickaisle.con(A_i)3 ~+ a3 `9 a. Y* Z/ N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ t' U1 V$ S$ I
        else wait for 10 sec
) C+ W* s9 Q# H, @" V        if A_i=A_leave then send to die% O; b$ }; S0 N) S* d
        else inc A_i by 1
4 H; t) ~7 M: R4 R' p    end' T4 `5 o' t* x# g9 X3 V6 Q3 B2 I
end+ C3 O* Z. `# H9 G3 L" h* p

! b2 }( v) V7 B2 D) P( v其中的procindex为整形,代表当前process的序号。
! G) z+ w3 u+ x9 n2 |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-2-17 10:29 , Processed in 0.014253 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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