设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13955|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 @! L- S% }8 Y0 u  W) \9 b. ^2 X) O- T2 _; }0 z* [5 J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 Y' e) S, C9 Z2 @4 D* y% g1 A# @, n5 A
( L& k2 d6 K8 r0 p6 ?
begin P_read arriving
7 a0 T8 y/ O- U3 H* g: |    while 1=1 do begin2 ~, z5 g1 A4 u6 u* [; C) w8 {
        read A_tote from "data.txt" with delimiter "\n"
/ [! ~! J  Y. v# t% f+ W' }        read A_time from "data.txt" with delimiter "\n"
, V0 N! Q5 C) {9 S9 Y  f" q: j        read A_leave from "data.txt" with delimiter "\n"9 d8 q/ h' u( i
        read A_picks from "data.txt" with delimiter "\n": h) {. o% e" J. }- M6 Y
        set load type to A_tote
! U1 }1 g( \- b% b. x4 H, j$ {        if A_tote="tote 1" then set A_induct to 1
4 z: x( `- |0 P: i8 |        else if A_tote="tote 2" then set A_induct to 2( Y# }9 m' Q, W& \5 N3 G% [3 b# O! m
            else set A_induct to 3    " v3 N+ [# ?6 n* x2 V2 m
        set A_i to 0
: T" i( j" ]+ A, l        clone 1 load to P_induction0 @" t' Q9 R+ b6 ?! v
        wait for A_time sec
8 l; f( ~" c! g* d/ i8 q    end
4 \/ s) w. @( o4 d+ A% b! E7 p% wend
: X$ u9 J, h+ E: [5 F% H4 M' p/ ]1 w0 L. Q) w0 a; W& N
begin P_induction arriving1 x" p8 [0 G: _$ r0 r
    if A_induct=1 then clone 1 load to P_pick10 R* r( f" g# ?
    else if A_induct=2 then clone 1 load to P_pick2. ^4 ^( _! ~5 U- ?0 ]! Z$ L- C9 e
        else clone 1 load to P_pick3
) ^6 ^7 U9 h+ D# N0 ~4 _end
9 Q* e" x) [8 |# F9 F, `) L: h0 M) n( O6 D1 v1 q7 ]$ R
begin P_pick1 arriving) K. F- D4 P, X1 @
    set A_i to 1
" p2 U7 y# {. H0 S4 k    move into Q_induct1
6 M! F' E3 C7 A$ A% K. G    move into pickaisle.induct1
# h) L+ o5 g- a" K  ~5 a6 }! Z8 n    while A_i<=30 do begin7 u0 w. x8 @) z9 ~( s$ w
        travel to pickaisle.con(A_i)
# {" j* o. q: z5 q  U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; r$ Y& c7 U) m) ?3 [7 ~6 h9 Y+ K
        else wait for 10 sec
3 P: l5 \+ i8 i2 s5 U        if A_i=A_leave then send to die
+ k9 H! l" N9 w8 v. l7 j7 e9 i& h* X        else inc A_i by 1
; m8 g4 O" r5 @    end
2 L& Y/ c+ g- M& M: j, ^end
5 H+ ]) Y$ X3 r( m5 s
$ ?# j  z1 W) _4 o* P+ i. ibegin P_pick2 arriving% J- A! n; {# [; e) \- }
    set A_i to 11
5 c, j0 {: B$ E- v5 z% N( J    move into Q_induct2- G" e& y, B& Q
    move into pickaisle.induct2+ t* R. Q, h$ \; O3 u( D2 |
    while A_i<=30 do begin; v7 v7 M* m5 t. o
        travel to pickaisle.con(A_i)& I# Y8 R2 D$ t# X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, D$ }6 Z' Q4 r) w# {: s
        else wait for 10 sec" L7 m! o3 b5 R0 }' q: p% G
        if A_i=A_leave then send to die; @- r; p0 F! P
        else inc A_i by 18 Y' _1 v, |5 j4 ~
    end
5 w( G) Q5 N( L- g% v& Kend
0 p, F0 F+ ~  a) H0 s9 g: X) }" P: I6 z- v9 O$ \
begin P_pick3 arriving
9 P& {4 P' f5 u0 @    set A_i to 21
- r* h! x* \- C    move into Q_induct3
# k0 A1 H: k3 _+ n/ L    move into pickaisle.induct3
9 g" M1 X7 P9 E    while A_i<=30 do begin
5 T# E! ?  D, G9 N5 N0 T        travel to pickaisle.con(A_i)
( S$ V) ^4 |; n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, S+ n) i+ j3 A5 V4 B
        else wait for 10 sec
# i: a" ]  s4 R4 R        if A_i=A_leave then send to die1 H0 S7 R( d9 D/ x+ J; l5 t
        else inc A_i by 1  _0 S* ?5 p, o! }" G" `
    end$ @7 x2 e; y* k  L2 E7 ?& l
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是个什么东东?
* M9 _* M2 L5 a" w2 ~5 K1 Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) [# h& t) ]. V0 ]

% {( Y# Q) b3 z/ T+ o! W7 T- [AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' R& q$ o. `& B* H* x1 d
2 f* L3 A2 X3 J; J5 T  W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ I4 `. A6 o& Y3 y0 s' T8 [0 i1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% S$ B% ]2 e2 q0 x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- q; ]2 Z% @& [6 P/ c! W. p3 r3 D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" p1 |* F" c) N2 m
begin P_induction arriving1 o+ y) R0 C6 n& ^
    clone 1 load to P_pick(A_induct)
% c9 b( ^) w7 n2 }! n  a4 @4 X. S! Uend最大的系( G1 T8 ]0 R% U9 P
' r8 k* B) _, N4 f" a8 ^# `
begin P_pick arriving
+ N' w  K$ _! G2 w, s    set A_i to procindex * 10 + 1
$ W; ~9 N; T; F8 \( u5 z" L+ }    move into Q_induct(procindex)3 q; ?" m% j2 n8 h* J, }
    move into pickaisle.induct(procindex)
; Y* @. _# Q5 V# W) P    /*check the type of pickaisle.induct(i), for your last problem.*/  J0 ^: @/ t9 ]) K

; d; M5 d, F6 C+ k- j6 }2 A2 Z    while A_i<=30 do begin9 ]& a( o3 T4 L4 r* a
        travel to pickaisle.con(A_i)
9 Y. J9 N5 T5 P7 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) O2 `& l# m+ J& \6 n6 F
        else wait for 10 sec9 J* E4 _9 g9 @4 [
        if A_i=A_leave then send to die
! S$ p4 k' b. E2 o8 K. w6 A        else inc A_i by 1
! I# L. F' I+ y6 j' p% a! L9 h    end
5 j2 T% q  ]9 P3 {- nend) t8 K! H: E" ?1 t0 s# q+ r- M

3 M5 O+ O$ X' b1 N) b/ w其中的procindex为整形,代表当前process的序号。5 {6 }5 h' V/ T
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-5-24 05:07 , Processed in 0.019210 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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