设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15525|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# x2 v1 F- H. J/ V( b$ ]9 E, U

8 D* |9 F  r. `/ L6 f6 T0 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中的数值,不知道会不会有什么不妥。
1 a6 y9 W' b1 s, w1 y7 N6 G$ J, P: s1 P% Y* X+ U+ z% p
begin P_read arriving9 s9 K% F; w7 [  Z. a) T0 c
    while 1=1 do begin. c' S1 s1 @  p% @# P( y' U
        read A_tote from "data.txt" with delimiter "\n"
. L9 ~" P3 A) D, |        read A_time from "data.txt" with delimiter "\n"+ u* {+ `8 s: U' {
        read A_leave from "data.txt" with delimiter "\n"
  p# P. @6 d$ |/ i7 p# d/ P        read A_picks from "data.txt" with delimiter "\n"/ b/ `4 P, _9 V; B$ ^  T" P/ g
        set load type to A_tote$ C2 z% s! _, k' ~2 e7 j
        if A_tote="tote 1" then set A_induct to 1
: |& g4 K+ ~% N, _. A0 ^& J        else if A_tote="tote 2" then set A_induct to 2# e' B3 V7 J0 l6 S. U( T( K
            else set A_induct to 3    ( I2 K! W: Y8 `& C, j; y- f1 `8 k5 Q
        set A_i to 0
# m, e, W  o8 p, |4 n        clone 1 load to P_induction& b% O9 \, Y' H4 ~* T) }
        wait for A_time sec  Y' v/ y. V. Z) d# B6 e; G
    end, n- q1 x8 q; ^3 |5 y2 |  N
end
/ L5 ?1 ?) l7 n+ E1 d) j, l: I' N# b
begin P_induction arriving
" b- o/ N9 Y% @" U; d, a    if A_induct=1 then clone 1 load to P_pick16 E9 j  V5 r% L. T! y- T
    else if A_induct=2 then clone 1 load to P_pick2* m4 t% ]8 F3 Z1 C) c0 t, ]4 k
        else clone 1 load to P_pick32 b$ R$ `. T* E* z
end
3 `* F( K0 |: c" [. R: R/ P
( u; g9 |, F8 O  Q5 n$ L% P+ W# gbegin P_pick1 arriving
9 h- I3 g. ~' \& c5 L# m    set A_i to 1
& y) E! ^: ]  G* V  O" t5 O$ m    move into Q_induct1* W2 i$ m/ ^4 Z6 l# P" }
    move into pickaisle.induct1
- H2 @5 J" d8 K6 ?' @2 |) G    while A_i<=30 do begin
# i5 ]. H3 o  i5 P        travel to pickaisle.con(A_i)' {. x; n# }& x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V  m5 z; u9 l7 M! X& }        else wait for 10 sec+ J" K5 P2 N9 N- U0 g! q. ]. o$ r
        if A_i=A_leave then send to die
9 K. w, {, ~2 Z( ~0 O. U( ]        else inc A_i by 18 y$ Z0 Q6 t& u8 ^
    end
) E! J5 f* J1 Q8 @* w: H" }end
  s5 u! R% C& b# h2 n* w/ E! J8 n1 ]
begin P_pick2 arriving
9 P, I& U7 h9 _- ^    set A_i to 118 {7 N$ Z9 v, l& }& }2 }* ]3 s" f
    move into Q_induct2
; s4 }) ~- z8 N9 ]! c2 m    move into pickaisle.induct25 r5 u3 l4 h- B  p6 q4 U
    while A_i<=30 do begin
0 _2 q, f8 a! z        travel to pickaisle.con(A_i)5 u1 Q! f: P8 _3 b/ C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( |+ B- f% \' Z' i2 z0 ^4 H
        else wait for 10 sec3 R5 X6 Y  }4 G4 t
        if A_i=A_leave then send to die* i3 T4 C6 i/ D4 [1 F/ p
        else inc A_i by 1" T" j; y0 k# B: f. U( X
    end
+ \" |/ h3 k% ]8 W3 {# R" ]% K" Oend; H  o2 ]; v1 _/ v1 F$ m( m$ O
' L5 N1 L( ~$ r" Y5 t/ C$ I8 O; b  W) o
begin P_pick3 arriving& P$ w+ A( Z- g
    set A_i to 21
1 {2 M( f3 X! Q% c& f/ s    move into Q_induct3
4 ~8 l" C( q& G: v1 d5 z    move into pickaisle.induct3; _0 j$ y* R: s1 [$ y% p, p
    while A_i<=30 do begin
6 r3 Y  v6 q- h2 F$ Z( x9 X, ^; \        travel to pickaisle.con(A_i)
+ L& p; h1 ?3 r8 v# o& [0 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! M' i" b* B/ t- r        else wait for 10 sec
1 U9 u, j$ I$ U& D' n6 X, N6 Z; H. D        if A_i=A_leave then send to die. X/ B6 U* e4 r. n
        else inc A_i by 1
6 V  j* m0 ^! A    end: r6 \2 w8 i3 R' Y( {- F7 P9 r7 V" |
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是个什么东东?% `! }2 l3 G+ Z5 f* g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% o. o$ `- S, K# ]+ V1 \
: I# L. H4 e" z9 f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: L! l) T8 n  \% t5 q
! ?' b4 U, M& k4 ~& a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, O; J4 R3 w/ X3 h9 ?' S
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( U: ^: `1 o  Y: S3 C2 h$ `% {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) m! B2 {6 |% h1 \- m; `4 Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ f9 v$ ]% w( q# dbegin P_induction arriving
; N  l, G; ~7 y6 r4 V; Q' N    clone 1 load to P_pick(A_induct)
1 K. j) r! p: I, I9 i# kend最大的系  b3 s$ D! }) Y# \/ H, q% g
" e0 }( m5 x: o# W( y# S' J
begin P_pick arriving6 u( d  Z! d8 q: V' ^6 w
    set A_i to procindex * 10 + 1+ C- Z$ A; [- H' x! r5 n& ~
    move into Q_induct(procindex)
# b) o$ y8 a# {    move into pickaisle.induct(procindex)
7 O: S# y4 Y% ^# {: {$ U    /*check the type of pickaisle.induct(i), for your last problem.*/  }3 O! `! m! ?4 i9 L
' [0 T- A4 V3 ~6 g' I0 S
    while A_i<=30 do begin
6 _$ q9 C6 ~0 M/ x) J        travel to pickaisle.con(A_i)
: H& X; x1 V% q% i( Q: L9 l- @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 _- x" }! r2 A" X- C: U$ D4 Y; d
        else wait for 10 sec
! E- b& {: x1 P, D  r- w# F9 y! D: T$ [        if A_i=A_leave then send to die
4 x& N" l5 ^7 t5 J; f        else inc A_i by 1
" J( {$ m# g7 }6 y& D    end
6 ?3 g, v+ }, W. e$ oend, {$ k& P9 Z. S" f, R% {

1 R# m9 w) ^+ R* T' y其中的procindex为整形,代表当前process的序号。
5 m1 X- N( ^/ W/ H$ Rstation和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-9-17 13:57 , Processed in 0.019790 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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