设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15124|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; m! n: `: `( \+ n9 q/ X
: H: @8 w' I+ J! |- Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 \2 |" V, w( l& Q% u+ H* }) w* @* m

9 f8 b" Q5 [5 \7 ?begin P_read arriving- ^# n. }. U1 y- n  }9 }
    while 1=1 do begin' }2 L8 D& d- ?# X0 S
        read A_tote from "data.txt" with delimiter "\n"
$ E3 n' C# f* c% C! c- N, R  G        read A_time from "data.txt" with delimiter "\n"
. q" y# U, i" |, Y+ w4 h% ?6 E        read A_leave from "data.txt" with delimiter "\n"
+ n) j+ t6 j! x. z! Q        read A_picks from "data.txt" with delimiter "\n"
" S! I4 |; U4 e5 G% @        set load type to A_tote$ p" D% x5 O/ ]$ O3 \" E- h
        if A_tote="tote 1" then set A_induct to 1
( K. w, U  l+ s9 E) O        else if A_tote="tote 2" then set A_induct to 2
+ @5 g7 ]+ \! `# H/ Z* Y            else set A_induct to 3   
6 ~# B' m! `) W0 n. |        set A_i to 0- \+ o- N  @% \# }
        clone 1 load to P_induction1 T% E  g' K( |! W( J
        wait for A_time sec
# k; }# x/ H+ s+ G7 [6 }7 M% |5 p    end
! w( T8 B9 R* l' |, x6 H' I% pend9 _/ |3 d% o8 U& `$ O5 m

! m/ ^( h" ?" b7 Bbegin P_induction arriving9 T- Q1 Z; q6 M3 i3 w! q
    if A_induct=1 then clone 1 load to P_pick1
$ I, ^9 I" U1 \1 `    else if A_induct=2 then clone 1 load to P_pick2) K# u# V% w5 @' Q6 ~$ }6 a! i
        else clone 1 load to P_pick30 [1 d& ^8 c! W, }2 r8 F% R
end
1 A; V" y8 ?, @$ U3 H* D
, V. C, `$ x9 o- B7 vbegin P_pick1 arriving3 [, N% h. `8 U* f  z( S
    set A_i to 19 F9 C% G9 y# K
    move into Q_induct1
4 X; Y! f) t+ t6 y! {4 D    move into pickaisle.induct1
- D# K7 s  L) v( i    while A_i<=30 do begin
: U* o$ _# Q4 _4 {1 v/ a        travel to pickaisle.con(A_i)
" s3 w% [! X) o# L# T2 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ a2 |- F/ z) o: A' W
        else wait for 10 sec
+ i, W5 Z: f/ w/ l) u3 _" ~        if A_i=A_leave then send to die
- j+ y+ _$ e6 W: p2 M* q        else inc A_i by 10 [: E- v4 k( N: U* y" l6 ^
    end( C, B3 N- t) U7 J6 e7 P' W! Z
end1 O! S. @/ [0 o. ~* R4 ?

2 v9 ?' V4 G) fbegin P_pick2 arriving
3 H  l8 x$ G! n2 O$ W3 @    set A_i to 11
$ ^" N1 _9 P6 L& u    move into Q_induct2/ U# I4 O! m, @( R) ?4 \- `
    move into pickaisle.induct2  V- w, q( N2 q( Z% |
    while A_i<=30 do begin8 ~0 U& ]8 X, r& z- N
        travel to pickaisle.con(A_i)
" ?, I' H' ?7 b/ U  b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* w/ p( l) r) L  r* C% [
        else wait for 10 sec
& I5 |: f) v# v) A0 A" k: X        if A_i=A_leave then send to die
$ ^! G% h4 _$ j  O* ~        else inc A_i by 1' v- w- Y6 t( T( V6 ~6 m/ Y0 e, a
    end
( Y! u. @3 j8 J  R0 W) t. oend$ G- S. J; O4 p- q: J$ L

' c5 V# o3 J" ~3 dbegin P_pick3 arriving
  A1 d3 Q+ s5 q, o. t    set A_i to 21* B( C" k' J4 v$ E. X* o" {6 k
    move into Q_induct30 o; |2 I( n+ {" W% J: p
    move into pickaisle.induct3
3 {+ B1 m6 @/ D8 i    while A_i<=30 do begin0 C7 _  @1 a6 |/ i& u/ R
        travel to pickaisle.con(A_i)5 s; s! M& i6 l* j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M' S3 v! q. ~' `        else wait for 10 sec  O$ G  z3 o  h( H: [
        if A_i=A_leave then send to die
* V& S& y% ~5 v/ B2 N" s, b1 S        else inc A_i by 15 M6 E0 ^6 A+ e- n' u: t; \
    end3 E* F. j0 l5 A( _
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是个什么东东?
$ _' z0 t! n1 Q6 e+ A  J1 O$ Wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- h1 e9 B0 ^8 ^/ f' ]% e' N, K" K
9 q1 Q+ d4 c0 l3 x) k5 u  G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; F: e8 ^) Q8 V1 O' Y; b# |

0 I% T/ a6 J- D0 E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: J* _- _6 g4 q! I/ e9 f3 `; z6 o
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; j8 d; Y, N" \( r7 _( s3 x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, B3 w, E* B0 K4 K" k8 X0 H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! }6 d  i( P' ~; D: ?5 j2 A1 }1 L
begin P_induction arriving
4 g+ A( |8 Q6 @    clone 1 load to P_pick(A_induct)
& R# Y0 J0 h) _! cend最大的系% C. Y# z1 q1 c1 b
9 v1 x7 R' J0 S
begin P_pick arriving% G. y% E" O1 m  b9 B& H- X
    set A_i to procindex * 10 + 1
3 T3 y7 D6 J, v4 O8 A6 l1 S    move into Q_induct(procindex)# X' f; ~1 l& o! ^, f" E
    move into pickaisle.induct(procindex)
$ `3 D* \9 m: H0 F* Z    /*check the type of pickaisle.induct(i), for your last problem.*/( t2 A7 b% ?" b
  Z" Q' |0 I& G4 u
    while A_i<=30 do begin! d0 {3 ~7 c  U9 E3 p8 N) ^4 r
        travel to pickaisle.con(A_i)' x3 H' B' X3 J' u) E3 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. g3 q1 b' ^" n0 u% `9 x        else wait for 10 sec
/ m: M7 C# O2 T# O! i) Y; G        if A_i=A_leave then send to die7 S; g0 t$ P& r1 q, L- ]
        else inc A_i by 1
9 Z, _) I0 P3 A9 v. e6 q    end
4 n0 S9 M/ T) [0 _9 x1 {& c* `end
: K- P. W9 w) H* Y) x2 W0 w5 P, C
其中的procindex为整形,代表当前process的序号。) B# C. l* B" z6 M2 ~
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-8-12 14:40 , Processed in 0.016763 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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