设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11680|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  }$ ^+ o3 x# i0 [9 {' g; Z' Y
# w2 w3 U  v1 T# c; W/ p" l我的问题是,在每个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中的数值,不知道会不会有什么不妥。: ?7 V- E7 Z( X/ s# A

; `7 l5 B6 w7 O* kbegin P_read arriving% p+ e2 R, [+ u8 m$ [% m0 P" g
    while 1=1 do begin; b# S) u. T, ]* ?7 |4 m0 s$ X
        read A_tote from "data.txt" with delimiter "\n"1 b- ?! f5 U' W3 a0 t' e* }" [/ B  }
        read A_time from "data.txt" with delimiter "\n"2 N( N: }0 P! \7 O. r
        read A_leave from "data.txt" with delimiter "\n"
! H7 y& {8 Q8 `, w9 j! X        read A_picks from "data.txt" with delimiter "\n"
1 P% M6 f  D/ m3 j" I+ l! h( J4 }        set load type to A_tote
0 m# S/ G9 w" d; M5 f5 ~1 w* Q        if A_tote="tote 1" then set A_induct to 11 v0 Z% E4 Y4 Z0 x+ R
        else if A_tote="tote 2" then set A_induct to 2, _+ h5 L- U* g* ~* |
            else set A_induct to 3   
8 N+ O  c# f0 d' ~        set A_i to 06 V7 c! [  y  B% N" a  N2 Y4 P6 `
        clone 1 load to P_induction7 e: H5 w# L# ?7 m* Z, Q2 j4 `
        wait for A_time sec/ O& ^' R. s7 B3 [& t) M0 {
    end
- c4 Y+ ]1 |9 a# Y3 Pend
& z' ~4 k) c1 g* l( d. y
4 b- T! w* ^; p7 ]3 Dbegin P_induction arriving
* X2 q; q0 W# [* W- q+ L    if A_induct=1 then clone 1 load to P_pick12 u4 G( V( D; F2 P3 F. H& F
    else if A_induct=2 then clone 1 load to P_pick2
* L- {( i3 w; X& k        else clone 1 load to P_pick3! p: ~) J% P$ E3 p) V3 y
end6 V( V6 h8 h4 \8 Q  ]5 p: F
$ ~0 M* d! L$ i, u$ n1 _  l
begin P_pick1 arriving
8 L1 _+ `% V" K! C) ?  E+ @7 O: g    set A_i to 1
- ^3 M; v3 ^" J0 Q& f    move into Q_induct1
( w; I. {' f  v$ `/ n    move into pickaisle.induct1; d: \4 L0 Q3 J  e7 x
    while A_i<=30 do begin
7 s; ]$ Q: Z( M2 P+ s        travel to pickaisle.con(A_i)
7 M( H6 |( @) _. x, H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) G1 U5 U/ R4 q2 H3 G: I9 I, @        else wait for 10 sec' o5 \, y$ r' p
        if A_i=A_leave then send to die6 n# M$ W5 d" R9 j
        else inc A_i by 1; I# c( o  |6 [9 A* G* p0 a
    end* @  ~7 Y0 ]  d' E6 X/ Q# P
end
3 ^6 ?4 r  H+ d4 l0 m* j9 D1 O5 e9 ?7 p
begin P_pick2 arriving8 q% `. t  ^/ M% Z) R
    set A_i to 11
) X8 z: i8 ~( I$ d; y! f. h8 s: b    move into Q_induct2
/ s+ Q6 _* j/ o6 ]    move into pickaisle.induct2
7 Z7 j' A+ _: [" `3 a    while A_i<=30 do begin" o1 A- e' l( e7 V' A" F. d/ [' P% }
        travel to pickaisle.con(A_i)0 s1 _" [- R; d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 x9 V5 ^% {  w. y  X9 ]1 y; I        else wait for 10 sec
. o: J2 ?5 U% ]* `3 {! ^, i( h. r        if A_i=A_leave then send to die% G, T$ L( k8 X6 G9 R
        else inc A_i by 1
( y# p' @# ^2 J4 u3 _- m    end! N0 d* w! W4 C1 o; L0 w! S
end
; c. R8 _# F" J; V' g6 q+ ?( v4 ?7 |5 M
begin P_pick3 arriving
) u# G! V) r# Z% n    set A_i to 214 I. `& C! B/ W4 Y& z
    move into Q_induct3* ~: u2 {9 Z/ ]8 T) B  |; h& ^$ v
    move into pickaisle.induct3
2 ^5 K6 c4 B% P; o) u    while A_i<=30 do begin, N+ j8 c/ B% y, y: G! f2 i
        travel to pickaisle.con(A_i)
/ D; M  E1 `. F7 S0 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& B9 q: S% O9 A
        else wait for 10 sec( }) U8 \- S8 V! Z3 p# {, }! a
        if A_i=A_leave then send to die
; [6 q; t& D) T& p6 [        else inc A_i by 1' R6 j7 S, h6 r( e6 Q5 M1 c, c) F
    end
  e( e  T! c- c) eend

最佳答案

查看完整内容

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是个什么东东?
( E- ?% N4 L0 \" qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# i: i7 b, C- o4 N0 O7 D% `  b$ v' c  {$ B" a, @! l! e6 h" P! x% U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! h. V$ s' Q4 V: c+ N( R0 `- ~( d9 U  p7 N% B+ u, o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 Z) h. s1 z* I' I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: ]) t1 w) P/ I2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' D; @5 Y) z! |+ Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; h- T1 l2 ~# P2 C
begin P_induction arriving
% u, {0 ^! B* V1 [' o    clone 1 load to P_pick(A_induct)
4 L; P( u) C& g+ c" b+ pend最大的系. I- j+ _" q" G1 z3 w

: t/ E# d9 c- ]# u2 L' @begin P_pick arriving1 b5 G; |/ ]) o$ i3 J
    set A_i to procindex * 10 + 18 }% u3 A& ~4 j  i4 d- R  c. S
    move into Q_induct(procindex). t: V# G* o) v$ p/ L7 e. _' N8 s
    move into pickaisle.induct(procindex)
( d6 g" @& [* B' F+ r    /*check the type of pickaisle.induct(i), for your last problem.*/
& W' v7 L# j/ P- m, a3 o
; U' r9 v) o& S0 U* O    while A_i<=30 do begin8 g# g& G  A( A- {9 A
        travel to pickaisle.con(A_i)
2 O) d# E; K% d! r/ Z  f0 x7 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& P8 k$ J* t8 I! k
        else wait for 10 sec
- a& L  f' d- g  {  @% h        if A_i=A_leave then send to die
* S$ e) L9 E( U+ @  x        else inc A_i by 1
/ R" b. g5 I# S4 D% s; S    end
/ g% x: k& o& O2 cend* m, R, o( K6 Q9 g& C9 n& D

1 _9 I7 Y+ Z/ }( x2 J其中的procindex为整形,代表当前process的序号。7 {$ J1 Y' ?# b5 F
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, 2025-11-27 05:10 , Processed in 0.014579 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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