设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15662|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 z, q9 L" W- b3 x' [2 \7 m
4 Z8 Z- k, T% K, }' C7 j9 ~, W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! c' @0 _) P3 Q* d5 \, h5 t5 w/ h( q! |. n( V. C+ b* w5 N% b
begin P_read arriving. b: O& S. j: {* E
    while 1=1 do begin" M5 s1 H/ I4 E
        read A_tote from "data.txt" with delimiter "\n"
% \4 _0 B- I) h) k5 d/ a' g        read A_time from "data.txt" with delimiter "\n"  f8 e: `  d6 v
        read A_leave from "data.txt" with delimiter "\n"
( E9 E' b* W/ v2 ~4 H        read A_picks from "data.txt" with delimiter "\n"( R* I% s' m/ [- r
        set load type to A_tote, K: W9 t1 f3 J2 {
        if A_tote="tote 1" then set A_induct to 1
% }7 `) P5 r; S1 ^$ v' K: |' ^        else if A_tote="tote 2" then set A_induct to 2( Q7 R. k" `! }0 x* ]
            else set A_induct to 3   
6 |( c- p# ^5 ^/ x1 B        set A_i to 0
; D! x# @4 O5 N( F0 b        clone 1 load to P_induction
. ^; E4 S& h* ]+ \1 z7 b3 n; F        wait for A_time sec7 L; \1 n" S" o6 @
    end( i7 U! {! K4 t/ H$ W
end$ j! H+ y5 U- H% a% m
' d# l7 N) Y: q- a$ L8 |5 \. g2 ^
begin P_induction arriving5 X0 s' R3 ?5 i/ c6 S, q. l
    if A_induct=1 then clone 1 load to P_pick1
7 s* v1 S7 c5 [6 }) ]% j    else if A_induct=2 then clone 1 load to P_pick2% Q; l9 J( S. ~1 K
        else clone 1 load to P_pick3' p0 g* n9 `3 I# J/ X, @
end
3 ^. b" `& I9 F* R  b0 a% [/ d: G; r
begin P_pick1 arriving5 X3 K* ^: W# c
    set A_i to 1$ i$ O% F! [. x
    move into Q_induct12 @; _3 m( N6 J+ ]! s1 u
    move into pickaisle.induct1; I& u! L, F: |+ u4 S# J9 O" A2 A* U
    while A_i<=30 do begin0 W$ j7 g' ~, |- G
        travel to pickaisle.con(A_i); y: P5 C; F1 F/ Z1 G: D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 \& g2 C& E& \7 ?$ M$ [
        else wait for 10 sec$ ]' K1 g2 t6 Y  s
        if A_i=A_leave then send to die- M" u5 G9 X' |: g, z
        else inc A_i by 10 D( L. d3 `/ {( z: ]# [3 E
    end
9 E: D9 m- M$ c2 H0 S' J0 U/ ?& oend/ _1 P9 N* C+ w  c+ {" L

" g) ]& ^- p; Z" E; u, b+ Nbegin P_pick2 arriving( Q, N7 ?$ k; c1 ~5 q
    set A_i to 11
$ \% \1 o! A" |    move into Q_induct2( @. N3 h, _0 a& q
    move into pickaisle.induct28 @8 n( u# ~" |5 ?6 p
    while A_i<=30 do begin1 O6 G" ?7 l0 T
        travel to pickaisle.con(A_i)
$ m1 T& v8 e3 I$ c, C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 O0 R/ n3 r- H" h5 q
        else wait for 10 sec
, g( [, R& c6 J: ]7 R        if A_i=A_leave then send to die
' H$ v4 U: O  [' p6 {        else inc A_i by 1, T3 U4 ~" k% D. o- m
    end
1 Q: Q) C( I0 |end
" u; P" @- D9 v0 Q6 ?# c! ^& j+ Q0 P' i) ?
begin P_pick3 arriving; d2 w0 s* Y4 {3 ]1 ^" z% D
    set A_i to 219 [/ \' {  ~( h8 s
    move into Q_induct3
! J& K( P+ G2 M6 k3 y    move into pickaisle.induct3" `' m2 A2 f6 B8 k' J+ Q1 Z
    while A_i<=30 do begin
0 N: _) l! n" f+ \        travel to pickaisle.con(A_i)" v# }3 L& d7 N8 X9 q$ d: ?- X6 V' |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" H9 U: d7 v& E$ o, G0 q0 R3 H% T
        else wait for 10 sec
' `  y) b8 y  w4 k  Y+ j        if A_i=A_leave then send to die
3 o7 h" @  |1 R, @. z, ~        else inc A_i by 1
# ]/ `. F6 L, G( `! l( Z    end
6 a# \3 c# T. q& ?, Wend

最佳答案

查看完整内容

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是个什么东东?% K9 M2 B7 R. F: K1 J6 U
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 E- E9 q: Q5 o; s
7 T3 v$ D1 b% F# f! j- kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 _# z" o3 y' p- r% k

$ `6 o4 t" K  W5 C' Z  q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' y- H* P; I7 I! X# I$ d+ R) k7 |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. V+ U& ~4 t" g8 n# E6 R- h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  K3 P1 U% n. S4 s  Z, J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 p4 p" [* l: s( s: s9 Lbegin P_induction arriving. F. m! C  d# v5 ?0 j/ v
    clone 1 load to P_pick(A_induct)
+ ]: e9 [5 t1 D6 S6 eend最大的系
% P( G: `* q2 q- T% b# _9 @4 O
7 ~% a( C& [' s4 A: P- `& A, ^begin P_pick arriving
, ?/ z  [2 O) V3 O( S! ~( x    set A_i to procindex * 10 + 1! \  l9 \5 _& E; c$ |
    move into Q_induct(procindex)
/ `/ m0 O0 }9 v' X. {( ^    move into pickaisle.induct(procindex)
9 N4 d; C2 o8 ]  r1 F/ h  S    /*check the type of pickaisle.induct(i), for your last problem.*/
" p. }: a/ j' E$ r$ O4 Z3 h( Y
. J) _) q  v- {* a! f! Y    while A_i<=30 do begin
( T. j. U/ S) X2 a6 @8 f        travel to pickaisle.con(A_i)
2 j8 f0 i4 m7 o' ]2 r  ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 j1 P5 ]- U/ Q4 N( ]0 y& u! \        else wait for 10 sec
; M- j) t6 r* K. g        if A_i=A_leave then send to die. B7 N# Y/ Y3 B9 ^3 R- l
        else inc A_i by 1
, G0 E0 U& P% K  J: v9 Z* t. Z    end
2 t, z# X0 W1 Qend
0 T+ x$ h- m2 j; \' ?% Z8 g/ A& V. a8 G7 J" _
其中的procindex为整形,代表当前process的序号。
* x1 Q* y6 R$ A* P( astation和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-25 06:19 , Processed in 0.016682 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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