设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14136|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. h- k0 R, s& x' h( t
0 Q2 n( }5 F" Z0 i3 i" S/ _  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中的数值,不知道会不会有什么不妥。/ x: [/ h" g% j# p& Z
$ }* H* `- }- b) |0 c- W3 U
begin P_read arriving
& H5 O( [$ p" S1 w$ S3 u) o) N    while 1=1 do begin
  M9 E% Z! l  n0 c- z        read A_tote from "data.txt" with delimiter "\n"0 n$ [8 L1 Y8 Z0 M/ o4 \& K
        read A_time from "data.txt" with delimiter "\n"- ^2 c. J1 Z1 k" Y* I
        read A_leave from "data.txt" with delimiter "\n"
  }: `8 `! Z3 K4 q* r! Y        read A_picks from "data.txt" with delimiter "\n"- F- P; N8 [# B0 ]
        set load type to A_tote
: B' {; H( |* ~/ z( Z        if A_tote="tote 1" then set A_induct to 1$ }9 e4 K( H" M: w3 |# N! e
        else if A_tote="tote 2" then set A_induct to 2
- {/ D5 e" J  V9 P5 e8 W            else set A_induct to 3   
8 C7 s# F, Z& f% }# u; R9 o5 E0 s        set A_i to 0
+ E6 l9 e$ p* D$ u- n6 A& N        clone 1 load to P_induction
! q+ I+ _" }" l) N; i' Q' t        wait for A_time sec
. X' _, A- _# I7 U    end
8 T1 G( X" {- e5 k+ q% iend
: P" S1 p+ X6 S8 i$ G
0 J8 e* d% x* p8 A6 a# M4 C0 nbegin P_induction arriving) m7 I7 g2 k, S
    if A_induct=1 then clone 1 load to P_pick1
% v8 m( f) `* r; _! k6 Y- n    else if A_induct=2 then clone 1 load to P_pick23 C9 \6 _) V9 L5 `
        else clone 1 load to P_pick3, M3 q- e5 ^/ ^: G# e. k
end  S7 f: K, |5 X1 {+ P

- S) P8 D: L( I3 F$ S; ~begin P_pick1 arriving
" M  a  t8 S! |; a: N    set A_i to 1
9 d  Q# P" |. P    move into Q_induct1/ H" \6 o( r" y) g& }4 e
    move into pickaisle.induct1
. p2 h( D+ T8 z/ ~    while A_i<=30 do begin
  K% z3 w" C5 L$ j1 q* b8 i        travel to pickaisle.con(A_i)
- g7 v" f1 |0 m# v7 t! t; U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 g) p$ L+ W# S( s1 K$ v( g
        else wait for 10 sec  I7 l+ i: H+ L0 c% {. R, ^. S) u  m
        if A_i=A_leave then send to die5 V) _& Y3 u* A: @' w4 V3 m
        else inc A_i by 1
' ^5 L: }1 w" K+ H% a    end! N0 E% Z2 o. h0 `% X/ E
end# z" L4 B# [. b" l8 L

  s! i, j' m0 C8 ?9 n% k& Tbegin P_pick2 arriving
# v. h5 f' w8 J" ]5 E( }2 p    set A_i to 11
& M- [" T& h8 b' c: C; }! }4 y    move into Q_induct23 Y3 P+ [8 _7 F5 N2 R
    move into pickaisle.induct2
, p* B- i' g8 i2 D' l    while A_i<=30 do begin
9 `8 F- o9 ?6 z+ M' Y        travel to pickaisle.con(A_i)
3 s3 T( N: H! T4 |3 e/ }0 A9 d% j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 z0 ?& ?3 {0 i( ~" [; k4 X* |
        else wait for 10 sec5 E( {; f1 i9 |7 z
        if A_i=A_leave then send to die2 n+ }+ z. U  ~  q; t0 t3 v6 }
        else inc A_i by 1
4 G' ]/ z! |( u. e. t/ l6 J/ A    end
/ Y1 ~7 C$ ^8 G" [  h8 f3 |$ pend: h2 [; _' A5 q

3 q: _1 y/ K' B7 Nbegin P_pick3 arriving  @; k, D8 x! t2 @4 n9 u
    set A_i to 21, _% L5 M7 ~* f: w
    move into Q_induct3
. I( H* I9 X4 [7 R- R5 N1 F    move into pickaisle.induct3
. c, m1 A( B  P4 k. U    while A_i<=30 do begin9 q* y+ L& B  ^! N2 }
        travel to pickaisle.con(A_i)7 I. C* v9 I$ ~7 z) U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! D& [- G5 N+ M; O, c. y; S% }8 _        else wait for 10 sec2 ~" B# z0 \& l! l
        if A_i=A_leave then send to die
2 [7 S$ x2 D8 j3 l1 ?& G        else inc A_i by 1% F0 E$ W" F/ D
    end# B6 w# ?" u4 U7 o$ g9 j( ]5 w$ |
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是个什么东东?% ^) n8 C2 m: ^8 H: L8 j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 T9 d% A; O. w3 }
+ k7 ?  v3 t, C7 G4 u5 k  D1 J* pAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 K* Z7 p* i; K0 d# v# e' [% h1 ~4 e0 D
: x- b# y& P8 m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 P/ x+ X8 s6 \8 S) c5 {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ @. a: W4 p7 |' X3 `) J7 o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 j1 Z, Z! A4 S; p9 b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 B( t1 R# \" r9 K  c$ d! r
begin P_induction arriving
& e: P9 D. B5 C4 s% x, h3 V0 Q8 V3 F    clone 1 load to P_pick(A_induct)
7 b' @% F; E% J/ xend最大的系% |5 _6 g7 H8 r" l

* D. K: v- t, Hbegin P_pick arriving0 P1 x. d/ m! P% ]
    set A_i to procindex * 10 + 1
) H) Z5 M' p4 W7 C, Z    move into Q_induct(procindex)7 w. k9 A+ v0 E
    move into pickaisle.induct(procindex)
" r3 L2 Y/ m1 E* U2 s' w    /*check the type of pickaisle.induct(i), for your last problem.*/. x" [7 ?' h* _0 n

. @  [1 n- L$ G  E4 A    while A_i<=30 do begin8 M# C! e7 {( j  ]7 ^3 J3 R2 _
        travel to pickaisle.con(A_i)$ e. M0 q) {; x3 r$ W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! }. M( g6 f  q+ ]+ V        else wait for 10 sec
+ _0 N6 z% A; p2 X+ P1 T) n+ c        if A_i=A_leave then send to die
& S7 }+ P7 ?+ I  z7 N8 s. G* W        else inc A_i by 1, v4 U  J) ]' l, ^) K- l
    end
8 N. V% q& a/ w' p& p3 _3 d: Rend* ~' _1 j4 s. [1 S! h( g! t

$ Z7 R5 v( `. T3 U& c/ d, v其中的procindex为整形,代表当前process的序号。: }# ~8 S5 d1 ?. J6 V; |0 b
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-6-12 15:19 , Processed in 0.013934 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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