设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11747|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" i5 n- ?0 }: \  [* i4 T3 p
) k, E4 c1 A  t! ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ k' g5 C. T& b/ I

5 K/ E4 A( y) a* r6 `3 B+ \begin P_read arriving
" A1 R* B8 y9 o$ k    while 1=1 do begin
4 r, l$ Q8 q- I5 g) F        read A_tote from "data.txt" with delimiter "\n"- l* p5 h' H4 n) S7 L. g
        read A_time from "data.txt" with delimiter "\n"
+ q$ G" U5 f3 p5 n3 }" ^0 b        read A_leave from "data.txt" with delimiter "\n"
) z- x/ ]% q4 K. b        read A_picks from "data.txt" with delimiter "\n"
+ ~! Z+ r/ `% W* j% Y  o; \        set load type to A_tote
1 h4 y: r; P$ H% Q  V! O        if A_tote="tote 1" then set A_induct to 17 P$ s) _. d) y" x7 j7 x
        else if A_tote="tote 2" then set A_induct to 2
! z* s' c, x3 [$ ~9 ~5 [& @0 `4 m            else set A_induct to 3   
1 R6 j& k  y/ s; n# W: h        set A_i to 0- V9 K  s/ ]& |; z
        clone 1 load to P_induction0 J8 F5 p5 P( Y' D
        wait for A_time sec6 K8 k3 g9 q) Z8 f; v$ f+ p
    end" B: B7 B. E  f# Z% h' x
end% ~1 `  q# }5 o: h  p/ \* X& y/ ~

8 b3 t, U) B4 sbegin P_induction arriving/ T) t2 W. n, i+ |
    if A_induct=1 then clone 1 load to P_pick1( N6 l$ t; ^) u1 X& l( ^
    else if A_induct=2 then clone 1 load to P_pick2
6 l6 _( l9 o+ l  h: t) Y1 U) T        else clone 1 load to P_pick3( I6 _/ ]4 A9 \) w  G8 ^
end
' G+ ~5 Z1 \6 F( h8 t% B2 z0 K: [
begin P_pick1 arriving
! Q) p& n+ C3 Z! G/ N% h; Q$ L; f' C    set A_i to 11 ]% `9 F* @. _8 b
    move into Q_induct1
  J6 Q6 ?' B. }% l, e: Z, e    move into pickaisle.induct1# J6 e+ t" \2 E8 Z5 c# e: A: p
    while A_i<=30 do begin: j# {/ y/ ^3 s2 B% n
        travel to pickaisle.con(A_i)6 m, F: v) R& \- W! V5 h. G8 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 Z. P/ C+ L4 Z8 ^  ~5 U# l  o        else wait for 10 sec
6 `4 k% G4 `" }, C        if A_i=A_leave then send to die
9 _! L. M/ e% J$ o3 l) z, w        else inc A_i by 17 y  o* c% B" b( Q+ e+ d( Y
    end
0 D. t3 e! F3 F- ]3 c8 q+ ^end# t0 V8 @. Q+ r8 c

# ?5 J& o- h* ?1 B% I: _# pbegin P_pick2 arriving
: ?+ q& Y7 {* _# u- d    set A_i to 11: D& x' s7 ^* A) E' S& h- a5 z& T
    move into Q_induct2
; I3 j4 d( H7 X; ~+ X) f; J    move into pickaisle.induct2
9 Y$ z' V; y' W    while A_i<=30 do begin; G1 k& ]+ o5 u! ~, h3 P: p
        travel to pickaisle.con(A_i), V, C# S7 a/ I  N+ n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 G- H. @- n5 M( Q5 n, t        else wait for 10 sec' p" \" i3 i- S
        if A_i=A_leave then send to die: r7 M& r# p' B+ N
        else inc A_i by 1: ]7 }  \" B; B0 }+ ]0 j; U
    end/ g" j  K8 Y4 u0 I2 p, p, a; G; R
end! E/ K8 Z& S' x% H9 J! A( n
9 [9 r3 O3 X- O/ R
begin P_pick3 arriving+ h- C# h6 L0 }/ g; X  z
    set A_i to 21
+ n8 X9 |, M2 |; X, t    move into Q_induct3
4 e5 a# p% V6 Q    move into pickaisle.induct3
5 y3 }3 p5 E9 K( c) f, @+ l% z9 w    while A_i<=30 do begin
9 q. \+ \( R* O+ Q9 I6 `- Q        travel to pickaisle.con(A_i)
+ ~( I& F2 H( c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: h2 A  H+ i1 r, G
        else wait for 10 sec' a; m2 s" B8 x5 N7 T6 `- n! ]- f
        if A_i=A_leave then send to die1 p7 l) v1 W' q$ _% k& c
        else inc A_i by 1- X  J1 \* c) L! x- D- H! D* D
    end
7 Z2 E( _: y  F: }) p: D9 _% nend

最佳答案

查看完整内容

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是个什么东东?9 D& c( T' h  y, F0 v- ^
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' D! O; ^& k# F6 q1 y' I7 I9 A
) U( {7 R% }& _: j
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 h; U( J1 Z6 N& d6 J; M( a
7 w4 ]# p, m4 o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 z2 [: g0 V+ e$ w% _# ^8 ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 ]/ D/ M2 R! s; Y( ]5 g9 U9 V6 m
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& Q, F) z2 G5 O. s4 K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 G* w4 A6 F7 d3 C- C* c
begin P_induction arriving- g3 E# `/ d+ ~0 r8 D: o9 j4 h5 t
    clone 1 load to P_pick(A_induct)
* z, ?8 p( p! ~& r/ ]/ fend最大的系
% _3 D- h) _& c2 ]. t2 l4 A" ~8 R" f) }! }
begin P_pick arriving
8 r1 F4 j& v# j# H    set A_i to procindex * 10 + 1- e& K$ N  ^) s! e( [6 S
    move into Q_induct(procindex): B6 _2 R* K+ h+ H/ [7 J) }0 D
    move into pickaisle.induct(procindex)
1 ?$ B) }- {! n( a    /*check the type of pickaisle.induct(i), for your last problem.*/
( A; j" S1 {+ P. i! h5 r- k. n
. M8 N. H2 c5 k8 {3 g0 k    while A_i<=30 do begin8 T# ~% ^2 U7 J
        travel to pickaisle.con(A_i)$ E! g' B- f2 E& K- A8 a: u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! c9 V0 z- W! C4 s5 Z. X
        else wait for 10 sec
9 E6 [* ~( N" j$ e5 u' G% g& D" U        if A_i=A_leave then send to die' |6 b1 {0 Q* D9 [9 e
        else inc A_i by 13 ]- s! t8 X1 \, p% g/ d8 g) P
    end5 [2 c' K# a* t" D
end
+ p2 c) F' K0 ~0 i% P  j9 ~$ A5 z, i0 V3 [8 F! z' r7 j3 V, g
其中的procindex为整形,代表当前process的序号。
1 D( B* \3 j) Astation和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-12-2 04:53 , Processed in 0.017378 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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