设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13427|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' v' @( R# h. T( D9 b4 P" @
5 \0 b! ^) h& t& S# }+ s: l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. j7 u- u2 E, }0 y' `4 ]9 a  t$ ^
6 i( j  [/ I$ k) F
begin P_read arriving
7 q- Z* d( ~# ]8 V& p) T( b    while 1=1 do begin( O9 V+ N' j3 r
        read A_tote from "data.txt" with delimiter "\n"* T; I7 y6 z0 n. g( B6 r
        read A_time from "data.txt" with delimiter "\n"# [2 x8 p7 B1 A* n! b' P
        read A_leave from "data.txt" with delimiter "\n"
0 D+ e6 L' G, O0 c3 r        read A_picks from "data.txt" with delimiter "\n"
* u8 K/ P( _0 q' ^* I        set load type to A_tote
/ |" R( \! w( m. @) z2 V/ a        if A_tote="tote 1" then set A_induct to 1
) l. v5 W# c- R        else if A_tote="tote 2" then set A_induct to 2+ F! u/ Y3 N9 w% A: G3 x4 I
            else set A_induct to 3   
: P) Z9 {, ~0 M$ B  N        set A_i to 0+ @5 F# Z0 I1 C9 T
        clone 1 load to P_induction' ^' c  ^8 h& A
        wait for A_time sec( k7 |" j/ ^8 g% _
    end
$ k, A3 L- x0 o; k7 U; I0 t7 _+ ?end* k' F" Z1 q( l  H

& W5 Z' Q. Q% r2 x+ j8 a; M' Gbegin P_induction arriving
) o% Q5 I9 f8 M- c" H# T    if A_induct=1 then clone 1 load to P_pick1
$ e  }3 ~- {$ Q, I    else if A_induct=2 then clone 1 load to P_pick2
) C# n4 p7 `4 o, n' _" Z        else clone 1 load to P_pick3
3 |  g9 G2 k3 kend
# J5 S; D# K  j- A# G* T' l$ [1 t6 J5 x. R1 ?
begin P_pick1 arriving
' [& ]2 A1 W9 p" `    set A_i to 1. G9 V& G0 i6 D- S% }
    move into Q_induct1# V+ ]: V' s( f/ I6 Z, E3 {
    move into pickaisle.induct1
8 O3 n$ z: P- r2 `( e2 u& ?    while A_i<=30 do begin
7 T2 Q/ F4 I! L. d        travel to pickaisle.con(A_i)
; ]" {" ?7 [' B( B" A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ i- m' M6 G9 J3 |& {        else wait for 10 sec) _* z( R1 W' V
        if A_i=A_leave then send to die
3 V* ~4 ]% i2 Z, J1 s) V        else inc A_i by 10 Y! d! H1 V8 b7 L& e
    end
8 H. O2 P8 A$ k7 I5 L6 ~end8 A1 n0 ?! K8 k1 m3 t& p0 b* Z$ ^+ u

+ I! d' Y5 k2 a7 P# H. @. O) [begin P_pick2 arriving3 I0 p+ P8 e( v. Z
    set A_i to 11# V1 J& w* |* g: S. P
    move into Q_induct2
  W- @. K+ S# g% }, |- U    move into pickaisle.induct2' O6 E7 S' I  g" z% |% m/ C
    while A_i<=30 do begin
7 Y. j" D- w. |# t4 r6 u        travel to pickaisle.con(A_i)
' Z: e  L+ M' M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% r! G: f' z- J. X8 b        else wait for 10 sec
- a  g5 l% @+ l, c: Z0 K        if A_i=A_leave then send to die- t8 f6 F. r* b$ q- _
        else inc A_i by 1" t+ v. S  Q, t" F! @  g  m8 w" U
    end7 j! N: [0 \  V) V
end
# @8 N& W0 Y# j" I. K
  m3 l0 \, L/ B) ]  x: s; V' Kbegin P_pick3 arriving
  m1 H/ z) C) q& ^" H4 `1 k" \    set A_i to 21
/ e. r! W" W/ s9 [4 C    move into Q_induct3
% ^# n1 t) P, W/ s: J    move into pickaisle.induct33 T/ U" H7 a9 @$ x, Q- z+ Q: ?
    while A_i<=30 do begin5 A/ @3 _! W% [* o: [: B
        travel to pickaisle.con(A_i)
7 _( _1 [/ q' |/ B2 O8 }2 I# [# W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% P6 z+ e  @. S! T9 n
        else wait for 10 sec
- `: k7 Q1 O5 D" m        if A_i=A_leave then send to die
, G8 J2 x% l# g: S1 U3 Q8 {        else inc A_i by 1) t6 E: o" a, q1 n) |# x9 F
    end4 B! D$ V5 I+ w9 p" U: @
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是个什么东东?
' S7 t9 W* I/ a+ ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( A. G$ s0 k: E$ d* O1 }9 V: |: D( w( e+ w* A) g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, u5 e9 g7 Q$ G& ?
7 g8 }9 ^1 J& ]) o3 r, Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; l' m( }6 W# l1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! }8 n) Y8 z& X- r- `. O: @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ a8 V% ?* D3 s9 l6 x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- n0 v% e5 @" E% |
begin P_induction arriving
$ W# P: b" r8 @( R- i1 f7 {    clone 1 load to P_pick(A_induct)
& t6 V9 v5 L; k  q2 y) Oend最大的系3 [" ]3 A+ X; |
; @3 l" e: r6 Q0 T
begin P_pick arriving
& j$ s3 }4 d! m2 \+ m/ R) I    set A_i to procindex * 10 + 1
2 S8 R- ]4 f7 |9 M& b    move into Q_induct(procindex)
% b, V. G. j7 j% J9 h0 W; u    move into pickaisle.induct(procindex)3 o0 t/ Y' \6 ~+ U) v
    /*check the type of pickaisle.induct(i), for your last problem.*/
# D! {- Z0 {. T- Z4 k6 r+ z6 ]* z3 |" y$ i
    while A_i<=30 do begin
1 ?1 ]. A; ]& V; t. @; E        travel to pickaisle.con(A_i)- o1 Y; ?3 z, ?/ A" ^9 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  ~( F0 U7 J/ ?4 s  w) D' P% p        else wait for 10 sec/ u/ O) w+ v( {" r6 R8 S4 A
        if A_i=A_leave then send to die, o0 I2 J8 J% E$ X9 k
        else inc A_i by 1
5 S" H- F) t9 i    end$ W; [) W% U$ H! y9 Z% O
end
' C9 m: X" k# i. Q( ~7 p: B2 I1 R0 ?1 _3 J
其中的procindex为整形,代表当前process的序号。3 o- T$ U1 ?! Y
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-13 06:44 , Processed in 0.021954 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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