设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11918|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 M, M& _2 F- M+ ?& \2 ]5 z

9 m- b0 `, u0 a我的问题是,在每个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中的数值,不知道会不会有什么不妥。% ~" H0 G; `: G! J* H
7 |3 |$ K) A, |+ Z2 r6 N
begin P_read arriving$ S7 t0 [- O- K2 n" ^0 I( t% B
    while 1=1 do begin
; f: i- d% ~  k! q: `* [* H. b        read A_tote from "data.txt" with delimiter "\n"! x; r8 f* K3 p3 Q0 c* L6 ?
        read A_time from "data.txt" with delimiter "\n"
' T0 ~6 B/ P/ d4 A: e  f        read A_leave from "data.txt" with delimiter "\n"
0 \, a9 a7 J0 H3 T3 s+ K8 J2 _        read A_picks from "data.txt" with delimiter "\n"
0 n: y& k4 D' _/ Q        set load type to A_tote
& z7 ]5 |9 X5 Z  a0 p  l        if A_tote="tote 1" then set A_induct to 11 p, Y$ d5 E0 n; _0 ^) B
        else if A_tote="tote 2" then set A_induct to 2  `! g$ K5 y5 I% h3 I# M0 C( r
            else set A_induct to 3   
7 Y/ G) q, A- ?; T- y/ {$ n        set A_i to 0# R8 J' H5 \( @
        clone 1 load to P_induction
" ]6 E7 G' h- C4 u  a' \' W. K        wait for A_time sec
3 p* _( U+ f9 o1 O3 y' X5 ~' K4 G    end
6 i" x6 J2 _% |  pend2 y& W5 ?8 E0 {: H, v# o
+ `+ ~+ `- ~" q: [% |# f( P
begin P_induction arriving
8 _1 l. E/ I3 a$ q$ Y    if A_induct=1 then clone 1 load to P_pick1! H/ R/ ]6 G' @$ n3 x$ D; S+ e
    else if A_induct=2 then clone 1 load to P_pick2
3 V$ B8 r9 p; K5 R        else clone 1 load to P_pick3
6 V9 W) B; E) Y) Pend( G! e. c6 G& P5 P# x# o3 L* O( S

& W) k0 A; V; B6 }0 d7 |begin P_pick1 arriving
) n0 e( l0 s$ T# h+ U8 Q: A' `    set A_i to 13 E. l* e' H) Y, ]: d2 N
    move into Q_induct1( f& o$ M: _. f# P2 \7 Y2 g# R
    move into pickaisle.induct1
! j! E* {: J- `, n9 ?, x9 W+ n# b    while A_i<=30 do begin
& L; s! C1 ~0 ^- w, L" g        travel to pickaisle.con(A_i)2 K, E- L, P- |) T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, w/ F. z& I) z$ ?
        else wait for 10 sec
, k  ?+ {& ~: U; w; |7 U        if A_i=A_leave then send to die$ S8 u2 L6 a( E6 l8 v  V' e3 {9 W' k, F
        else inc A_i by 1
. a4 O  ]' n0 s% `4 `* G    end/ p, z% \- W# Z
end
: i0 T" y. Y/ v% T) m& m! K+ I4 e6 p$ M+ b8 b, b9 d+ h0 L0 `2 V
begin P_pick2 arriving
1 v% R' X, \* w0 P5 t    set A_i to 11
( o5 E- ]0 a- r( }) J3 q    move into Q_induct2+ S7 ]2 k  }8 t, G
    move into pickaisle.induct2% S5 e' Y; k: D2 S
    while A_i<=30 do begin0 z8 G6 ?7 v, q" {9 c4 A
        travel to pickaisle.con(A_i)+ \% q8 t$ _% B5 B: O* O" W4 B2 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 i: T, `/ ^+ H# f3 }% I3 Y6 z/ C
        else wait for 10 sec) q  Z; B5 @8 N1 Q' I5 x3 {6 {
        if A_i=A_leave then send to die
- E9 N4 Z: A  G: a4 y% U  Z: }: W        else inc A_i by 1$ W/ u+ C/ b, F2 Q. g
    end
1 w, u! t' B) s* U5 Xend3 ^# i# M& d# l* }. ^

* P" H/ J7 j) j4 S* V5 I4 N6 Mbegin P_pick3 arriving- l* [' Y# M9 s1 c1 ~5 i9 n
    set A_i to 21
( W9 V* m7 E' ]    move into Q_induct3# T% e2 Q5 i+ y3 G6 _
    move into pickaisle.induct3
2 i0 c) X9 i) z7 {6 z    while A_i<=30 do begin# H; k% E8 n9 }  l  z% n- B
        travel to pickaisle.con(A_i)) R3 ~* h, C0 K* \. |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ |) Z/ o: l+ P  v6 t) g. o        else wait for 10 sec5 X% B4 N* c4 N, G& a. L( w
        if A_i=A_leave then send to die
1 T2 [+ p, @3 S        else inc A_i by 11 o' I; g$ z. E+ F* J5 {
    end
- X& ]: H, U7 b. r& w, \6 y$ z+ f; {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是个什么东东?2 O( g2 y( ?9 J6 w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: C9 o3 c7 C# B2 A6 L% F* W2 H

. J5 w4 H6 Z. S/ p* O' h" \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. S! h" ^2 \! ]  Y" D
8 z  N0 l6 V  S" Z; q' T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. q3 ^+ M3 a# f- [$ O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 {" d) C  b- I9 ~2 R% f. |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; X) X9 W8 B  o/ F4 j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- k1 G3 q9 n# N
begin P_induction arriving1 e0 A! _  t4 o4 c/ q' t
    clone 1 load to P_pick(A_induct)
6 F# ?$ B! h! i4 `/ Nend最大的系% z% A+ s4 F$ Y% P3 r

" a  l# m$ W7 Qbegin P_pick arriving+ M( d+ t4 z1 `) {7 _
    set A_i to procindex * 10 + 1  l1 k$ n* s: h; v) w
    move into Q_induct(procindex)" K  M6 }& f) W4 n  w- |: x
    move into pickaisle.induct(procindex)5 d, W' U1 v/ [$ x  j: t8 o# Y
    /*check the type of pickaisle.induct(i), for your last problem.*/6 x" `& _8 c' r3 \# A2 |" S3 A

1 `6 @4 i6 M+ V' v0 c7 I- ~    while A_i<=30 do begin3 N9 ?/ j  ?  n3 g
        travel to pickaisle.con(A_i)
: S0 s; g4 @) a5 ?8 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  @+ \% j* _6 D; m! c        else wait for 10 sec
2 m0 r5 u" H* J  V        if A_i=A_leave then send to die
$ A7 w; p- Y2 U  S& L0 l        else inc A_i by 1& q; O7 A" Q/ G/ z+ Y, @4 h
    end6 e- ^: j5 s  w2 m
end
$ p2 Y  F  r& p3 h7 Q% J1 N
/ p" {4 W# b% b2 H其中的procindex为整形,代表当前process的序号。
% L) }3 N2 j# v7 S7 V- nstation和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-15 09:46 , Processed in 0.014608 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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