设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12707|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 v2 T6 m1 [: D- m# }: y1 r! e( H! f8 l% C' i% k( l( r( 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中的数值,不知道会不会有什么不妥。& X% O( I2 `# F! Y3 _
. D  `  H- ~# Y/ y
begin P_read arriving
8 B- Q* S- u$ O    while 1=1 do begin
$ A6 A( h* k- |/ [) x. P        read A_tote from "data.txt" with delimiter "\n"
8 p% l, ~6 r6 j9 }0 G        read A_time from "data.txt" with delimiter "\n"
7 B* Z1 z$ |' g' M        read A_leave from "data.txt" with delimiter "\n"
" m( B+ t4 m8 i" V0 r0 d5 ?! L# |        read A_picks from "data.txt" with delimiter "\n"' r) D/ q2 f# u( o# b: ]
        set load type to A_tote! d$ {" b. V6 H+ J( u4 j# r" W
        if A_tote="tote 1" then set A_induct to 1
( C* a% h9 e4 z9 p% E        else if A_tote="tote 2" then set A_induct to 2
# O, F/ Z6 M5 W            else set A_induct to 3    2 F1 [2 c2 E, `5 Y9 a$ L1 v! z
        set A_i to 0
4 w) L  M5 }5 b! q1 |2 ?        clone 1 load to P_induction. ]- M$ q$ q4 V+ F
        wait for A_time sec* @: y) |! E. g6 a
    end
; g! x+ |. F2 kend5 T" {, b9 Z+ D% b% ~6 n

1 J; e3 g  E8 [+ L! ?  z4 t) D2 l+ Hbegin P_induction arriving  Z2 R5 z$ W4 I" J/ a
    if A_induct=1 then clone 1 load to P_pick1
; c/ v% t6 Z& Q5 m+ g' H    else if A_induct=2 then clone 1 load to P_pick2
: A5 h; z$ \* x$ o8 u) {5 K, U        else clone 1 load to P_pick3  @! {3 B8 y8 _* X, X% f
end0 Z$ J4 x& B2 I  a: p
( i; `# H1 a1 J9 b0 q
begin P_pick1 arriving
' ?& S3 Z) h- D" |0 k: M% n' A    set A_i to 1
8 [9 `8 s* ^2 T4 o1 Z    move into Q_induct1
0 ]5 C( R$ [! a$ B: @+ u9 _7 x    move into pickaisle.induct1
( }' A2 k. E! U" ?0 v- v- G( U1 `( w    while A_i<=30 do begin
1 L/ _& A; ^- Q        travel to pickaisle.con(A_i)
8 M6 ~. k$ I) C) f. Z& L3 x& J( ?. ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- K3 _: c* r3 _4 P2 ~3 F5 u' E" ^% \        else wait for 10 sec6 A& k5 T' }8 A5 w, W& j9 q
        if A_i=A_leave then send to die4 ~7 L% ^0 j5 t. b3 E, ]2 k) \  a
        else inc A_i by 1
1 [6 n9 V5 E  h6 M( Y, C, p' ^    end+ g4 w$ G! g6 H& q6 {, d
end
4 h) T8 L8 O4 |0 s
! b8 x8 I# g1 x0 s6 ]begin P_pick2 arriving
. T. v7 G# }4 N7 y. Q, C' c    set A_i to 11' J9 [5 c3 K% A3 x) y
    move into Q_induct2
9 E& D  Z2 ~1 C8 |( }! l! e2 r    move into pickaisle.induct2+ p( p8 n& |7 j5 y5 R; _. x( r% X4 n3 E
    while A_i<=30 do begin
( p5 H. B3 t+ n8 v9 ]  c6 [: i        travel to pickaisle.con(A_i)* `7 V- S- Q! n, r, p: X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 ]2 n9 V5 ~% P+ v  o. W
        else wait for 10 sec2 k- S# C3 A& C! P* m& G
        if A_i=A_leave then send to die* b# F! P  X; Y: I; n! R
        else inc A_i by 1  ~) u6 a, O5 M  K# y
    end) S, ~. n# K6 ?2 H
end
* t6 R" _  N1 T: c8 P3 |) b3 K$ M& I* R% Y
begin P_pick3 arriving+ M9 w; M  I3 ]9 B
    set A_i to 21
  P+ e- Y# p7 e. u5 \6 U8 f1 C0 h    move into Q_induct3
2 |# G: J# I9 k0 q( Q    move into pickaisle.induct3
7 C% F. A/ N- b7 l9 B9 G    while A_i<=30 do begin
1 r; y0 F: P9 X5 O, q4 v        travel to pickaisle.con(A_i)  w. G4 P! w! q7 q1 _- Y5 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 r5 A* R5 _6 g: a+ |
        else wait for 10 sec5 |) ~% o3 ]4 s
        if A_i=A_leave then send to die& E' m. U4 s) n/ B
        else inc A_i by 11 g. p9 [3 G7 N; v0 U) c3 ^0 I' r
    end7 y$ d- s& m* l) W6 N
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是个什么东东?
/ k( W: p( @; t+ _% Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 k# e2 Z& h  u5 q& V6 E
2 Z: n& D, K$ |; }  T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) X) R6 _# C6 Z/ w1 k1 a- D

2 `7 J6 J/ O6 C另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ t  M# ~7 Z2 O% q0 t: [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' D  @( U5 S5 n6 p4 b1 o) y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 K0 z; w3 E3 ]8 ]) A  S8 `
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- h0 `/ ]- Z5 T% r+ }. Obegin P_induction arriving0 l# Z+ S) k  L4 o) R% v! T
    clone 1 load to P_pick(A_induct): Z0 f5 s" g" P0 Q; U% e
end最大的系; @+ z7 \  r6 X  c
9 y3 E. [; ~, z9 `% U
begin P_pick arriving6 D, j2 S2 d& J7 \- m( U% H
    set A_i to procindex * 10 + 1
% W- W- y7 L$ {$ u  y: m6 u    move into Q_induct(procindex)( _. L9 W6 m) Y) J' Z3 A
    move into pickaisle.induct(procindex)
7 v# A1 [0 Y, g+ ^: J4 P    /*check the type of pickaisle.induct(i), for your last problem.*/
* m2 j. H9 U' `$ `& B% N
' B2 D. n" a' a    while A_i<=30 do begin
' k( j# d& ^; a2 x' S        travel to pickaisle.con(A_i)1 o2 H; A7 k' V4 x3 e. z5 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' `, S" }% j& E/ }0 R3 Z$ ~
        else wait for 10 sec
8 F* g& b/ K5 I        if A_i=A_leave then send to die) E% V! I& {! }) m, C0 S& v
        else inc A_i by 1
1 e) Y+ D# ?; C" j( y- N4 K    end6 R4 y5 R( H$ R
end& w9 n, p$ b2 U5 B( d1 L/ @9 u
) \; x' z- |* j* a6 t! z
其中的procindex为整形,代表当前process的序号。2 C! G0 v4 Z, 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-2-13 01:30 , Processed in 0.015420 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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