设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14255|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 N* B3 g; C7 x* L; d  ^
8 b, N% `3 [3 o/ n$ e我的问题是,在每个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中的数值,不知道会不会有什么不妥。# j, a* r9 G% S
9 D( ^7 w. C# S" t" D' h
begin P_read arriving. `1 m/ q3 N; _: D  ^
    while 1=1 do begin
: q0 s4 E8 r' `        read A_tote from "data.txt" with delimiter "\n"
* t+ H, T7 n. L+ X0 ?+ Q% h        read A_time from "data.txt" with delimiter "\n"& q1 s9 T. h( t7 B3 I
        read A_leave from "data.txt" with delimiter "\n"; N0 O; b" ~- `3 c8 ~9 _
        read A_picks from "data.txt" with delimiter "\n"
/ R% j9 C0 J+ b: u' |        set load type to A_tote- y1 k% W! l+ A4 c0 v
        if A_tote="tote 1" then set A_induct to 1" h* P$ F2 o: r4 \1 r# Y
        else if A_tote="tote 2" then set A_induct to 2. Z6 j: R8 e# u, l6 A! f" a; U
            else set A_induct to 3   
  j9 M( Q  d5 t1 {        set A_i to 0! B& F6 \* V- X$ B* T
        clone 1 load to P_induction
& X. l) }3 I$ h, F3 [3 y3 L8 K        wait for A_time sec
# ~0 o9 I9 o4 }9 P9 n    end
8 A/ b; k$ _" k4 ^& t9 Iend/ h" [; r* W9 Y- h0 V

" W, q& |; w4 m7 wbegin P_induction arriving7 g) Z2 A8 c  O# ^
    if A_induct=1 then clone 1 load to P_pick1: _  H# o! w* d' A# X) Z
    else if A_induct=2 then clone 1 load to P_pick2
0 V( T$ d8 z* Q, c+ C6 n8 y) C        else clone 1 load to P_pick3$ {+ j' W$ k6 r2 \5 B
end
; f% S# L, j+ B' S2 ?: G# W* B; F/ t$ ]2 v' Y& X
begin P_pick1 arriving
  P# z+ N8 A7 h- k+ p/ O! [    set A_i to 1! _! R, `9 R: B+ \' g
    move into Q_induct1, [( x8 g& X/ W' J4 D) e0 U) p$ G
    move into pickaisle.induct14 @# s$ N# B7 @4 q2 m6 _, b
    while A_i<=30 do begin
* N- N) K9 Q2 D& s$ s        travel to pickaisle.con(A_i)$ j% D( g2 e. ?) b$ H4 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ z: L! V0 z  d& x
        else wait for 10 sec) W" _% Q$ n* J% N* m
        if A_i=A_leave then send to die% `. p4 Q4 H8 k# Z7 x1 Q$ @
        else inc A_i by 16 K, x* l# r7 I, b7 _' C. g1 {
    end
% Z1 O! \& M, fend
  j2 I0 Z% Y/ |( y0 T' ~# E6 ]* q8 T* \: @
begin P_pick2 arriving) j( w, c9 `( g
    set A_i to 11
) u/ ?1 B% d0 A4 ~0 O  D    move into Q_induct2. t7 M, r+ e5 Z8 H7 ]8 l( v) \
    move into pickaisle.induct2
+ f# x1 E; ]4 J# [. b* ~4 o! {    while A_i<=30 do begin
; R& J3 \& O9 [' \  |) t$ R        travel to pickaisle.con(A_i)( `7 g* ~  K1 t! w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! _( T: P6 l# @" f" Z        else wait for 10 sec
3 X; J- C8 O% ~+ m9 }1 d2 B        if A_i=A_leave then send to die
  U6 x7 }0 M6 f( B        else inc A_i by 1) r' U: {! u; P* v
    end+ B& p! z$ ]. L( @- g4 G7 x3 y' K/ ~0 j
end
2 V7 Z7 ~- J, S7 J) C7 u3 B% ~
) _7 B: f9 I, Tbegin P_pick3 arriving
& K; W& o" _$ s. ?9 ]: c    set A_i to 21
0 A- ]: \6 X2 A; i- `    move into Q_induct3' n' z, b- x1 E1 S
    move into pickaisle.induct3- ^* E# b, V2 A& X% J0 F3 V
    while A_i<=30 do begin0 o! Y, L; k( g6 l0 `/ d/ O2 a
        travel to pickaisle.con(A_i)- L, o* n6 b8 G2 G$ w' k# q% m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B$ w2 A' t+ l8 g: h' @0 |: x8 G
        else wait for 10 sec
9 K! q" Z2 B' i' G        if A_i=A_leave then send to die& i6 x1 y) x* K
        else inc A_i by 1
. \  j% y& j; H2 w. U    end4 @; s) a" O# l: Y( G4 D
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是个什么东东?, A! k4 [4 U* u$ _/ F+ u; k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( T9 V& n$ V1 }* J! Q. H  `& y: |; T
7 n. `! j0 u5 A9 x% M) m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, N% f3 a% P+ _4 ?- Y$ h4 O
0 m- B7 \' Q! B1 c1 S* W3 K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, I# X- m" @4 p$ w) k1 i: r1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 r$ g, d, c& i6 f( G2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, G; f4 @+ B* t( r+ g  N0 w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& N2 p6 g" `4 c, \% @8 G2 v4 w
begin P_induction arriving
! b- ?3 @+ R4 X( V% o: i    clone 1 load to P_pick(A_induct)
' L  U8 \5 {; K4 E  S; dend最大的系
- L& z* e! d  |+ C9 [0 ^1 h
' o( \( I2 b( T; xbegin P_pick arriving
% p7 O$ [( K3 a5 y    set A_i to procindex * 10 + 1
: `7 |/ M* k6 M& P    move into Q_induct(procindex)
7 [+ K5 }# d$ p& Z: W9 `' X1 L$ @3 L    move into pickaisle.induct(procindex)
- g6 c. i$ D8 c4 S( N2 w    /*check the type of pickaisle.induct(i), for your last problem.*/7 A+ |& B; c8 _. u5 |8 @* [1 u3 _

; N: l& b9 x0 @, ^    while A_i<=30 do begin
' Y/ a' H; y/ A' {& X: ~        travel to pickaisle.con(A_i)7 R: C; x+ A; U, F7 a. h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 ?/ y# P( ]* G        else wait for 10 sec
- {5 u# d, |/ _! s; A0 `        if A_i=A_leave then send to die5 y9 F( @; w, j& u! f9 L  q
        else inc A_i by 1. V  L  D3 i& x+ l$ K. o" K" I, o+ ?
    end
( Q+ M0 G" m+ X. ^/ d: x5 t% |) Oend
8 D) M  `4 a  a3 P
( c3 A) b( S( s/ n# |其中的procindex为整形,代表当前process的序号。
) \  {8 m, A: m: D, q- Q# C. Pstation和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-6-25 04:07 , Processed in 0.014720 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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