设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14756|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ D5 e2 V  L  D' ]
- p6 y- u% U6 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! e1 N( I& H, s. ~) Z- n) N6 I- I. r  {3 W
begin P_read arriving' _/ A2 y- |: u
    while 1=1 do begin
8 g2 r) o$ Y. y6 F6 S4 R        read A_tote from "data.txt" with delimiter "\n"
. E: s* c' I$ w* o) @        read A_time from "data.txt" with delimiter "\n"# |0 S4 j  K) ?( i5 r
        read A_leave from "data.txt" with delimiter "\n"
0 f" t; h+ H3 r  w, [, c1 w. k7 }, X! ?0 u        read A_picks from "data.txt" with delimiter "\n"
  |1 _, |& o7 w. m: M8 D& t        set load type to A_tote
1 b* `/ z* C. m# l  T# r  I' x/ T        if A_tote="tote 1" then set A_induct to 15 u1 [+ _9 i& [
        else if A_tote="tote 2" then set A_induct to 22 U' ~+ S$ F6 o( R
            else set A_induct to 3    # ~" A# {  {) n2 a: |; ~
        set A_i to 0
9 i- ~6 ]1 ^1 ]1 D* f* S7 L8 z1 x: }        clone 1 load to P_induction. H& f; ?1 h& A' H
        wait for A_time sec3 B: U! a+ X/ f5 x. m( H+ V
    end, R6 R9 _# ~. q: c+ z, ~" s
end
" r! M0 o2 M% L! X
/ [* j& M& O. y8 F" S1 r' ^begin P_induction arriving2 L7 I2 ^2 {/ E: v8 y/ z5 q
    if A_induct=1 then clone 1 load to P_pick1% _/ W5 P  Y) h( u/ _
    else if A_induct=2 then clone 1 load to P_pick28 `. ~/ `  I  \! m
        else clone 1 load to P_pick3
* ~; ?  q$ w( o( h' [/ Rend
' I! T- t) P( A3 I
" [& t, C8 o  f- [9 V* D! S$ cbegin P_pick1 arriving
0 F  e* p; e" [+ m    set A_i to 1
' ^+ L; o7 y! [" @& K+ v    move into Q_induct1
& m/ n3 {* J0 k- |9 _+ t5 i; }    move into pickaisle.induct1
- F+ l! _! `* L, ~! z& ^4 c    while A_i<=30 do begin( Y0 X' X- o" P+ E
        travel to pickaisle.con(A_i)3 C' Y  A; o% P: n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ A  ]/ m  r4 q, t' Q: W# V( A        else wait for 10 sec  d% M; X9 l; ^* C7 J9 j$ K
        if A_i=A_leave then send to die
2 Z) k/ X0 Z$ S7 Z$ z! G7 }3 P        else inc A_i by 1! I. B" J  j) K$ h  v
    end
) e8 ~9 i" H( S9 S0 H$ Qend& f& S7 Z  e  z- g% x+ t4 t* u
3 d0 I7 C5 m/ a. R( T
begin P_pick2 arriving: S" f1 Q+ N5 _) w4 u5 A) ?/ {
    set A_i to 11. n4 a+ F$ N! l/ f: e
    move into Q_induct23 P" ]; I3 H( w9 |
    move into pickaisle.induct2
9 O" H: Y( i: u& P9 `    while A_i<=30 do begin. o  S! m; g; Y" r2 V9 S0 S6 i
        travel to pickaisle.con(A_i)
; ^4 R* R3 E! G$ N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# C# p2 V  \6 M+ Z        else wait for 10 sec. J% f% M; r. H. V# f$ u
        if A_i=A_leave then send to die5 W+ K2 B: k3 w1 B9 V
        else inc A_i by 1
% G( M* E: a. M8 C- c; P4 U- P- M    end+ i0 S8 T3 f/ J  t0 b5 h* F
end
! Q+ Z: |% V: y' n. j% j1 ~) `" V# @1 M3 ~6 C% _
begin P_pick3 arriving
8 }  z5 ~) N6 x; Z' W2 ?. q! ~: v' T    set A_i to 21
, p+ ]% b+ E! @3 }    move into Q_induct3
9 \; W' e5 }% }( |  Z    move into pickaisle.induct3
# x5 X& C& w8 G    while A_i<=30 do begin$ I% O) t8 q, V8 e8 ?7 x8 v0 i
        travel to pickaisle.con(A_i)+ ^8 k1 j4 P2 m( n, l  H5 X2 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 U: b  g1 w/ i, b
        else wait for 10 sec' }) u/ h6 |( u+ ]4 K. F/ _
        if A_i=A_leave then send to die& H) H" k' C% z
        else inc A_i by 15 q# R% j! o+ M' M- {' P& U
    end
) a6 G$ w1 H# G8 q3 W, ?6 lend

最佳答案

查看完整内容

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是个什么东东?
$ p( P" N8 k, w% dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 w: s5 _) H: V  Y* A8 C) h. T7 e/ b% O! \. z  a/ o% e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# Q/ A; _& V1 Y2 _: r9 G2 q! w
( q" c: ~0 ~' K) ~& G0 A  O另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, K; p. E. L, E/ ]7 y/ x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 O- @+ U+ |8 _* C. V1 J
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 F$ z: q: S+ O. e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 {. C+ h- B( X( k3 Jbegin P_induction arriving
6 n3 \$ `$ ?" C) u7 G$ ^, O% G0 N1 F    clone 1 load to P_pick(A_induct)
! ~3 f. o$ h& R* `7 q7 Rend最大的系' j! h& ^; J+ L, L% E# x1 x
) g/ [  w- f; H5 A
begin P_pick arriving- C/ C- z+ ~- s, D; j; ]2 t
    set A_i to procindex * 10 + 1
5 `/ m; ~9 ~# I# ~. i  j    move into Q_induct(procindex)
$ o# ?% S/ S" E/ D  x8 t    move into pickaisle.induct(procindex)
5 s3 R. f0 Q0 y2 E' h    /*check the type of pickaisle.induct(i), for your last problem.*/
8 [7 J) m  i  p' B9 R9 y$ ^, k' ]) g
# l2 u0 o- `$ _3 e& w/ o    while A_i<=30 do begin
7 b3 Y" n+ _" M( d7 ~! A( A% y/ Q        travel to pickaisle.con(A_i)) B+ g, }! V5 P' b( d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 w- p' O  Y: x* q/ [
        else wait for 10 sec
9 j/ Z3 C7 b- g* T0 P5 n. l0 I        if A_i=A_leave then send to die! J2 E4 y5 j, ^# s/ O0 E6 e, t
        else inc A_i by 1) _) d9 \2 L) l" J- `& P# b) @! a
    end
' l3 w/ Z' e' @* Q: P# @end% n% S0 A8 N, d' ~1 h: ?  I

* |# G! o* g& q8 s1 F其中的procindex为整形,代表当前process的序号。+ X- D1 E2 u% u9 m" A* R. F. e
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-7-25 12:17 , Processed in 0.018731 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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