设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13327|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  t6 m" |& P% g1 e, {, I5 Y) `' O& H3 H* e
5 O* J! M# Z  I: K1 j/ M* Z* c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- V$ o7 D7 @$ n2 w1 k, ~
1 X' w$ H- p: t' I# U
begin P_read arriving9 K, C7 Y$ B% Q2 u
    while 1=1 do begin0 O) P9 g8 x  D; G! f5 k4 \$ x
        read A_tote from "data.txt" with delimiter "\n"
2 q& y, j  L6 l3 d& O# y9 V0 g        read A_time from "data.txt" with delimiter "\n"9 O9 N2 B, R; G. u
        read A_leave from "data.txt" with delimiter "\n"
' O! `5 I2 ^1 K5 `        read A_picks from "data.txt" with delimiter "\n"' b/ B0 K  o: z+ B. o5 P9 M* R
        set load type to A_tote
  Z5 a6 x4 y' r, w) k; N5 o: q* y' Y        if A_tote="tote 1" then set A_induct to 13 F- \+ K& \4 Q% M+ o4 q/ N
        else if A_tote="tote 2" then set A_induct to 2, N+ m' }* d: p* j4 f: {9 ^
            else set A_induct to 3    8 W  \9 S8 P# H: ?$ c+ D
        set A_i to 09 L' @2 r6 r. P
        clone 1 load to P_induction* |. t4 R6 j1 ~$ j$ V7 r
        wait for A_time sec2 {9 z% w+ _5 D' W- t! v1 U
    end. G; E. o  O- S. o
end
, R' K4 V  ]- u# r% y) h
6 o$ }% j% F( l& R, D( N1 S# |( ibegin P_induction arriving
$ U: U. N! g6 ^# U* l1 L9 n4 J    if A_induct=1 then clone 1 load to P_pick19 m1 b: B$ J: p" x2 R
    else if A_induct=2 then clone 1 load to P_pick27 h$ b' k. P" P" I) @- t6 p$ P' J
        else clone 1 load to P_pick3
- r& V8 [/ c( `% _9 l' A( B6 {. iend4 q: F* m+ r# ~) L  h: {2 Q% H
2 h; e  G2 s" J' Q$ ]9 e! \" R0 U
begin P_pick1 arriving
1 K; Z. k* [$ V; J$ l1 l    set A_i to 1- B, d& ]: S- g8 }
    move into Q_induct10 E. j# ~; u0 e) c- l
    move into pickaisle.induct1
# g; k. f0 d4 n/ F, d3 ~- h1 f    while A_i<=30 do begin+ S# P: i: z4 ~' ?, n$ X5 `# T
        travel to pickaisle.con(A_i)) w2 H/ {5 P" E* Z4 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% f$ s: p& X! w4 M, t1 s- B        else wait for 10 sec6 e) J: o" ^; p/ y
        if A_i=A_leave then send to die" J( a9 |% x/ M# {/ ^) k
        else inc A_i by 16 u4 E) S3 r7 T) j+ \* U
    end: F. ^  r2 x2 J4 q1 c: X- o
end
9 s& ]9 G2 p' B8 F( @* V5 o: P, B  W+ T; W
begin P_pick2 arriving. I, @( |+ W5 I  j! T/ `0 F* w
    set A_i to 110 n  r& J- ?- M: D; h% @4 A
    move into Q_induct2
6 |0 {0 {9 r7 n8 Z) i9 z    move into pickaisle.induct2
) L: O" E% h* b: b# X" G    while A_i<=30 do begin
$ X+ s7 w8 O" V. X        travel to pickaisle.con(A_i)- n) H" _4 x9 ~3 O( i. l! l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; O5 _- b+ X# W/ t' B9 z  r) p
        else wait for 10 sec2 u; R0 a( J: T' z: s% B
        if A_i=A_leave then send to die
6 R/ x/ y( t8 l: s) ]5 C        else inc A_i by 1( M" X2 x" Y: L& H3 M& N
    end
* s' t: ?0 t! g, l$ Rend2 C8 d+ L$ Z; L. m; Y4 A3 N3 F& q
9 t0 F* I! n" D/ B! R
begin P_pick3 arriving3 A  T+ ]+ A: b5 p" @
    set A_i to 21
7 @4 M: |; S) g1 |    move into Q_induct3
$ v7 l- p+ @$ O, O    move into pickaisle.induct3
, ~1 c, N* T) s    while A_i<=30 do begin, [. C* {! g. `
        travel to pickaisle.con(A_i)
0 W( C2 H+ c8 M5 u. r5 H+ n; T7 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& R1 p. u; ^# Q        else wait for 10 sec. D/ p$ m& `& [3 E# s
        if A_i=A_leave then send to die
& H6 I3 p1 R- v5 c3 D" K" b2 Q; f        else inc A_i by 14 J7 ?  D$ p, `( E6 K
    end* Q! C5 \; W) x
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是个什么东东?
# r# u9 `" ~6 ^" Y$ z4 ^' amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 v) {0 b- Y  ]" V6 L) G
; {! }$ X/ a6 b( T. G, g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( T9 b9 E9 |# E. F: o

5 {' D8 L& Q' f8 r另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 m; v) L. s$ P$ H% y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 q0 O5 t" N7 ~$ b" b2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 I: _& [& |. h1 y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( y! d. B. X$ ~begin P_induction arriving
' @/ d. @: u( A4 h$ P6 R    clone 1 load to P_pick(A_induct)& D  L* M+ t1 k3 G& U
end最大的系
7 m' I; j6 w3 d9 E; {7 J" Z1 d4 M! g8 K. k! M9 F! |
begin P_pick arriving2 T1 H7 w# i/ T- z
    set A_i to procindex * 10 + 19 X; Q0 U" s* O. ], h
    move into Q_induct(procindex)9 ~  k# `7 e1 @* @* Z2 C& _
    move into pickaisle.induct(procindex)
' ~) z  u4 o6 x4 ]1 n/ L    /*check the type of pickaisle.induct(i), for your last problem.*/
2 u1 S. _; ?3 a) g: l' i
. b" _% o) v5 ]4 L0 y8 ]' P    while A_i<=30 do begin
9 g" O  o) f$ a& |% ^  d        travel to pickaisle.con(A_i)
9 `* l" O  c* i, z( l! s! @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  {+ B6 k; X0 ~* `' Q        else wait for 10 sec
/ b/ J1 E9 x. K        if A_i=A_leave then send to die
* S7 Z& u* A: {* y! x* [* S        else inc A_i by 12 `, _5 ~  |* Q, \! H6 y$ I
    end
# e+ N3 G/ ~* _0 h8 s4 O6 Hend2 }$ A! X2 I7 u3 ]$ o% B
. q9 e- l  @; H. N/ V
其中的procindex为整形,代表当前process的序号。- ]5 Y/ U6 C0 Q/ N) U
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-4 12:02 , Processed in 0.018362 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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