设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15506|回复: 2

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

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

' Z8 ~6 d- b% N% s' X6 r) B我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ c0 |1 [& M# A; m, N

; T! D. C% k0 {- S2 K" C8 H& }# {begin P_read arriving
% }/ N& t  N+ P+ |  u    while 1=1 do begin9 T5 Z; S' Z# d2 r' |1 [
        read A_tote from "data.txt" with delimiter "\n"
1 ^4 C& R3 C$ M+ I  v- t0 k$ _        read A_time from "data.txt" with delimiter "\n"
/ B+ \$ Q2 L. A# p+ w        read A_leave from "data.txt" with delimiter "\n"$ Q. K3 e' y" `; \! Q0 |- f: L
        read A_picks from "data.txt" with delimiter "\n"
4 X+ z+ g( Y3 y% U9 K, c9 g        set load type to A_tote: G- J: j: k. V/ {6 g! ^
        if A_tote="tote 1" then set A_induct to 1
, Y: n8 _# d9 v7 n- S" }- \        else if A_tote="tote 2" then set A_induct to 2
2 m. k' t7 k0 F2 C8 \            else set A_induct to 3   
8 k, a: e9 f: G8 n" J' L        set A_i to 04 U  c! f0 f, X* U5 t
        clone 1 load to P_induction( ?: v7 y: X  S4 v5 N$ ^8 J
        wait for A_time sec
# V5 X. k5 E0 \& F! `+ H6 D6 V3 n6 h    end
# D$ ~) V3 r7 B3 r) x: Q% jend
5 d: j: `; q, P+ K6 ^/ a+ c3 c4 b
begin P_induction arriving
# s4 x- `5 Q; v! j! s) ?* |! A6 X    if A_induct=1 then clone 1 load to P_pick1! k' b/ t2 ^$ \& t$ `2 M( T" r7 O
    else if A_induct=2 then clone 1 load to P_pick2( q/ u% ^5 t  i6 @; v! H
        else clone 1 load to P_pick3
$ ^2 U* g  s" d; Wend9 x, O2 n8 ?1 F$ Z

% r' \, Z0 Y0 G% r! sbegin P_pick1 arriving
' @- H1 k. ]: W* E; h5 u! b* s0 Q    set A_i to 1
4 e5 A1 S5 V& D% N. i; u* p2 [    move into Q_induct16 n  Y* |* V3 V: m" M+ \
    move into pickaisle.induct1! P) U# u3 m# A6 l5 S8 D1 x0 X) |; x
    while A_i<=30 do begin
; r# p/ y7 x% |6 J5 j) W        travel to pickaisle.con(A_i)
6 w  U6 W! ?; c/ ~: O. e- H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]$ P: j; g7 B; a        else wait for 10 sec
( ?( x# w' M3 E5 M# t        if A_i=A_leave then send to die& e7 A" I" |; Q- n% i% U! Y
        else inc A_i by 1
1 @. w: u* `6 {1 e6 l4 }, V+ V    end. U( y2 r! Q$ Q4 g5 [
end- _4 j7 q+ \% {9 B% R4 [+ L

5 p6 U1 P2 k) x9 }% c8 abegin P_pick2 arriving
+ Q- I* b. P0 T7 T4 P9 v  _    set A_i to 112 E! x% q* F. L# |3 H' B
    move into Q_induct2
' {) E; k( a" F" z  b: e    move into pickaisle.induct2, o" b$ |5 F) G# E! K
    while A_i<=30 do begin1 t8 f. x9 ?0 h+ q; G
        travel to pickaisle.con(A_i)
  G" ]7 c  ^/ u  x& l5 e9 i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 y8 s9 X+ O$ k2 l1 A
        else wait for 10 sec
6 ?2 ]) H) k5 F        if A_i=A_leave then send to die
( n$ F1 e$ B' x" i; X; N        else inc A_i by 1& @& u$ P5 {  r; t8 |
    end
7 Q7 L7 E. }8 ^" ?end
. Z, X/ N4 |" m( r& p
) U6 A7 K) \9 N1 Ubegin P_pick3 arriving- M& a: ^# c7 {, N8 ^& c0 J  `7 t
    set A_i to 219 Z. x& I4 u$ a5 ^. ?
    move into Q_induct3* s* i  b. L# m( z9 k
    move into pickaisle.induct37 d% P4 i, A/ Y; {' W( p
    while A_i<=30 do begin; R* w: g0 T( i, p: d4 U  T# _
        travel to pickaisle.con(A_i)5 R( w* D8 y9 J, k6 _0 F* }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ^0 q" B6 e1 t
        else wait for 10 sec7 J! S+ \' C  h/ u. W# }2 N' X
        if A_i=A_leave then send to die- O% @- S0 S- F% x7 E& ^0 q1 h
        else inc A_i by 1
8 s6 k/ B" C1 L" o    end
. X. C, G  k4 L4 Jend

最佳答案

查看完整内容

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是个什么东东?
  J- R# a) I9 _$ z+ `5 `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 I$ \3 q- X7 y7 ?5 m  n, f" c
0 p" H' X! p) u# M5 f/ q9 Y# q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 \! d+ ]! U, N& `. h- b1 R3 ~' X
" G9 S) t+ t6 v* d  ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* W- Z0 L# u% }0 ~# M) y4 s/ S, m# Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 ^5 o6 |6 q& J' G. U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 r) n6 c, e" v3 p; f8 }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  M) v6 r. P* l% ^  L2 jbegin P_induction arriving
+ L. Y2 ^7 M/ g  I' l4 p  s    clone 1 load to P_pick(A_induct)
, R( u) s% K5 ~& L% ~1 X7 k  E% Fend最大的系
- u" c4 f: N, U. [4 w
9 v' p, J5 d6 I$ y; \begin P_pick arriving( C* E' n. L8 h0 ?
    set A_i to procindex * 10 + 1
( a0 `+ Q: U4 @* \# D/ Q$ z+ o    move into Q_induct(procindex)
0 v2 r( \9 q+ @) i- y    move into pickaisle.induct(procindex)
6 d1 J' g- l1 |    /*check the type of pickaisle.induct(i), for your last problem.*/
8 L! y& w1 F9 Y" A& w6 N( {! X
# f! O& X! e: V) T9 v4 w2 @    while A_i<=30 do begin# q( e1 t) ^, Y; |# y( I
        travel to pickaisle.con(A_i)# O- d9 i- A2 X. x4 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j7 N3 h+ a- y- [        else wait for 10 sec( g" M: I1 b1 R4 R& c
        if A_i=A_leave then send to die, I4 e( x$ h5 M  H
        else inc A_i by 1
) M/ ]/ }* ^  \4 n1 t    end1 K5 j5 b3 W3 Y8 U+ x) \* V
end* r8 F5 F% j6 X# B5 z

- v" Y& a/ B- b5 j" V其中的procindex为整形,代表当前process的序号。
% p0 Q% T( x0 R" @0 o5 k& L# f$ Cstation和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-9-16 00:08 , Processed in 4.855416 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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