设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12709|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 t; m: D+ W+ s  P
& W4 I- E& Q: u) S+ P  Q4 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中的数值,不知道会不会有什么不妥。
+ L- L1 ^  h' [5 l4 b
% R! S/ c2 k7 x/ E: `1 O! c  B" ~6 ebegin P_read arriving* z3 Q" o/ B, _9 y& \+ v4 G9 e
    while 1=1 do begin+ [! ?+ t; w2 e$ Q- y7 f& ~
        read A_tote from "data.txt" with delimiter "\n"
! q& m; j1 C, g6 F        read A_time from "data.txt" with delimiter "\n"
/ m! D$ L7 d3 h2 k# T4 f        read A_leave from "data.txt" with delimiter "\n"
# N* L) m" s% O9 ?8 K$ j' c+ l        read A_picks from "data.txt" with delimiter "\n"
9 T) R3 Q6 ?. o# U" v6 Y/ W% q        set load type to A_tote
+ w- y# E- S  P# M- l+ M        if A_tote="tote 1" then set A_induct to 1# b- U4 i+ T/ B. U& r: e# a$ F3 K# a3 C
        else if A_tote="tote 2" then set A_induct to 2
) r; ~$ D+ f3 k0 Y& E8 L0 |            else set A_induct to 3    : a6 ?: a  q- V# r( ?
        set A_i to 0
2 k; x; c1 ~0 t$ O# W; c: W9 u- Q4 I        clone 1 load to P_induction
+ |+ Q$ @) A+ q2 q# Z& ?        wait for A_time sec3 o# ?9 @; a% [1 d. H& R& f
    end
2 f( R5 }. {7 Q5 i. ?end
! J# D7 g/ R& H+ M" _
. k/ k; l( w) A2 vbegin P_induction arriving+ F" g* S8 R0 s7 u; Y, o$ h2 f1 O
    if A_induct=1 then clone 1 load to P_pick1; l! Q3 c6 Y8 }# m  w, R# |0 Y+ E
    else if A_induct=2 then clone 1 load to P_pick2* T/ e1 m" B& P9 A/ N
        else clone 1 load to P_pick3
6 f. n' K) q) k: n/ _0 k/ p# Gend
6 [+ J$ X3 j) m$ x: q. V% q; ]& b; D! B" J
begin P_pick1 arriving" T' P+ Q9 W8 A
    set A_i to 1, w! _; l9 b& L- R5 g
    move into Q_induct1
$ X# ]1 k" B8 A& M4 b- C) [    move into pickaisle.induct1; o3 ^, f- q( K' [
    while A_i<=30 do begin
% t4 C- W: ]; ?2 {5 m/ X5 R  {        travel to pickaisle.con(A_i)
' ~2 h# j0 O& O) q1 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) R) f& l9 ]1 E" D5 S) h: e        else wait for 10 sec0 _1 z! {8 h9 U4 ~7 @
        if A_i=A_leave then send to die
2 a3 a, `" K% {" h7 n        else inc A_i by 1
  v- r; Z% K" s    end" S8 p8 [; M" K7 h
end
4 o7 {7 |" @8 }+ R+ c7 T6 k* _  W4 p& L1 ~
begin P_pick2 arriving1 l/ o* r" C$ X8 [
    set A_i to 11) e  J5 V! m# I1 M* q
    move into Q_induct2
' ~/ K2 I2 L3 K5 _2 y    move into pickaisle.induct29 u) O1 A% d0 N& ]& t; ?
    while A_i<=30 do begin+ V/ O; C" p5 Y0 ]" a
        travel to pickaisle.con(A_i)
) j8 T/ `4 p* n7 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, v! ?0 j- d: k# {) j6 m  }8 ]
        else wait for 10 sec
2 W6 G# T7 y) u! _) ]8 V' M  f8 i        if A_i=A_leave then send to die
' l, e+ N: S! [0 Q0 F! K% r        else inc A_i by 1
, \% ?/ D2 K: o7 |3 J& |    end
' _& b5 w% c; ^* k; c! D$ W, ~, B; jend3 k5 r7 X7 L: y% A+ T
# G3 U' y9 C7 K2 G( Q2 v
begin P_pick3 arriving' }; @& v: k/ p! ?7 g
    set A_i to 21
: r. {6 M% a9 d9 p    move into Q_induct3
6 n* n: ]" ]) t4 W    move into pickaisle.induct3
% ~7 X0 w! k5 W    while A_i<=30 do begin. Q! O6 a7 P: V3 t. ~: p/ f! z
        travel to pickaisle.con(A_i)! d1 i' \5 u: ^$ W) {6 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) b: Q3 H8 ^9 q3 i0 T
        else wait for 10 sec
0 ]' X5 D- G  B# E3 j5 v, H9 s        if A_i=A_leave then send to die, \% b( w& j; P: o2 [! ?* X
        else inc A_i by 1
$ U' N6 m+ ^4 B' r3 L# ~8 [    end  [3 U' @7 g* {( d
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是个什么东东?
( h) W/ z" O$ k+ N6 Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& `* D% P/ o( o& W- `# V- W; T0 Y" t3 F- J) E; Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 K: _6 i+ g" x
1 K4 ]& ^+ T+ R1 v# L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# q% m* ]1 E$ p1 ~+ V2 u! X
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 w8 P' U. v4 J* ]3 b& f) c/ t4 l+ I2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 \* k' m: i( C, @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 y9 F& x2 ]  D0 ^+ k& a: V3 ybegin P_induction arriving
- N6 a. s$ P- B+ P5 ]. b    clone 1 load to P_pick(A_induct)9 b3 T2 o! g. @9 Q( \2 i/ d
end最大的系
* V) \( H8 K! N6 _$ v) y7 J, I* i: P5 K
0 ?, Y9 m; H+ s9 v# v; gbegin P_pick arriving
" g; I1 W# [5 P7 D7 r% y  |/ R5 C    set A_i to procindex * 10 + 12 x, ^- E! Y( E% [, h' I+ m
    move into Q_induct(procindex)( I" [0 M' i" |+ S- X
    move into pickaisle.induct(procindex). O8 g; Z5 D& n2 m! X+ J
    /*check the type of pickaisle.induct(i), for your last problem.*/
% M, a- N" k  E0 X1 F- s0 c( p) C+ F. l4 G
    while A_i<=30 do begin5 R0 T/ D/ k' c* Y
        travel to pickaisle.con(A_i)& I' _: N- U) L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! C2 o! w$ ~; Q5 J0 [7 h0 Q- m! ]7 C
        else wait for 10 sec. m# G0 }$ G+ S  P) b
        if A_i=A_leave then send to die9 P$ Q9 [0 C1 N/ x/ [5 [/ Y: v
        else inc A_i by 12 R8 F+ [5 a% o: t
    end- X  L! f: [5 W! t
end3 J& }- e7 Z; g; S

, a) N$ e% x9 V/ }) ]& Q其中的procindex为整形,代表当前process的序号。# Q/ B, Q! O. ^' a* T, }. m
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, 2026-2-13 01:33 , Processed in 0.016624 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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