设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12611|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( |; X* Q+ j& d* u7 j7 ~3 `6 A: J! 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中的数值,不知道会不会有什么不妥。8 n$ ]8 T: h, {0 q* `1 ~) o

! _6 K4 q6 C  w6 A- }0 L( lbegin P_read arriving
& }( A! P* b  s8 b    while 1=1 do begin
& v! B' _% @$ s: U! \5 N! k        read A_tote from "data.txt" with delimiter "\n"1 s8 M2 B6 i2 x
        read A_time from "data.txt" with delimiter "\n"& @+ ^8 ^1 G$ v. r
        read A_leave from "data.txt" with delimiter "\n"
: ?3 B8 `+ N6 B" u: b4 o        read A_picks from "data.txt" with delimiter "\n"" T0 A" f- Z! c, ~4 ~" w4 D
        set load type to A_tote; k6 b4 r4 }( t7 J. P# W# O
        if A_tote="tote 1" then set A_induct to 1! Q9 d: y: [. b$ W
        else if A_tote="tote 2" then set A_induct to 2
2 y1 g, t2 m9 `) \* Q& ?; O            else set A_induct to 3   
% M/ a) Z  M5 z* J3 X$ b+ Z        set A_i to 04 H; X) A7 `0 z) `2 ]1 k
        clone 1 load to P_induction. I' i* o1 ~4 C
        wait for A_time sec+ D+ e8 M6 }- i; J3 y# n$ j
    end( s8 q8 y+ k1 E
end% {: p# R7 g, z2 N8 b
7 s  h+ j, m9 i/ u/ X4 a3 C/ X
begin P_induction arriving
. _9 y0 E8 H# |  [9 |. F7 d    if A_induct=1 then clone 1 load to P_pick1
" ^1 c* _' B" g0 e5 m3 z) B    else if A_induct=2 then clone 1 load to P_pick2; ]- m/ E- y; ^- D; t- P
        else clone 1 load to P_pick3- Q( y" {6 A, m! E) R" r1 ?
end2 @3 F: a# i+ T/ h0 g5 a6 l8 q# K

, X2 F2 B# d: r6 `begin P_pick1 arriving
3 C% u9 w$ M6 |    set A_i to 1
, d, }! c( u6 n: E, P: B    move into Q_induct1
- L4 s- G; u+ W5 I! U    move into pickaisle.induct1" R) f, x, C  Z9 {# u  A! v
    while A_i<=30 do begin
8 }: g( R* i! g4 X1 R2 T; M        travel to pickaisle.con(A_i)0 ~; |! X, X1 g3 r* U$ P# y, z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ]* |- [  V* A0 {, [
        else wait for 10 sec
2 x" ^- x  E  z        if A_i=A_leave then send to die
4 Y. |* \( }; x; ]; t) z9 \' z, {        else inc A_i by 1( l& r) x1 l) R+ M
    end4 o7 Z! B, G3 ~$ D3 w- h) z- O
end$ U- F, \# s: Q3 @/ e  l) w

! r3 H4 M" W! jbegin P_pick2 arriving
6 n' m8 C# l1 H    set A_i to 11
: y# V- K& v7 k# ~  c/ T    move into Q_induct2
0 H, f* s5 d$ L6 W! ]    move into pickaisle.induct2
+ W% O- z. q6 n    while A_i<=30 do begin( E* |9 `/ M9 T+ j. _
        travel to pickaisle.con(A_i)- A0 Q, [* S  D- b$ w8 w( Z8 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ C3 t# T7 ~- Z$ t5 q        else wait for 10 sec6 k4 H# Q1 Q- c6 F6 D- X: b# Q" K3 }/ Q  x
        if A_i=A_leave then send to die
% I8 O$ {' N( E7 R        else inc A_i by 1
( S: N% @. ?7 ]5 M  e- [! B; o+ M: a% @    end
# a4 s6 b# t  Z& y" D0 B; mend+ B8 O: x) W0 ?, f" E) I  ~/ A# v; m$ d
1 E6 k. O- V% T& e  A
begin P_pick3 arriving( y9 y8 h+ A1 n' E$ v5 Z* p+ I
    set A_i to 21! X4 f2 D) d! E
    move into Q_induct3+ w; p3 B$ q% x% g2 }% A: Q1 q
    move into pickaisle.induct3
+ e  Q* D  U$ q/ [$ d& k1 @7 {    while A_i<=30 do begin
7 @8 s, s0 J. A) B3 x% m, _        travel to pickaisle.con(A_i)& x% ?7 N( _9 l2 L8 ]1 w0 g$ ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ~" n( ]7 }( A+ s1 Z" X        else wait for 10 sec# t; E, m" G8 `; E9 g0 z$ o
        if A_i=A_leave then send to die6 `$ O6 ~! w  h0 K
        else inc A_i by 1
- b& n! k9 ^- w# V% e6 L    end
- W) _3 K5 s. ], mend

最佳答案

查看完整内容

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是个什么东东?
% I/ r9 a# Y/ A) e+ \move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ C0 L# q) @. _1 ]( l" g* a. [; n
. {& K) G. o) G0 W8 O7 ?1 z% I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 q' [8 m+ f! _/ j3 X
8 `( {6 R2 B% U# E. B: e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* i+ g" t3 p; U* V% n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: f6 t4 s$ X8 v# q& R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- B4 T( X1 ~" {5 m! R/ r+ D# W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 R- K6 }9 Y& m! B0 `
begin P_induction arriving$ A, I+ ]2 D# u" x8 b
    clone 1 load to P_pick(A_induct)
' X( E$ L+ i9 x1 `3 xend最大的系2 z/ ~# e3 k9 M7 j+ }! j* i
! C+ j/ C0 l) ]! K& d7 s
begin P_pick arriving+ `8 e% E! r- Z; m5 @$ L' B8 G
    set A_i to procindex * 10 + 1
2 A6 U( S  j% b1 E0 ]    move into Q_induct(procindex)
2 }3 |$ }9 m4 a% o9 P: K" p8 d, K7 c    move into pickaisle.induct(procindex)
' }* _. C, U/ N    /*check the type of pickaisle.induct(i), for your last problem.*/; N. @2 Q1 N9 C  S0 M
: m6 x+ L: t/ V" l! S- s0 w+ X- I
    while A_i<=30 do begin
; b! K+ w; ^( R. \  X" l* G0 _: I        travel to pickaisle.con(A_i)- I# E9 U" `" P3 h! k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% h) j8 L  i/ ^# K* m        else wait for 10 sec
9 u+ W" a+ E: F1 Z& y- k        if A_i=A_leave then send to die
" e: \+ E2 G  c. C        else inc A_i by 1' S0 F( M" X, O# P+ }5 e% {+ I9 N
    end
$ x8 @# Q8 Q' J* {end2 O6 g; e' z) \2 l1 Q$ u* b
. @$ l( L1 e4 K& o
其中的procindex为整形,代表当前process的序号。
7 U& }9 ^% k2 I8 Dstation和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-2-4 16:31 , Processed in 0.017453 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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