设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13229|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. h$ w! E9 K; m  l, E4 O0 e8 \
* L1 g) h9 O) l$ o6 D% 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中的数值,不知道会不会有什么不妥。
$ L/ G& j; C& T! L  M; s% `* M9 {
1 S6 Y4 x, D, jbegin P_read arriving
6 }! y' z  X0 C7 e. Z1 `6 v/ h    while 1=1 do begin
0 V6 I, n  L2 _5 `) ]# N0 K        read A_tote from "data.txt" with delimiter "\n"
6 d7 r. }! j0 m( {& ?$ b6 A  s. R        read A_time from "data.txt" with delimiter "\n"
. g8 y6 h* }9 o/ ]) l! d7 a) f* X        read A_leave from "data.txt" with delimiter "\n"
* b, c6 d3 F. c" n% C; T7 k        read A_picks from "data.txt" with delimiter "\n"
8 z  U: l3 o' E1 b$ y- ^9 M3 b        set load type to A_tote, I) d5 d! j* x
        if A_tote="tote 1" then set A_induct to 1( I* {* ]+ f* H$ t+ y7 s
        else if A_tote="tote 2" then set A_induct to 2
1 G, P% z- w2 C/ h$ q, l! ]            else set A_induct to 3    ) c8 K0 O+ C! @8 K; Z
        set A_i to 02 U. |/ }. V5 {: b6 W; d
        clone 1 load to P_induction
3 W# T4 N, c/ ~3 e( x. t5 ?6 p1 s        wait for A_time sec! e' r% y' k- X7 u, [# O
    end5 b3 T# W% _; Z
end: K, f' L" i' d% X
" N0 v9 k- x* A. |8 r  {
begin P_induction arriving9 A: Q6 P" X4 X/ N! ~
    if A_induct=1 then clone 1 load to P_pick1
6 V0 X5 e# y- T& c. k/ V    else if A_induct=2 then clone 1 load to P_pick2" J2 {) C! s7 ]! X/ A: s$ }
        else clone 1 load to P_pick3) \# C0 ^9 @9 |: _# p# c7 U
end
! F5 l% ~6 \. D" x3 r: L
4 Y  P' i" S+ F6 c8 b$ l+ j2 xbegin P_pick1 arriving
7 p- v: U# @) h- D    set A_i to 1$ j) z/ h8 v6 T# W) \& f
    move into Q_induct1
, g" {+ Y1 O; G    move into pickaisle.induct1
; ?( M% n& Y( f9 e3 X1 Q( M$ y$ A    while A_i<=30 do begin7 G% G4 l9 r; M4 g+ ?
        travel to pickaisle.con(A_i)
7 {8 m8 e7 v9 ?0 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 g' b  q! M! J$ x" I
        else wait for 10 sec
& P& O; ]+ g! K" Y        if A_i=A_leave then send to die
$ G. Z( f0 b) A# W& U; B( Q9 ~        else inc A_i by 1
6 z: `' w3 a' }* j    end9 g* D; f( k/ ^8 \
end# Y+ t1 o+ Q% `1 R
2 d/ u+ `/ O* `5 B' [. ?. D, Q
begin P_pick2 arriving
& O5 P7 \3 N- F. {( }0 W5 S    set A_i to 111 K) d# X: }" ~2 O1 H
    move into Q_induct2
. C$ H: L% ?& m    move into pickaisle.induct2) m4 o% ]8 O9 u9 ~! c+ \+ I
    while A_i<=30 do begin0 S% i" p5 N5 {
        travel to pickaisle.con(A_i)3 F# d7 Z; o  p  C9 C1 Q1 G* _4 ]0 e- a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 v* e# P7 a0 D9 M' m
        else wait for 10 sec
3 H- r- K6 x& M- C' f        if A_i=A_leave then send to die
1 C5 s* Q( V# Z        else inc A_i by 1
4 {  b  `; c5 j+ Z1 O3 R* Y6 g5 z# {    end
. d2 a' A2 d" H; X1 ^" \end
" M8 K5 T  P2 ?9 O- p2 y8 M" W/ h' p- t
begin P_pick3 arriving
2 T+ n7 ]8 r1 q" l6 m" U    set A_i to 21: g" o  O2 M6 i
    move into Q_induct3
6 A0 l% {& ~! m, j, V4 C7 }/ i* `    move into pickaisle.induct37 r: s5 T7 J3 @0 W8 ^
    while A_i<=30 do begin! F. N# w! v  ?: N+ g: b! j
        travel to pickaisle.con(A_i)+ H, f8 k6 ]" j9 Y  E/ g, x2 h9 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& s% ^) ~. U& s& F/ j        else wait for 10 sec: [! l6 ], k1 u
        if A_i=A_leave then send to die
) v( l1 G+ U" ]9 [) ~3 u        else inc A_i by 1
7 C: o0 [: S1 T# I7 v9 D; g    end
7 I2 w! U4 @4 `7 i: g. c, D% q* Q+ `% }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是个什么东东?
/ u0 @. u4 t/ p! Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- D$ O- T1 U  L- ?' b. p. J, e+ ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) {; X+ r- L; a: K' _5 ?3 `4 u9 X! s" ~
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 ^% ]9 ^1 }4 P* t! Q" |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) a- u" N1 S0 p/ I- M7 H; K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! s! x* L. p* v$ R0 k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 e8 e8 _' G- B0 K8 ]6 w/ l
begin P_induction arriving4 J. ]9 i5 y8 j6 d
    clone 1 load to P_pick(A_induct)# X* P/ k5 c+ a& `0 z+ q5 W
end最大的系" T8 o6 |( R# L4 r$ Q

+ S' f6 ?, Z; n, V  n! B7 Hbegin P_pick arriving
. H. I- j* H" z/ ?# j, |    set A_i to procindex * 10 + 1  i% {& A, Q6 z/ y' l
    move into Q_induct(procindex)
2 F4 e' N+ [2 v% e( T, s2 s0 E9 T! S    move into pickaisle.induct(procindex)
  l/ d# o; }7 @+ x$ N    /*check the type of pickaisle.induct(i), for your last problem.*/' N) `& Q* b% a( r* T* q. P

) [9 }( E; s/ B4 z1 k: P6 r    while A_i<=30 do begin
, _2 r! ~0 y% w+ a: Z        travel to pickaisle.con(A_i)% q, j2 }+ C& H& V% p9 A: D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 q3 ^' h3 L* z4 t7 P
        else wait for 10 sec7 W3 S0 X2 W% z
        if A_i=A_leave then send to die7 b: |  Z* g& E! w1 H7 z7 c) `
        else inc A_i by 1; C! f% @" y$ K, [4 ^
    end
  |0 P# o1 s3 kend
: i* ^( i) [0 O. z  C. S6 t6 A1 D. I1 G4 n+ B5 z6 r8 G* Z9 d
其中的procindex为整形,代表当前process的序号。
5 Y2 D' C! g& {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-3-28 18:16 , Processed in 0.020037 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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