设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13325|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ A* x9 d6 {5 ?) E) D/ {% {  P0 f
2 A. \& K( {2 e1 p$ d我的问题是,在每个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 l+ R! ~  ^3 B! w) b
1 M! I- \9 ]+ Z/ C7 I) n" Gbegin P_read arriving  `! h" h5 a3 f" L5 D9 o
    while 1=1 do begin" ~0 I3 w3 D/ D5 a! s0 |
        read A_tote from "data.txt" with delimiter "\n") h; R" S; _0 v0 L4 ?* a
        read A_time from "data.txt" with delimiter "\n"
. o% Z7 V7 G, Q! r        read A_leave from "data.txt" with delimiter "\n"9 l, S- [  J* P3 B% k; K
        read A_picks from "data.txt" with delimiter "\n"
2 Q: C/ U3 A9 t7 l2 y* G0 Q        set load type to A_tote
0 s$ ]' _' f" Z# m6 K! f        if A_tote="tote 1" then set A_induct to 19 [' z" p% \' Y- L
        else if A_tote="tote 2" then set A_induct to 2: {! Y" E: Q! l. C
            else set A_induct to 3   
+ Q( J0 U4 v. N6 E5 a        set A_i to 0
5 u& g1 x9 T& C: R) y0 q        clone 1 load to P_induction' I. n" G! Y2 S! g
        wait for A_time sec
+ W# C& J4 w* S- p% h% ?    end
3 P  @1 T- ^7 }end& x6 o3 P( N  L, L* F- Q9 {7 l
  Z3 E" b) G5 l" e" Z- X" y
begin P_induction arriving
& K: o& p3 T! B* z+ }$ \) `/ B" j    if A_induct=1 then clone 1 load to P_pick1
& h6 c  L' z$ L$ w. R% r: \5 `    else if A_induct=2 then clone 1 load to P_pick2
: E* P# w" Y+ {* f4 `, ]" o        else clone 1 load to P_pick3, g% o5 x3 _& o
end$ i/ N8 [2 Z& A2 f4 Z

, {6 k* A/ t; U& B+ `1 Y; wbegin P_pick1 arriving
0 A4 I$ u5 b! Z: i8 B" [7 L$ w    set A_i to 1) a  h: R; q! t& t% I* x  r
    move into Q_induct1+ w; G3 [; C: a* n
    move into pickaisle.induct1
# @  L' B& B1 U0 u8 j7 _    while A_i<=30 do begin/ ]5 O5 v' `0 e& p
        travel to pickaisle.con(A_i)4 ]6 r) s9 L  c0 s& g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! N0 p# L* x# o- f        else wait for 10 sec3 i- D: {) E6 Z7 _  d. n. o
        if A_i=A_leave then send to die9 h: G. t2 B& q. w% e3 I8 h
        else inc A_i by 1( u9 b( v- H! M
    end
' Z; a- {5 R" p6 G( g4 @$ dend
& p5 L1 s" L$ m1 q
! G' j; ?* m" F8 ^& |+ Xbegin P_pick2 arriving
+ Y! C8 P8 R9 K* o/ a5 b    set A_i to 11/ Q6 n$ X4 B2 v9 v2 {5 x0 G
    move into Q_induct2
; I; z( I3 R# C/ u! a8 e& ~    move into pickaisle.induct27 y! r- L. Z- V; I
    while A_i<=30 do begin
! ]# _$ F9 }& C4 v# Y) D! Z/ Q        travel to pickaisle.con(A_i)
1 j1 F- D  Q* J, r1 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" ]' J- H8 ]* ]  g. |        else wait for 10 sec9 b$ [% P0 i; a. r
        if A_i=A_leave then send to die6 ~6 H# o2 A6 x2 U$ u* j& E- G
        else inc A_i by 1
9 [3 x; T  C( y8 Q0 X    end
: f# \  K9 Z7 W- \end% Z9 Y9 s* W7 ~# T- w2 L" [, J& F8 m

- [3 L7 H. v! }+ ?/ Obegin P_pick3 arriving
# |- p& H% Z0 C; {  Q+ T3 i# X1 M% T    set A_i to 21
6 E# i' o# T5 T! X- V    move into Q_induct3
* T$ E/ ^3 A. v8 C. D$ f( {1 ]    move into pickaisle.induct3* J. d: {+ O6 l0 W5 o$ D
    while A_i<=30 do begin
! q+ i0 l8 j1 `8 w: H- R        travel to pickaisle.con(A_i)% b+ J5 Z" Z3 E( Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! W2 w! A9 b- U
        else wait for 10 sec
/ j- d. j/ q, L0 K* J, N        if A_i=A_leave then send to die! p- y7 Y8 v% f/ z' [7 ~+ i( X
        else inc A_i by 1/ I' f! ]9 x+ x2 m0 e. q5 v4 Y4 L6 [
    end
$ Y) k) l; Q4 ~) Y, t# W! k* n: @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是个什么东东?
& n# x" m+ s1 P' U0 j7 X4 F0 n5 m7 ~move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' ^5 b2 W# d1 T. {' k0 \+ k$ d; g# J9 B6 V2 Z+ b
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ a1 V2 d2 J- V( U. G6 L4 d8 b% I# [+ S, M! h# m( ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) F5 s# i4 i# X/ E2 w7 N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* M0 Y8 V& [4 c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. ^" u# c+ q# W% N/ C9 }$ H6 a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! \1 I: W8 m( r: |( @2 \; n' k- Dbegin P_induction arriving
; q/ y3 S$ }4 Q& _3 K    clone 1 load to P_pick(A_induct)
# e* Z; [, l1 A" m+ ^- A% Kend最大的系
  x1 ?* I$ Z  \* P# R$ }( y! g0 }# S) ?4 s5 L) ]
begin P_pick arriving
; C+ u6 ]; B0 E0 S# _9 k    set A_i to procindex * 10 + 1% S8 P0 a' e9 a4 M
    move into Q_induct(procindex)& ?6 ^1 [! X. K, }1 R
    move into pickaisle.induct(procindex)
6 j# r4 Y& Q! x( e4 B/ Q    /*check the type of pickaisle.induct(i), for your last problem.*/
+ \& D# V0 U% z' ]$ Q  N* a  A  r- a( d7 `, }
    while A_i<=30 do begin
, |8 d( w5 ~6 e  s  P# ?6 j        travel to pickaisle.con(A_i)
) ]4 \' |& i# x* s9 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 ?6 \: i6 @! I; @/ }+ q
        else wait for 10 sec
- ]7 b2 x& Z# m$ E: \1 y        if A_i=A_leave then send to die$ G- z; H$ ?7 c: ?
        else inc A_i by 14 ^0 h( k* D0 y
    end& C1 N2 x$ O+ C6 K& u% L
end! F7 H0 A( w3 X! p

) R* Y$ Y' c( W' G! F7 e其中的procindex为整形,代表当前process的序号。
/ E: g& _; Z0 x" H  F4 `, f" ]* G: ustation和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-4-4 08:52 , Processed in 0.020807 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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