设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12096|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" i! L6 `3 U8 f  @* p& G: @1 T; Q  i

5 a( c0 k5 R/ V; i我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ N; I. K- X" f; L6 P7 h4 R  U- E
5 V$ c) D2 {6 w0 }
begin P_read arriving; b* q  I& h$ H/ F) W: ]
    while 1=1 do begin
0 a- i7 |4 \1 w2 s: B# L        read A_tote from "data.txt" with delimiter "\n"0 X7 g; O! L, I2 W
        read A_time from "data.txt" with delimiter "\n"
6 b* @* N& a6 W% n' o. m        read A_leave from "data.txt" with delimiter "\n"
/ ^1 t, J! I4 h$ U0 R& x        read A_picks from "data.txt" with delimiter "\n"
6 t$ ~. ?: A; |' B' \4 y6 O) h        set load type to A_tote
% F' H6 b% m, T9 ]. E        if A_tote="tote 1" then set A_induct to 10 L9 o/ a2 [7 c: A( D2 n8 x! r3 k* s+ F
        else if A_tote="tote 2" then set A_induct to 2
' j% o% X! q$ o/ ?9 ~/ q7 q' E            else set A_induct to 3    : T5 R; y9 }) N  i
        set A_i to 0
& z5 u: }- A2 y7 V- j  T        clone 1 load to P_induction* U  m* @# B: X& t
        wait for A_time sec! t9 f  c0 @- a; @4 ^
    end
1 ^; O# L" W0 m  d4 p, C- S% Fend" u3 M: E9 ?8 M1 b0 v, y" [

  C: s# O6 f3 B$ W7 {begin P_induction arriving
- q( h9 L6 S0 P, j- R$ I, ~4 V- I" O" n    if A_induct=1 then clone 1 load to P_pick1
" m& G6 m# Q  V2 k7 `0 o# ]1 A0 o    else if A_induct=2 then clone 1 load to P_pick25 I7 S# X/ u7 D' H6 ]( R8 J
        else clone 1 load to P_pick3
+ r' M6 G9 o7 \1 h2 a, \3 ?; J* |6 Rend
, ~9 N; u2 e2 z8 j: f
8 N0 v2 d3 B3 Q; ~begin P_pick1 arriving
! z/ b$ l+ E  G# B    set A_i to 1
3 Z7 y9 v+ ?9 s" P. K! M- L    move into Q_induct1, f4 S& ]2 L. O; i
    move into pickaisle.induct1
4 C  k0 \- x% ^    while A_i<=30 do begin0 K" ~7 D. y6 L
        travel to pickaisle.con(A_i)
8 D  D4 V4 W: x& @* m: X* D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; l. x2 V2 V6 {' h2 d1 l
        else wait for 10 sec; `4 [3 V. O3 }* s2 C$ B$ n
        if A_i=A_leave then send to die/ r! C0 i1 X) d; C- u
        else inc A_i by 1
5 z$ k# c% G9 l    end) d: j. }1 v9 h! o: S) O5 m
end4 \- D% p, u3 L4 x
  ^+ M8 G# ~! Q
begin P_pick2 arriving  N2 K5 t2 K- a/ c2 |3 F3 M% y
    set A_i to 11
4 B7 w2 f+ `2 J7 k    move into Q_induct2
' ~" a! x' ~7 S. ^    move into pickaisle.induct2+ Y8 u/ `" A, I- ~( e
    while A_i<=30 do begin
& v# Z, a# I' h% N        travel to pickaisle.con(A_i)
! h) Y6 t7 P( f# k. s/ R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, T6 x/ [# X+ x3 B2 I* \        else wait for 10 sec9 t& H- }$ {% c* n6 M7 d
        if A_i=A_leave then send to die
, s- d5 t5 c& l# k& B. D. R        else inc A_i by 1& y" |; `- }' V. i) n5 P
    end9 `) b; L4 C1 U9 ^5 t
end( j% J0 P, y$ M; w
7 j- r. w, U" G2 Y
begin P_pick3 arriving
1 s; B3 P& r2 J( d1 d    set A_i to 21
' H  q0 n3 L  H2 ?* R" z" |2 }    move into Q_induct3& `2 }6 H! g% @. T  ?
    move into pickaisle.induct3
8 U3 Q& y' }" m; w2 k3 A4 u    while A_i<=30 do begin  n  h/ w( N7 M
        travel to pickaisle.con(A_i)* [7 ~) r2 ~& Y- d7 f, u- E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* s- G( O1 _3 S* c; D. q' n        else wait for 10 sec2 y- B2 B3 X  W5 m/ E* x  G
        if A_i=A_leave then send to die. Q8 T& D; E6 S* G
        else inc A_i by 1
3 A4 ?9 E2 V. ^1 Q3 r% ]    end: N; l  ~) |6 ]4 \" ?
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是个什么东东?( i4 a+ G' S4 t6 A8 p
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 s3 `9 s. `8 ^2 t8 c

, j+ \( _3 x& H/ {% I1 E" U* c$ NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ I0 V( h4 L, K. D

5 ^- O! ^8 ~" |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( O( M: S5 O& R' K' P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' V( ?+ z/ o& h$ l' f; {/ I' a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* c( E7 b' q' j! Y0 ~0 G
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 y3 b( o4 g- K: M2 kbegin P_induction arriving" J0 ~# f% ?, g
    clone 1 load to P_pick(A_induct)/ R! M3 N( f& T5 H  {% r( i/ `
end最大的系
9 {4 H/ ]) L( @1 I, H1 ~) B* ]
$ J% T* M- h* x8 h* T1 T, }begin P_pick arriving6 O2 O4 X! ~. C6 X" _6 C4 ]
    set A_i to procindex * 10 + 1
. F" z, o' O% q; k2 j7 K$ @0 b1 a: ]    move into Q_induct(procindex)
/ T& P2 {; z5 ^; [# C/ G! {    move into pickaisle.induct(procindex)3 Z" p4 N# B7 L3 E% i' b8 l# t
    /*check the type of pickaisle.induct(i), for your last problem.*/" J3 }8 t  @; k# v
$ e7 G7 T+ U5 X; ^4 x  g7 I( }) x: H
    while A_i<=30 do begin
( K3 w2 w2 L) {( L! n8 F! {: G$ v        travel to pickaisle.con(A_i)  R) m% M6 h' B# T) j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 m, ?* N+ E! }0 H
        else wait for 10 sec
! J, Y  C" B$ o9 M4 k# M        if A_i=A_leave then send to die/ c: q3 ~" g1 o7 B; J
        else inc A_i by 15 C* Q/ V3 `3 f7 o0 R9 H4 E
    end
; Y& [! W4 g( T: D% v+ Aend
+ r5 t' y9 X/ I8 _
, s, H8 P* O/ y) Q1 c其中的procindex为整形,代表当前process的序号。8 W$ o6 D5 X0 X) H( |, f) V) s7 R
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, 2025-12-27 08:35 , Processed in 0.015155 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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