设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13880|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. d) m! t4 u4 J( K" O1 ^4 x0 K- Y1 e2 B0 Q; [+ V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  n; v+ i7 j. g0 Z' ~* v6 w  w
2 ]# J( o/ u' C0 h8 _
begin P_read arriving3 o; k# Z, }0 ]+ r! ~; ]
    while 1=1 do begin
& p: N2 ]5 w% E+ S' ~& Q        read A_tote from "data.txt" with delimiter "\n"
- T- c$ h7 j; v9 N. n6 r9 P        read A_time from "data.txt" with delimiter "\n"* o0 P/ l. ~' u; O3 L. K$ i8 [7 ]
        read A_leave from "data.txt" with delimiter "\n"
# T; w* p$ s& W5 W: A. r        read A_picks from "data.txt" with delimiter "\n"
9 v# n: \: D* _, a4 s: K        set load type to A_tote7 _& z. S( l. P' W" w
        if A_tote="tote 1" then set A_induct to 1( }2 n9 J! g- Z9 ]) ^- G
        else if A_tote="tote 2" then set A_induct to 2% w  p  D/ n7 Q) A3 U0 V
            else set A_induct to 3   
9 |1 ^% G- Q' O3 c        set A_i to 0
; Y% Z, z  D. X+ m5 V  M- A0 q+ d        clone 1 load to P_induction
( b2 B# S* N4 y# R. J        wait for A_time sec
# O2 |% w. ?) G* B5 X  E0 n    end
0 m8 I$ w+ y3 I! Q9 V- s! Xend
* ]2 N  g0 `# T! t/ G# `; Y% F& y) m3 _) |: M/ Z
begin P_induction arriving
8 [9 i1 f' g3 ]% V' U    if A_induct=1 then clone 1 load to P_pick1
/ \0 p; L  q; y4 L. W" I    else if A_induct=2 then clone 1 load to P_pick2/ D* V! x6 D8 P0 g# F# k
        else clone 1 load to P_pick3' L. h+ V% [# R6 K
end
9 |7 Z8 O% J5 h, A3 T( ?7 J- b5 Q' R
begin P_pick1 arriving
$ Z9 E/ _% F2 e) g    set A_i to 1
' m& @" O  E# w1 P: U3 W    move into Q_induct1' z1 l  j2 j* h; y) V; E
    move into pickaisle.induct17 ^" M/ X) L' J5 N
    while A_i<=30 do begin: H1 g% B! u, K
        travel to pickaisle.con(A_i)% R2 R  G  t9 A' V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ u# \- M# h2 @        else wait for 10 sec
& S7 u4 P4 U9 s        if A_i=A_leave then send to die
8 A+ N& d3 L0 a" _3 c+ x        else inc A_i by 1
8 }, Q. e$ x0 [" S0 ]* Q% P' z2 a& j    end
0 }0 b' i5 y* W; |( ?% A- h1 Dend
; [4 y6 x, p$ e' v; [3 ?" l( `0 H& n& {6 R( T/ v/ c, v0 A' t2 P- T
begin P_pick2 arriving" Q; U, k& @, g$ U
    set A_i to 11
5 Y8 z0 b" ^, d8 V- C    move into Q_induct2
/ ]6 t2 S" \: `6 f8 p    move into pickaisle.induct2
/ z& V& R9 I. F" y& X# a% v    while A_i<=30 do begin
3 ^. E$ f$ s* X        travel to pickaisle.con(A_i), @6 J3 C" q! }: {+ ]( ]( ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* x$ N$ r- e, R; ]        else wait for 10 sec
' B# ^+ ^% W5 g/ y# w2 n& c7 V        if A_i=A_leave then send to die5 Q) N  T7 ]8 P& t
        else inc A_i by 1
" B( J6 J* ?7 ?. V    end- y6 ]. f6 X7 S
end# }: w9 Y9 s4 T" b5 M- B
1 q7 C" U* P5 n. n- W, k: Y
begin P_pick3 arriving. y: l" X. y6 m; e" k# z
    set A_i to 21
) |' p. E! K! h( Y    move into Q_induct3  d% V* ]2 Z; d
    move into pickaisle.induct3, I& ]4 Y( O! t) ?9 K4 [2 G5 }
    while A_i<=30 do begin$ t' G6 I6 q  U8 R; R% ]' H
        travel to pickaisle.con(A_i)- z! l; D; O. Z0 s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 L# r, Y5 P0 J1 M" S        else wait for 10 sec, n- c1 [& v/ r7 Y
        if A_i=A_leave then send to die
5 ~# q0 c, Q/ |! {* S. E7 x. ^' e6 B        else inc A_i by 1
* X8 B7 ~6 S  J; a    end# z) L* K1 B+ V* i
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是个什么东东?
- f, Q$ w# Q2 X4 G. _move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( D% L9 Q7 y1 r# P2 V" {, ~( z) Q# c4 Q- p6 L: g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% c9 S3 O8 g9 u
. f, Q% F; O& x. H- c5 X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 @- @0 C" `  I; c9 A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 y! B% [/ k/ `* |2 b9 U6 D
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 ]  B" ]3 n' |7 r$ T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! m! ]; m- D  L# {
begin P_induction arriving
- z0 \7 J" R. h    clone 1 load to P_pick(A_induct)
8 n7 b% @7 L; p' J3 H! K; I6 r( W' Eend最大的系
7 _; p% r+ C' O: J
& ]/ @  `4 f0 `1 v6 Vbegin P_pick arriving
8 W+ Y" _7 T3 Z/ n: O# g    set A_i to procindex * 10 + 1
; A4 X1 m% V( O& ^; f    move into Q_induct(procindex)7 d) Z" F" w  x6 W  R" j2 W1 F
    move into pickaisle.induct(procindex)) S) m! M1 ?  s3 s2 v0 o: @$ l- C
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 j/ F; b% @7 f5 w
# c0 j! w7 y. L& q$ B( _    while A_i<=30 do begin
9 f8 q( I$ T  I6 P8 \# q3 _) W        travel to pickaisle.con(A_i)- Z( d3 x/ s+ h/ p; K0 C# f9 s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; p' w' }( K# M- A: [        else wait for 10 sec; L! {$ y" e' M% {& h  W+ ~" L
        if A_i=A_leave then send to die3 z9 B! V8 i1 o7 o
        else inc A_i by 1: U! o8 \  }3 @. U
    end( n7 [$ o1 j: `: P( P  _
end9 g4 o' \9 C1 w0 g: ?$ l( R  l
+ J2 H0 O8 {2 G0 n) y1 J& d
其中的procindex为整形,代表当前process的序号。% U' E, M. }' a8 Z  V
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-5-14 02:27 , Processed in 0.014932 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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