设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13691|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 r5 |6 A7 X" Q$ N

& w! j' Z+ u, R我的问题是,在每个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中的数值,不知道会不会有什么不妥。" {5 Z0 e) e, o" W- a; J

8 B8 H+ e* ~" v* h5 J6 x* {- jbegin P_read arriving9 i; v2 Y& r9 x
    while 1=1 do begin
% `: c# t1 n) L0 `( F4 T& X6 K        read A_tote from "data.txt" with delimiter "\n"
" T* H, `- N! r1 t        read A_time from "data.txt" with delimiter "\n"
, s  @4 A2 I3 y9 g3 E        read A_leave from "data.txt" with delimiter "\n"
  m8 F; D2 W& O% R5 y8 [        read A_picks from "data.txt" with delimiter "\n"6 _) z3 j1 W& p6 N
        set load type to A_tote
/ W# F* ^  H4 M5 D0 @9 r8 ~- [6 Y: I        if A_tote="tote 1" then set A_induct to 1
: D8 Q. E. Q. N. ~, Y        else if A_tote="tote 2" then set A_induct to 2) y$ R  s. h9 m6 p- O" w
            else set A_induct to 3    . X5 i$ \4 J0 k( |
        set A_i to 0
$ d1 e' a! i# f        clone 1 load to P_induction
/ i( m  b* D2 S: v# J9 j8 _7 M  \6 `        wait for A_time sec
& }5 u4 S2 x+ y! U( K' O& w    end& G3 X" S0 }8 U+ ^. _' C8 {
end
" ^& A+ Y7 `: E/ b: r% O0 }" K* Y4 E# n" ~% D  j  @( N( n  N
begin P_induction arriving
2 r1 o+ ~  a% R3 y; f* B5 e    if A_induct=1 then clone 1 load to P_pick13 }# \. r" f6 q" n
    else if A_induct=2 then clone 1 load to P_pick2
# O" M* x9 Z5 z" c$ a        else clone 1 load to P_pick3+ b. y  u  m- f1 d. p  N
end  _. y3 M2 E% Q5 t0 d1 L  |4 `1 a4 c

& m! h' F8 P" d, Lbegin P_pick1 arriving9 U: i9 \  t# u' O( o; J
    set A_i to 1
( O  [6 D# ?9 K    move into Q_induct10 \$ p6 P( h) [3 h& m: K+ E) d
    move into pickaisle.induct1: K9 z+ }  d7 G
    while A_i<=30 do begin
  s0 Z& L( @2 Q4 j        travel to pickaisle.con(A_i)
- ]( X" Q$ G$ l% {" b9 a% G5 I/ {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 B1 T+ s( P5 s" d9 h. i: p
        else wait for 10 sec, y. k' [3 Y6 _$ A  {/ ^
        if A_i=A_leave then send to die, O2 I. J/ _) ^+ P
        else inc A_i by 1
! w; @& H, e5 D0 m9 e- ?3 h. v    end+ K2 K) G9 O/ V# C
end
  H5 t/ u/ E* T4 V
% k+ ?: r+ C3 X2 v2 J+ {" Wbegin P_pick2 arriving
# [: H4 }/ t" b% E8 g    set A_i to 110 a; [: _) a: J) P% Y1 g7 |6 Y" t
    move into Q_induct2$ @- e% X5 n% j: r7 M4 ]2 l/ X  V
    move into pickaisle.induct2
0 y! J3 z2 `$ \, P, |7 h% T    while A_i<=30 do begin7 m$ `# N1 D* N' x1 l
        travel to pickaisle.con(A_i)7 B& y- }. ~5 `, M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- y1 S# d# X, M        else wait for 10 sec* b: @$ p  g) Q# ?+ q% C
        if A_i=A_leave then send to die& l! ?3 y! T  o& @
        else inc A_i by 1( c* J+ l+ O; n0 Q3 A6 t, M
    end
% Q- }& M3 O$ U% c8 y" aend
& w- l( Q( x+ V' C9 w/ h
0 Y0 D& Z. t9 Y0 X' ^+ U3 P* W7 ibegin P_pick3 arriving* c) \8 O2 P' z2 J$ y& i
    set A_i to 21% ]* x: Q. u, V& K, R( V8 h
    move into Q_induct3, c- p  I0 q7 r4 T0 c/ R3 N+ _
    move into pickaisle.induct3
' [8 b: W: h% y    while A_i<=30 do begin
- {& H: q8 D1 ]/ s) N+ |/ U& B        travel to pickaisle.con(A_i)
! v2 \7 q% n& M" q$ f( u! {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# J. U  Z( H) Z
        else wait for 10 sec
0 d; a$ O# U: V. Y( [* x! q        if A_i=A_leave then send to die
6 I$ g; `8 Y' u2 f: T; a        else inc A_i by 13 ?; W# {. W' r+ ^9 z0 R3 E
    end6 W! T5 {5 {2 A. l( _- X( x* X" T
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是个什么东东?! e. M  @# g0 Q; t: q7 }' h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# [$ \3 m  c/ h/ b* s$ D8 \1 ?+ X+ k, Q9 P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 i5 G+ t; k; p8 \, {* i
% h+ C6 W; A2 H7 _
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  l2 B# n2 [$ J$ x3 E; E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& K- U9 M6 b+ L' Z- t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- j7 `  r* Q6 Y$ G9 M: j, W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) A% d0 f, u: F! w  W+ l# Ebegin P_induction arriving
0 n, C% h5 F$ Y- b' y6 b    clone 1 load to P_pick(A_induct)5 r% e4 @( ?- [, \
end最大的系
4 ], u$ g+ B/ c5 M" x  U, l" ^* m- }
begin P_pick arriving
& |( d; n6 @# e* ?+ O, p8 b% i$ [+ v    set A_i to procindex * 10 + 1: A: C. c" P9 _1 H3 F5 v* C7 Q1 D( q
    move into Q_induct(procindex)( L1 P& G: L0 q$ c# U
    move into pickaisle.induct(procindex)( O! a) w5 n! J2 Q; E2 Q$ T0 P
    /*check the type of pickaisle.induct(i), for your last problem.*/
. y7 G8 Z/ I$ V% [2 U
4 ~. K. z2 K  f1 }/ m/ S- o    while A_i<=30 do begin. T# f( b( h1 {2 k2 _! f# d
        travel to pickaisle.con(A_i)  d  y, R  n; Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ P! V# d6 b9 R+ [
        else wait for 10 sec! {$ b. x5 ^1 }' Y) s3 f7 F& b
        if A_i=A_leave then send to die2 z! x0 O; S' e: `% i
        else inc A_i by 1
3 j( c8 ?. P, [2 s6 L# T$ n    end
3 m* f  h" ]8 F# Q# tend
0 t8 `/ ?6 J+ b) S  e5 c; p+ I( x! Q- Y2 w/ ]8 I
其中的procindex为整形,代表当前process的序号。1 ~$ j3 N% a9 R; k& i: d; }0 [
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-4-29 02:54 , Processed in 0.014393 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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