设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15477|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( H# N  W2 \6 {/ A, x4 Z! y1 S
4 Z" {9 a" }3 o1 y2 @, 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中的数值,不知道会不会有什么不妥。/ Q! ]  g) G, p
" Z& [2 H, @; v: [( e+ |
begin P_read arriving5 N8 A: A3 F  x# v& X* S8 J- J1 J
    while 1=1 do begin
/ U9 Z+ d) l4 f8 Q        read A_tote from "data.txt" with delimiter "\n"
7 _) V4 h2 E+ s. R4 I        read A_time from "data.txt" with delimiter "\n"' ]' i9 C6 T; l( {7 @% i( H5 T
        read A_leave from "data.txt" with delimiter "\n"9 ~9 }) i$ c$ ]8 p
        read A_picks from "data.txt" with delimiter "\n"
3 f. H- c- p& o2 q% |5 `        set load type to A_tote
. _/ X& E1 I9 p* C        if A_tote="tote 1" then set A_induct to 1
7 x/ N: G" J, n( g1 y, i6 A        else if A_tote="tote 2" then set A_induct to 21 k7 d2 l, X! @8 ~/ v
            else set A_induct to 3    " m9 P5 P+ ]; f6 H( V' j
        set A_i to 09 b7 |* {( g! q8 y! V5 G& F2 }
        clone 1 load to P_induction
! O6 c* ^- T' A& L        wait for A_time sec
' \8 v7 G* M. Q- F; ]    end
+ n& `/ U. L$ a1 h3 fend- Y' M7 I* [" L: I

! n. `9 c6 t. d1 |0 d6 ybegin P_induction arriving
  w; C4 x/ u1 N; p    if A_induct=1 then clone 1 load to P_pick1# g) ]- |& Q3 F$ H: U
    else if A_induct=2 then clone 1 load to P_pick2
. A: }: k0 u. |        else clone 1 load to P_pick3
; S8 K; j8 \" D5 X# H# z6 Fend
8 L+ y% K6 O& ~( g5 f
5 y7 K& E! p6 v+ ~7 g( }* cbegin P_pick1 arriving. d3 F3 j1 v! r2 ^* z
    set A_i to 1* u* R  G5 e( J# a  y
    move into Q_induct1
  z9 ^+ ^9 u4 }9 ~3 p# v    move into pickaisle.induct1$ b$ Z2 b! Q! V' H- P
    while A_i<=30 do begin
, B% z) F7 @4 y        travel to pickaisle.con(A_i)
7 ]: \! [6 s& ^- q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! O# a/ w% b; w" M' z6 Q9 l  Q% B
        else wait for 10 sec5 c, t: ^- z0 Z
        if A_i=A_leave then send to die
* R* u& h* D- X2 g+ r; L        else inc A_i by 1- \" W3 h: |5 D3 m/ K" `
    end
0 z5 @/ R) [% ^4 Y7 x1 yend$ j. y6 o4 p! Q/ z2 F1 x5 Q

/ U! K- G$ {8 xbegin P_pick2 arriving
+ f7 |8 t1 i- [1 j$ @4 Y; s    set A_i to 11
5 [# M2 Z0 s. S1 E6 I& {1 a    move into Q_induct2* v* ~7 v7 Z( Q2 v, X% R2 ^+ a1 _
    move into pickaisle.induct2  A" @* m! X; Z+ C# \
    while A_i<=30 do begin
, R# o$ x5 R9 u5 y$ N; h        travel to pickaisle.con(A_i)
4 m( d, L% I& t! @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ?. C% h7 ^- w; e) C7 G5 h        else wait for 10 sec, M) n6 }* b( B* v
        if A_i=A_leave then send to die
4 j: h; D3 p5 G( y2 z        else inc A_i by 1
& w3 V2 ^1 N5 X1 S' f8 V    end) Y8 Q1 `) Z# i& H9 M
end
$ b; l1 @3 i- p- S( j9 ]9 G: X) K# k# n- x# b) {) r4 e
begin P_pick3 arriving
2 V3 ~7 |' f! I    set A_i to 21
# u: |& @& B7 U# ^1 H7 l! I/ H4 j    move into Q_induct3
: k0 q9 T5 q' K+ r) I+ U8 n9 e    move into pickaisle.induct3
* v/ f* l9 e+ C( i% i" C8 n    while A_i<=30 do begin! J; f" y) e) I/ @  K
        travel to pickaisle.con(A_i)
& ~. S4 J0 H( ]8 A& Y2 h3 {% }  S+ m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& Z! V; }& h9 o  }        else wait for 10 sec
% {4 @. }5 b9 w" `$ _/ v        if A_i=A_leave then send to die' n+ v) {% o+ r  ]' R
        else inc A_i by 14 E: C! j4 \" \7 \7 p% e
    end
  q- R$ D7 I! h& Hend

最佳答案

查看完整内容

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是个什么东东?
% T" X9 v% u; C/ O" U% g( J# _move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# _' g6 R  F; \+ }$ |
/ ?  T' o  Y& W/ h/ @- y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( ~8 U/ I* X- {% k3 T. N
6 L* l6 q7 s) s) f, ~另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ v$ G, Q3 U* v# e) ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 a  U3 D( ?' p) h( _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ L8 c! r5 x& [9 s3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  G/ k1 R! p0 M9 Y. pbegin P_induction arriving& \7 d9 L& W* q
    clone 1 load to P_pick(A_induct)5 a! M! B- s4 N# l
end最大的系2 t- ]* V; i% J- k+ g" |/ p
0 u& O3 I1 L& Y. n! f$ c# x  B# `
begin P_pick arriving
) I( Q7 Y6 N( c! d* i    set A_i to procindex * 10 + 1
0 U/ l. V: L$ T: N8 T" V    move into Q_induct(procindex)9 f* J; @2 i9 c1 |& p: L& o
    move into pickaisle.induct(procindex)
0 ~6 I2 p0 c: l3 l( ~  I" _    /*check the type of pickaisle.induct(i), for your last problem.*/
3 L; k5 Q) H1 G# _" k
' ~7 Z+ w1 c9 i0 L& x    while A_i<=30 do begin# H6 A5 b# X5 H7 L$ W  J
        travel to pickaisle.con(A_i)+ t8 ^1 O5 p2 u! C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 R+ V) ?1 e/ p! S
        else wait for 10 sec0 K9 U0 a5 ~1 k6 Y3 @8 e$ @
        if A_i=A_leave then send to die7 E  u, Y% _' t1 A: M! C
        else inc A_i by 1: _6 e4 q: s; Y7 h* f
    end5 @& ~+ X* ]0 E4 u% Y
end. s4 s, X, n0 U" N8 v% G8 z& C
( w) x2 ]: U* L8 b# Z
其中的procindex为整形,代表当前process的序号。
% O7 i9 Z3 q" Sstation和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-13 17:18 , Processed in 0.017024 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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