设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9905|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 u6 B& O& ^* D/ o: _* i$ v

; S2 L9 b" n; l0 n3 p我的问题是,在每个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中的数值,不知道会不会有什么不妥。% x1 @$ G; y- @; N6 C. M

" N6 V5 I  `, W& ?begin P_read arriving
. h3 w' I6 l# ~+ F, j' K  R) {    while 1=1 do begin
- m1 d+ ~  P' N% d$ V        read A_tote from "data.txt" with delimiter "\n"( \+ _# E# P4 R0 }* o
        read A_time from "data.txt" with delimiter "\n"+ N; r% ?9 j" l! Y) y
        read A_leave from "data.txt" with delimiter "\n"/ _: T# R2 h% {7 F7 z5 W
        read A_picks from "data.txt" with delimiter "\n"4 L" x7 Y; B% w9 q9 M9 D% _
        set load type to A_tote+ V" k" f, m) @+ p! o3 E3 e2 S
        if A_tote="tote 1" then set A_induct to 1* L* ^, O% m3 i+ L
        else if A_tote="tote 2" then set A_induct to 2
: i1 a& t) C. t- y            else set A_induct to 3    3 b7 B9 i4 c0 l5 {2 N. U9 s
        set A_i to 0& T! G+ V! ?/ x3 [
        clone 1 load to P_induction0 X, A- Z1 r% A1 x% t* ^& r
        wait for A_time sec
/ |0 K% o: H; D( O  F9 c    end; f0 M" _* l0 r8 B( K
end
) M# q: _( b* l9 Z# t0 m% D3 x) S+ G  l
begin P_induction arriving
+ t: f; L5 ]9 C$ P) m4 e0 r    if A_induct=1 then clone 1 load to P_pick1, I' Z$ m$ H* `. N3 L: g
    else if A_induct=2 then clone 1 load to P_pick2' J  v( k/ Z1 T- J
        else clone 1 load to P_pick30 D) o3 {8 D+ s+ Q" h
end9 W6 i, ]0 T4 j( P  R" |

9 Y2 n7 h, B9 e% P$ S! n: D) bbegin P_pick1 arriving
2 M$ G6 |, ^1 \+ ~- l! a, w    set A_i to 1! Z% M2 p+ x. s# O7 G
    move into Q_induct1
9 _$ u/ C8 `% }    move into pickaisle.induct1% r* c  m% J( V3 ?( V
    while A_i<=30 do begin9 `  ]( M+ M! H  C/ N
        travel to pickaisle.con(A_i)' C) [9 I" t; k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& c" e. v6 B5 ~) y
        else wait for 10 sec
2 {: Q" r! K6 O+ ^" T1 f        if A_i=A_leave then send to die
* c+ U4 o3 @/ D; S0 d7 n) c        else inc A_i by 1
  t3 G; S1 F' a' E    end
& H* m% _. V! T0 D/ eend
8 N% @1 B0 }. S7 F  u, {* w# \2 k9 l4 n3 e
begin P_pick2 arriving
& Q7 E- r. S6 v  r    set A_i to 11
% p5 z7 H9 D! R0 a6 ?    move into Q_induct2
) _% o' G3 s( d    move into pickaisle.induct2
! a5 d" f# K1 }8 M& k    while A_i<=30 do begin
* n5 W6 r4 M, k3 a% _; L  o        travel to pickaisle.con(A_i)
. S/ y) ]& T) n: ~3 G- i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. f. k+ e/ A, d- v        else wait for 10 sec! N  }4 S1 [" i7 Z
        if A_i=A_leave then send to die
; v+ X8 {) U5 |% w. \, [        else inc A_i by 1
- L, Y) i5 y1 f2 k! G3 ?$ @    end! a+ W* q! Y6 {! R, {$ T+ T
end. @: l: U+ K8 i  }

# H. ?$ D& f9 H9 ubegin P_pick3 arriving
( e- S/ ^* k6 d) ]+ j, Y4 x4 J9 E$ T3 }    set A_i to 21
( I& w: Q" b! W" I    move into Q_induct39 N3 O( S8 r$ z
    move into pickaisle.induct3
1 x4 q7 j3 U7 y4 }    while A_i<=30 do begin
: L. [$ l1 s1 U# S* ~        travel to pickaisle.con(A_i)# ^' B# Y/ U; Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; g: K$ Q1 K: R& x        else wait for 10 sec
  G2 z" R4 Y7 b: D: n0 a. `        if A_i=A_leave then send to die2 `% Q1 X/ i1 T7 T
        else inc A_i by 1
! S$ V- Y  M  ?3 ]3 U" Z. B( f; v    end
" b( \: I0 r1 C' t7 j5 p9 Vend

最佳答案

查看完整内容

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是个什么东东?+ z: y( c; `# T7 t3 J/ ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 S! ^. g0 M9 T2 f3 e

; b$ a3 b2 S+ P* a$ ?1 J1 @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- z" U/ f3 u2 m5 Q4 h$ G' `

% {1 U0 ~, O7 \+ W" {% k+ W$ V另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 F$ c- u: n! _" E3 O7 H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 \/ ^) r' V% I: }. L2 A) {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; k! _1 w2 g8 q9 o! l3 U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" M- _$ C* p5 }: P. tbegin P_induction arriving5 U2 ?' D) D- W' @
    clone 1 load to P_pick(A_induct)
# K5 V$ u. k* _" e7 S: Oend最大的系
- h+ d! Y' v  l# G' T
6 r" B: I$ N, P9 X$ Jbegin P_pick arriving- n7 I1 p: G8 J* F
    set A_i to procindex * 10 + 1
+ O$ f- z# M! n3 E' z- S" z. L7 a    move into Q_induct(procindex)
- D4 K& \2 S9 R+ E& k    move into pickaisle.induct(procindex): b- \; y8 Z( m
    /*check the type of pickaisle.induct(i), for your last problem.*/6 Y! D6 u$ f7 g5 u0 w8 v

( C7 g7 S+ K, p# g    while A_i<=30 do begin5 ?; P4 K" N% J# E
        travel to pickaisle.con(A_i)" m- f+ w) X" E. P2 F' z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ a+ @. {# F) F  x' _* Z1 U
        else wait for 10 sec
! L+ k7 z) Q# j1 u- K$ \* [  Z+ _5 e        if A_i=A_leave then send to die) p7 U" P5 R) \
        else inc A_i by 1
' z5 m/ w5 h8 W    end% C: \2 Q+ K7 S/ ^) z
end
4 l6 P* ]7 ~$ z
7 }% }7 Y/ q2 E5 O4 m% d其中的procindex为整形,代表当前process的序号。' k: t% M& p6 A6 q. V4 P
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-7-16 04:51 , Processed in 0.014382 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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