设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10460|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; O( |6 e$ R. c  C7 b' V, p1 p! G5 [; f: _/ ^( y9 r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' |1 V. e9 k4 I# x" K: I  r# u" n- N9 @, o
begin P_read arriving
; ^8 H7 H$ S! O1 y7 z- e" q& y1 I    while 1=1 do begin; K. r1 ?4 D  m, a
        read A_tote from "data.txt" with delimiter "\n"
  n$ e, k  \* q: d$ f/ E& Z, c        read A_time from "data.txt" with delimiter "\n"
2 w0 t' x- U- C( m+ W9 h! |        read A_leave from "data.txt" with delimiter "\n"
8 s1 h2 \4 R  R+ g- K0 D3 F6 T, \        read A_picks from "data.txt" with delimiter "\n"$ Y& I. r8 ?* y/ e  M' h/ b
        set load type to A_tote
) T+ t! k1 v! R  f        if A_tote="tote 1" then set A_induct to 1
4 m7 j  U  H/ A8 S  q" [8 e        else if A_tote="tote 2" then set A_induct to 2
9 q3 @' ^- D: ?$ ^6 y            else set A_induct to 3   
2 N+ b$ p4 \% h* L% y        set A_i to 0, u1 H& q/ `" T4 s" f5 s1 A- m
        clone 1 load to P_induction
8 ~+ ^) Z1 g+ {. X6 V4 [7 [: _' W        wait for A_time sec
! ]$ B4 g/ p: g9 z/ d    end8 g5 g: ?  S$ ]  I! Y' C
end
% {7 J* P5 _0 Z0 `. s8 m. p9 F# P
begin P_induction arriving
& m+ M; y" c; W/ v  a% ?) |    if A_induct=1 then clone 1 load to P_pick10 ~' \1 N8 L6 p9 m' o# d. J
    else if A_induct=2 then clone 1 load to P_pick28 k& r3 K5 a" j1 M0 ~3 c3 o
        else clone 1 load to P_pick3( A5 {4 }3 G4 ^  J' P+ b& k$ \: l
end6 o9 Y/ W' A  [+ p5 E

. F1 R4 t8 Z# ybegin P_pick1 arriving% T- w) r1 D& _! ^7 H& n/ W
    set A_i to 1
- p6 l4 P- K  y5 q9 w1 L    move into Q_induct1& n  }5 m/ d( Y% W. N  \' |3 u. ]
    move into pickaisle.induct1
8 ^6 R" ~/ Q. K/ h* C  v    while A_i<=30 do begin4 }! f- n0 e/ ]+ o, P" r# j
        travel to pickaisle.con(A_i)+ ]; M; p$ B# Q6 `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 G1 |7 n5 T$ L5 J- c0 ?. s; c6 ^        else wait for 10 sec
, C* O/ l6 Z9 d        if A_i=A_leave then send to die
1 l& |, j  |1 B- e        else inc A_i by 1! Z5 b% Z1 q8 e# A9 m5 Z
    end4 s- ^. u+ v) V8 ^
end
) w, m5 U. C+ Y6 j4 \$ r! v9 p+ [. s2 o: y
begin P_pick2 arriving
! w; o$ w/ I( L    set A_i to 11
4 Z: V/ w# R) O. u    move into Q_induct22 S/ I. W) U1 e/ A% D
    move into pickaisle.induct2, P4 K& z! @7 M& K- L
    while A_i<=30 do begin
* _4 K% k) o5 p' }' I8 a7 s2 V        travel to pickaisle.con(A_i)
$ p* p0 Y1 M9 w) ?" c8 o0 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ O9 m+ \4 n  d% p* k# ^' M+ f: [
        else wait for 10 sec9 y) h' }' w- h% D5 r
        if A_i=A_leave then send to die
! z1 l" _7 s2 s' C7 ^        else inc A_i by 1/ |+ p* t: D! H/ Q! @8 K6 v1 |
    end
( b3 f% n, [: A# W5 c* hend
" U; k; a1 U+ E2 ^$ N! C
# C/ ?( I; I& K# w! Z- Rbegin P_pick3 arriving
1 H7 Z2 |. L9 C9 e    set A_i to 21! B  K$ [: {) S3 v
    move into Q_induct37 u% E6 j5 K2 n( p. Z! K7 K) Q( X
    move into pickaisle.induct3
2 D8 r  w3 n  v5 q. u1 k& B    while A_i<=30 do begin: f4 P* I9 L5 W: C
        travel to pickaisle.con(A_i)9 c3 J& c" X' ?9 B- p- |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 T1 q: u+ e+ p5 ^
        else wait for 10 sec
) g5 J# _, @7 A0 K1 w6 s% h        if A_i=A_leave then send to die
* c, x! H' Z5 p        else inc A_i by 1
$ K) w- n4 [6 g; \    end
1 H4 ?; r6 D/ Q7 C8 M7 Z! Kend

最佳答案

查看完整内容

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是个什么东东?! o+ u! h: h% w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% ]7 ?$ R' }4 m6 r& w4 |7 \& e- N, H: ~+ R- W$ B
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) _+ G- C5 a7 |* a! _' `# Q' v

( @  c; y, l* e) ^: o$ V1 x2 k另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 ~1 C" i- s, h+ x8 @3 s1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% V3 R+ ?! A# R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  i8 {  T: U8 u/ }) R% [7 ?6 ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" R1 C* O# i4 C+ U" t# [  l) qbegin P_induction arriving
; @! y% c& R7 u( |) B; I5 r' j* g    clone 1 load to P_pick(A_induct)
: Z" V* p3 R/ H8 M* |- ?end最大的系4 H0 f/ A. }1 G  @7 J/ q1 R

& O) T  ?" Q9 ?2 X0 v, M+ v$ rbegin P_pick arriving
9 C% Z( x" Z2 ~8 }+ G5 e9 T5 x    set A_i to procindex * 10 + 1
8 u) u. }; {. H: a    move into Q_induct(procindex)
3 |& i  [* C* K    move into pickaisle.induct(procindex)
! f  ^0 L! e+ i" h9 L: v. P    /*check the type of pickaisle.induct(i), for your last problem.*/
% ~  s3 z4 i* z, [8 V* S, [# a; |6 v: x' v1 z" J- G- c
    while A_i<=30 do begin
( O! j9 V$ i# l4 R        travel to pickaisle.con(A_i)
" D6 Y4 P9 F5 U+ f( `1 o! q3 `: y) \3 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 k3 f5 F8 v- b0 Q        else wait for 10 sec
' `  l. m! ~5 k" Z        if A_i=A_leave then send to die$ W8 U0 Z- E$ j
        else inc A_i by 1
; C# t2 ^$ p# \" y    end$ o) [5 \0 T# g2 ?3 z# C5 Q% L
end4 Y% F; D$ t/ S4 O9 w

4 E6 C( P7 l& M2 v2 R其中的procindex为整形,代表当前process的序号。! S5 p; d+ l/ L4 S0 E
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, 2025-9-3 10:00 , Processed in 0.014047 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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