设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15112|回复: 2

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

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

0 o- _! y5 t3 D$ u+ S我的问题是,在每个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 p/ o+ x, B9 J+ l4 D- S: ?

, f6 D+ H; U. K- h  C& M3 o7 U- mbegin P_read arriving* I. P& X/ T0 |, c6 m0 _# Y+ O& d; h
    while 1=1 do begin/ H) i2 y) k1 ]
        read A_tote from "data.txt" with delimiter "\n"! a& r# y9 c: |' B6 [6 l# L% @0 L
        read A_time from "data.txt" with delimiter "\n"
+ f3 K$ t' E, s2 G  e. D. O        read A_leave from "data.txt" with delimiter "\n"
# I; h% ^5 }  m9 C. R" ]- C  T        read A_picks from "data.txt" with delimiter "\n"
9 z. S  x5 T0 R& o        set load type to A_tote; v' v+ S5 P, [/ y
        if A_tote="tote 1" then set A_induct to 1" X6 r! r/ B5 M5 r' f9 x# v. Z
        else if A_tote="tote 2" then set A_induct to 2: W5 w; z2 R5 u. O, h- D; N+ c
            else set A_induct to 3   
& N/ z3 u# F3 j. H! y  ~        set A_i to 0
" X% h0 ~: y' B  J7 Z, K        clone 1 load to P_induction, I+ {8 K- J/ _  [# F5 m
        wait for A_time sec$ r1 E! Y2 x$ z( W/ Y1 F) O  H
    end
& {1 Q0 ]* j+ [1 aend
# L) Q) u- P4 u
) a/ M8 L9 X9 |begin P_induction arriving' E9 q$ E: I8 p+ t; Y$ |
    if A_induct=1 then clone 1 load to P_pick1- `2 S( O1 _- ]: E' C0 \* o
    else if A_induct=2 then clone 1 load to P_pick2( L. J0 a0 s  U$ q2 {. C$ l
        else clone 1 load to P_pick3
7 ^* N- b8 S; p8 J: Hend5 v3 X* b2 p3 M, ?# T7 U/ N1 c9 h

1 T( _6 r0 p3 ~% jbegin P_pick1 arriving
. [# `# ]. `( \2 T1 o/ Z    set A_i to 1
, M1 r; g* {4 M0 o3 b2 g+ y    move into Q_induct1
! w! [5 p0 z. _+ j1 O) _" }9 k4 }    move into pickaisle.induct1
% r4 ~5 t5 z; n, K) x    while A_i<=30 do begin" S# T6 e$ _- L5 ?' t
        travel to pickaisle.con(A_i)2 V7 {  a1 }" r. B4 J* V2 H  L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 h3 |$ y' X% {, y  {' @9 ~! }
        else wait for 10 sec4 z* _, L, D% l6 n* i
        if A_i=A_leave then send to die- |/ K$ R! P/ ]
        else inc A_i by 1- e9 _* b* t) ]
    end
7 s% i8 u5 H+ q. Nend2 `  H: Z/ w) c9 z

0 B8 Y8 P! I0 n  L9 j1 G0 R) bbegin P_pick2 arriving, C$ |0 R: _5 [+ ]4 }8 L
    set A_i to 11; T' g3 b: U) h: g+ ]8 F
    move into Q_induct2
4 e/ T3 c* j4 m/ e5 N* [5 b& G    move into pickaisle.induct2
- P+ E0 w! R  [6 @: p    while A_i<=30 do begin& W; M5 W5 f6 f' s
        travel to pickaisle.con(A_i)
; b& q5 C5 X# U) \* |" g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, z  f- L# f% H9 E; \        else wait for 10 sec
- z/ [8 a# n# t6 _! ]* P4 Q# u        if A_i=A_leave then send to die& B9 v+ L% V& n% R9 o$ ?
        else inc A_i by 14 t. o9 B( U$ i) W
    end
1 ?6 g: s( v  a1 E- hend
6 ~! I+ }) d7 q1 _- d: v6 }. m- K" d: x
begin P_pick3 arriving, V: M# Y) E$ ]- _3 o6 v, w0 ^5 p
    set A_i to 21
; Q. C; O0 L1 Z8 ^    move into Q_induct3
, o  r8 ^. v0 m! L5 p    move into pickaisle.induct39 ~' R; h4 p- g/ y! _4 i0 N
    while A_i<=30 do begin
( Z, X0 ^* h; y5 t1 |' ~        travel to pickaisle.con(A_i)
# X: m4 Y' F( e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- _4 s5 v, a' E2 ?% r        else wait for 10 sec! }/ K1 k- i# {. }
        if A_i=A_leave then send to die3 d) _% O& g0 [* z  s
        else inc A_i by 1- N5 Q  G" F6 g* Y2 u
    end
" K; G5 \' C2 o* e6 o4 Y9 O5 Hend

最佳答案

查看完整内容

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是个什么东东?
9 e. ?  x; n: M5 m* m) Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 k6 @! H- h5 m. W4 f- V+ h
+ \) j! N" h/ H; O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  l$ d3 _9 U* J: M3 j

( z% t/ Z- r* p: {% Q9 o- J另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 n3 w' L0 n7 X9 {1 c  e; o
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 v9 ^1 }& U6 H5 R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ k* s6 `- J% W+ V# U, o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 c. N) H2 F/ z8 e6 s8 p/ X" x
begin P_induction arriving
. d4 B. v- q2 |  r$ Y    clone 1 load to P_pick(A_induct)7 A  B7 h) p+ ]  K
end最大的系
1 s: P+ f  c$ B& K* ^- D1 c1 U& t, c
begin P_pick arriving
' ]+ r4 N7 [7 y6 ^. s    set A_i to procindex * 10 + 1- s9 B+ y* u  q3 O  C. }- L2 o: E3 ~. j
    move into Q_induct(procindex)
1 z. D0 E( _, F" K& k, g    move into pickaisle.induct(procindex)9 u' Q) m  V6 g4 r  ]
    /*check the type of pickaisle.induct(i), for your last problem.*/! I" u$ `, i4 A2 J# F7 V

  k2 E1 o/ U! Z- u/ [) k1 V& F6 @( I& u    while A_i<=30 do begin
  Z3 j( B  n/ l& [        travel to pickaisle.con(A_i)
6 ]8 i* T! S: a+ }) \9 n0 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ]% R4 |, |6 }1 L        else wait for 10 sec
- A. z2 Y. d* U. y) k, E        if A_i=A_leave then send to die+ R; q$ I; Y" J9 `- `) ^
        else inc A_i by 1
0 i3 N$ X2 x# t& W6 p    end( j! X3 A3 _8 Q+ a# K# Z9 X
end1 s2 N; {8 T' B' i' E

, e  u, h4 e1 O9 f其中的procindex为整形,代表当前process的序号。4 [: l- X8 `4 ?4 K
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-8-11 16:36 , Processed in 0.015828 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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