设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13023|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 S: @- c+ a) \! M% j* A  y1 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 W; G/ A: s: F0 s4 x/ f

8 E' ?" {) _. c. ], Z# j) e2 nbegin P_read arriving
6 N4 i8 o% P3 ^; V) \    while 1=1 do begin1 M9 v$ |6 s$ {1 [. D
        read A_tote from "data.txt" with delimiter "\n"
' p2 c* g9 n/ M- D        read A_time from "data.txt" with delimiter "\n"
; C% m) v. Z7 m1 n, F! l5 O        read A_leave from "data.txt" with delimiter "\n"$ h- q0 a6 k! T& S7 F0 R
        read A_picks from "data.txt" with delimiter "\n"# [6 F8 z& t4 _2 }. U" _
        set load type to A_tote
7 t9 L' ]2 }" ?, `        if A_tote="tote 1" then set A_induct to 1
# o+ Z  |2 ?9 J/ v' l3 l        else if A_tote="tote 2" then set A_induct to 2
0 R: Y% M  _! i% w! W/ R            else set A_induct to 3   
; u: ?. I2 j, C. z, v  t" e7 b        set A_i to 0
2 K1 J! c( k- O( M) p4 q& t        clone 1 load to P_induction
, ?1 y) d# J5 M, f& w" b2 f6 j        wait for A_time sec' w. b  {& Q. ~$ @6 ?* n2 X' U
    end) ]. j2 j2 ?0 Z8 N0 ^
end
; j% ]: b3 c+ u8 v2 @
& e( a0 u7 T4 q9 Z1 c) Fbegin P_induction arriving
7 ]9 `# ?4 g4 D9 y' M    if A_induct=1 then clone 1 load to P_pick1: _7 ]/ X4 a5 d8 f
    else if A_induct=2 then clone 1 load to P_pick28 e; o1 z% }! h" G! S3 h7 y
        else clone 1 load to P_pick3
& u! U1 f! C- i9 a* e: E5 vend
5 V4 Y  I" J: R% t# K1 Q" m/ t* b) B- p: b. I
begin P_pick1 arriving
/ d, C/ K- ~+ a: a, P    set A_i to 1* U4 T0 `6 h$ ^7 ~8 Y( A' D. s! ~8 |
    move into Q_induct1
! c, h+ G- W+ n5 u    move into pickaisle.induct1
& t  L& w& I( @) y# f    while A_i<=30 do begin5 ~+ }+ c" f: O3 `! c
        travel to pickaisle.con(A_i)1 ?9 e7 s( K7 Q! R6 j( v4 B5 N! v  U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 F0 q; [; X$ G' O0 h/ A! k+ K
        else wait for 10 sec
! S, P9 M% O) P& t4 t$ \+ G& W        if A_i=A_leave then send to die
6 M2 w. h3 d* a: }        else inc A_i by 1. K( {- {% L$ w, j0 o1 q; V# H
    end; E3 s+ u3 k2 w# j6 s  Q
end2 D2 V* `  H2 c1 C0 E: n# u

# S# A" @0 U/ j" b# {/ Sbegin P_pick2 arriving1 d6 a0 E8 L4 q$ n0 ^9 ]
    set A_i to 11
' N7 K5 j1 g4 h2 R! K    move into Q_induct2* Z! y# g6 U2 J" N) _
    move into pickaisle.induct2& y# W, F8 q  ]' P* {  V% s
    while A_i<=30 do begin: R6 d- j0 D# U- l3 n
        travel to pickaisle.con(A_i)# I) U& h, O: W9 W+ X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 C/ |2 A9 O1 B  t" Y) [9 G* M
        else wait for 10 sec
; [+ l& h- E. e$ Q/ E& }+ z        if A_i=A_leave then send to die
, N" e/ I$ d- h# T5 h' d% k        else inc A_i by 1
' `1 c8 ?$ @' C: u6 f    end% Z( u2 y5 k4 K) t' U$ i
end
" n3 W! K- V. n- j
6 l% l  U$ R+ c; g# z5 p; _- n. e3 Ebegin P_pick3 arriving
0 |  e: ^% E% r! D/ m    set A_i to 21
, H9 S: P+ V6 ]! Z) u    move into Q_induct3
0 f$ B9 f% q2 u# T    move into pickaisle.induct37 L- c, o* i+ v% ]4 |- c: t
    while A_i<=30 do begin
) d+ }& I( w  t  K        travel to pickaisle.con(A_i)
0 w, m+ g' R! `$ k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 u( w9 I+ g' H$ @1 @
        else wait for 10 sec- R1 M- L6 |  Q* v2 f. [
        if A_i=A_leave then send to die: @% U% g- P/ K8 |
        else inc A_i by 1' N, I$ }: H# P( s
    end
; c3 H9 o. D" H9 U! n8 q/ }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是个什么东东?
$ s) w) K8 @9 h4 n4 Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, \; H* Z0 r' |' b) ~& _  I

! \4 B# s$ y  TAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- G( i) q, ^5 }. z) M' t
. ]9 D1 `( \' O& t; }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ k- Z8 k" p6 F- ^
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 x- z% t8 X+ Y( E7 b; q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# a1 w0 Q9 |9 v, n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 l# A  e+ I/ Z0 lbegin P_induction arriving' q" j5 g8 U% g! F
    clone 1 load to P_pick(A_induct)! X) ], ?( P1 v, a
end最大的系2 x) R# \3 Y/ N3 K! y  @

4 T8 D& h) q- N: \2 cbegin P_pick arriving
+ B! e( z0 F8 o    set A_i to procindex * 10 + 1
& ]" N' E# l; l( @; v: W; p! N    move into Q_induct(procindex): Q1 u+ D) Z  ^; U5 I4 ^
    move into pickaisle.induct(procindex)
  b5 [  L3 c+ g& m+ ~    /*check the type of pickaisle.induct(i), for your last problem.*/
) L' D8 T6 @9 k2 T& G% N& o4 R# n% r
    while A_i<=30 do begin
5 d  G! b% W; E  a) q; _        travel to pickaisle.con(A_i)  o% w0 G: m( {  L& A) S, n, P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& j8 N5 t& @- |( \/ F  G        else wait for 10 sec
3 N6 `! I! }4 A. O+ Y        if A_i=A_leave then send to die
8 T* x$ D3 Q" [        else inc A_i by 1
5 |1 o4 w& W/ i    end
6 z9 x3 I4 w# g; I4 Kend
" O, C# c1 |7 C  y  k
$ I/ E$ a  m( ]2 h5 z其中的procindex为整形,代表当前process的序号。
7 C( m& q- D6 ?  e9 bstation和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-3-11 18:36 , Processed in 0.019156 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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