设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9518|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ Q; g8 h' m" d8 F4 u! W1 v
. H2 c, S3 y4 |# Y4 w9 D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 F( d5 c. ~' g6 D% M. S
! q' p- ]* h4 I5 c; u1 P8 ]begin P_read arriving% l* o% M4 x9 B9 u+ r! m4 m
    while 1=1 do begin
  B: w( N& I" Y# v7 a3 {        read A_tote from "data.txt" with delimiter "\n"
  b! S4 H+ f/ H" _0 |: z1 }" @' S        read A_time from "data.txt" with delimiter "\n"6 J; b' J7 _1 G3 @0 E& z
        read A_leave from "data.txt" with delimiter "\n"
: y+ y6 B7 o' O' C% S        read A_picks from "data.txt" with delimiter "\n"1 k1 N5 ~9 a* Z) |7 b
        set load type to A_tote! M' \" J$ R+ L( ^, d. s6 z4 u
        if A_tote="tote 1" then set A_induct to 1* `7 O( k* ~7 ~1 p2 S
        else if A_tote="tote 2" then set A_induct to 2% K% y5 D4 M5 q! Q
            else set A_induct to 3   
% D+ m2 u, I4 s  H; u        set A_i to 05 F/ t& i2 ^1 [& X7 L9 ?. M
        clone 1 load to P_induction
6 u* ~% B' _6 w( t8 h7 I8 M3 E! e        wait for A_time sec
8 _* R3 u9 l8 R4 ^    end, E$ C2 o2 L/ ~# Z
end1 M- r4 v6 Y, H- d- Q7 z5 Y, s$ o

& D) b- j! d4 Z' y6 Y. P  U- |) U; Wbegin P_induction arriving8 J* y) ^& |6 T. r
    if A_induct=1 then clone 1 load to P_pick1
) }8 p* ]7 B& l/ U6 y    else if A_induct=2 then clone 1 load to P_pick2
% w" G# @1 k# V! T3 z$ s        else clone 1 load to P_pick34 Y4 M  m) r+ x9 R9 \- O! @+ f' @
end
8 i# c8 y0 q4 M# T; V; Q
4 {+ d! C, N% I7 ubegin P_pick1 arriving6 x7 x; a5 B) {4 _9 e: p$ b
    set A_i to 1% V$ x: \4 i- q, C2 |
    move into Q_induct1
7 T2 U" g) L- O7 l' z  m& L    move into pickaisle.induct1) B3 q: J- f6 s1 |% |8 G& i
    while A_i<=30 do begin; l  Q: k& d0 O7 W" y, x
        travel to pickaisle.con(A_i)
3 j$ s6 G, x% |9 g6 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- H4 N+ q: }$ x' Y
        else wait for 10 sec
; U6 |/ j9 C- {# N, u" `        if A_i=A_leave then send to die
7 l" c* z5 Y9 L" v5 \6 x        else inc A_i by 10 c9 o7 g+ O6 [; K5 ?0 x
    end
: v; W: g1 E! ]: ?$ z4 S/ s4 Fend  k- C  i7 [! p% L

- k* T: O$ Y: G3 x, l: Q, ?begin P_pick2 arriving
6 K- V  q' m, K8 \    set A_i to 11
% a& l) {+ q1 N4 u9 T    move into Q_induct2
3 |* l+ {9 y; v! a; U    move into pickaisle.induct2; M5 \, r( M4 Q; S
    while A_i<=30 do begin
" N  y( _! i* k        travel to pickaisle.con(A_i)
9 ^5 |  Z- E* P; [9 @% k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 w+ x( ?8 H- C# g        else wait for 10 sec
) S' T( q3 Q" j' j        if A_i=A_leave then send to die
9 h  j5 Y6 `/ {3 ~; z        else inc A_i by 1
$ v9 G( h. I1 R' r; G    end
2 ?1 J9 x5 q; i) L8 aend
6 Z$ F/ N0 `! C. ^- [1 `: ?: y; S* t+ O
begin P_pick3 arriving
% o" |$ _: D, b+ N5 F    set A_i to 21
5 P6 D: U( u; O3 Z$ L4 I: s    move into Q_induct3/ D0 o% d# y2 J6 Q! l# s4 j# o
    move into pickaisle.induct39 x5 ~, _7 D3 L! R$ ?6 i& k) A
    while A_i<=30 do begin' f7 A7 Z; ?0 ~% M4 U
        travel to pickaisle.con(A_i)
7 A0 u. C6 [  y/ D2 \- C* \6 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 \  }  w* L- c* I  c* d
        else wait for 10 sec
( O2 K$ h1 p% \* n4 R) T7 D        if A_i=A_leave then send to die* D; x' A- m( T* d
        else inc A_i by 1
2 z+ j- s$ F# g4 A% m4 m# h    end
1 N. f' l" `4 @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是个什么东东?( C8 o+ x% N/ [8 }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. j/ v. r, `+ O# b: x) A4 j
) p  u. j! h' ^) f- h" j+ ~3 E
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* j( d, C) i) V* j2 J

: t6 B: P/ {1 j9 F$ X$ h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ `0 w. Y7 m. V: u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 [( b# i: |* n0 I* D3 ^2 M- Z/ ?2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 R4 c& `: r5 ]. ~2 F* M1 U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ Y9 S4 f2 c2 N- Ibegin P_induction arriving8 n6 K! U0 A1 M; o
    clone 1 load to P_pick(A_induct)
5 _6 [3 \) ~) h& Q  s4 g* ?end最大的系1 M" l3 X- Y, ^" u7 s
- O3 l2 f. |; u/ s6 k
begin P_pick arriving
/ E! h$ R- e$ {0 h" u    set A_i to procindex * 10 + 1
, K/ F3 v8 V0 P* ~( h( E  s: {    move into Q_induct(procindex)! o2 F9 a* B, l7 l$ |8 _2 \& t
    move into pickaisle.induct(procindex)* R+ N' N5 o/ \8 U' O% K
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ w5 o8 t  U+ q- C; Z, u8 u# F  K7 v1 ]; l* K+ W5 C9 l' R& [
    while A_i<=30 do begin0 j9 S, O2 V4 k8 C8 N
        travel to pickaisle.con(A_i)
: m, q* U/ Q2 _) W8 E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. x: T: o0 W7 |- r        else wait for 10 sec
7 O: D0 _! V) E5 L        if A_i=A_leave then send to die
+ J! I5 i/ J8 B) B        else inc A_i by 11 v% F1 v$ l/ h- B
    end; J$ O3 t. `4 N; r8 i$ {
end
: h9 L1 Q) T0 R3 V" W5 p8 x- e9 G6 u" F
其中的procindex为整形,代表当前process的序号。
0 \7 {; N! M/ M' L- I/ 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-6-4 05:20 , Processed in 0.024398 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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