设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13795|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 @( a: i4 Z* B$ ~

2 W" @( W* u1 f% ^# h8 O9 F2 e我的问题是,在每个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 e5 r( g  V8 j* a. X! P( H1 O
" C4 Z) F8 p4 B& m" qbegin P_read arriving3 u5 ^/ A# D9 e* R# N
    while 1=1 do begin
+ Z* O" [7 F/ P2 ?4 M2 d$ X% F        read A_tote from "data.txt" with delimiter "\n"
$ Z2 O2 K' f1 K, i1 m) ]* C        read A_time from "data.txt" with delimiter "\n"9 z6 Q0 U9 o1 s" n$ F
        read A_leave from "data.txt" with delimiter "\n"
( B4 k! \" X9 g" p        read A_picks from "data.txt" with delimiter "\n"
/ }+ t. H% j; ?3 u        set load type to A_tote: N  s1 j5 O% r2 v9 e4 d4 T
        if A_tote="tote 1" then set A_induct to 1# U9 p- o) \5 f6 b- B. t4 U
        else if A_tote="tote 2" then set A_induct to 2
3 m! S+ N2 J! \- e" J2 F            else set A_induct to 3   
6 z) `/ r$ Y3 p7 _9 n        set A_i to 0! }0 l. j! S" D! q5 L; j) B; ^
        clone 1 load to P_induction
! R$ B, o9 X6 q& j0 v2 W9 Z        wait for A_time sec+ y& @) r+ L' D2 Q% w5 e7 `6 e4 p/ e
    end
4 O3 L; @0 Y" {" D' Z% p6 v& yend
9 ^! x3 ?. \6 e! _
, c. Y' C' U* l+ p( [( \begin P_induction arriving1 h$ N) b0 Q1 {- \3 F( B& t
    if A_induct=1 then clone 1 load to P_pick14 _2 b1 j$ _. t6 A) W$ t# O1 Z
    else if A_induct=2 then clone 1 load to P_pick2
+ F4 }) q. M. P. n# e/ n7 c5 E        else clone 1 load to P_pick31 {9 V, [* s+ {4 A
end
2 E7 h. \- k6 Z1 X
: A5 W& ~: z0 A  {" [+ nbegin P_pick1 arriving
& L( q9 [+ g+ {) X+ d    set A_i to 1
( e1 j, e6 W8 w' h    move into Q_induct1  w5 u: d2 h+ t
    move into pickaisle.induct1' \' }3 R, Y9 ^: d. F
    while A_i<=30 do begin
$ c& U( Y* e# A        travel to pickaisle.con(A_i)8 v4 L- k; t9 {8 @! {3 @' b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 e/ y7 b7 k% g% j9 x
        else wait for 10 sec% e5 z4 V7 y! d; z+ x  o
        if A_i=A_leave then send to die% Q/ W9 v5 X4 s# |: {7 t# G
        else inc A_i by 10 u( m9 p) R) J0 H
    end/ u" ^0 P) A) Y8 S. i, l
end; X  f3 {, X7 L7 v: k

2 F: ~1 ]1 }! |" n# @1 q" lbegin P_pick2 arriving1 Y, C2 @* X2 N% f1 P; d
    set A_i to 11
0 U. X# @9 A7 _- A8 K# ?# Q    move into Q_induct2
! N5 Q5 b7 J: G8 Y    move into pickaisle.induct2" a* X" e4 H* i1 l2 f( o6 X
    while A_i<=30 do begin+ ^$ X* u) b6 P8 j' w. C
        travel to pickaisle.con(A_i)" ^0 Z( g8 W* `- A4 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, K# z; `' S% R        else wait for 10 sec$ M& C  T( I! Y: ?1 e- B4 |
        if A_i=A_leave then send to die! ?2 K* j( Y7 z  p* z+ q
        else inc A_i by 10 |) z3 c' @: S$ Q. E+ g9 s
    end
0 M- X% H$ R/ }7 \7 q$ q# Y% pend* U# z) O* m: t/ d! q" ?
0 B7 j2 k- m! _' d3 u
begin P_pick3 arriving8 o. {# A8 c7 ]! T! Y
    set A_i to 21
  H$ ]2 |. K1 j, j4 j8 x+ s    move into Q_induct31 F1 I" f9 B4 ?( s' c  P1 r, i" I
    move into pickaisle.induct3
" v" b! e$ z' v6 a& u    while A_i<=30 do begin* h: i/ C6 C" _$ D
        travel to pickaisle.con(A_i)
8 a$ I) v- p) u$ j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 {! u4 t$ h5 Q+ f% _5 \        else wait for 10 sec3 f; V9 b" C; r; p1 F8 l+ A
        if A_i=A_leave then send to die( D" Y" j+ T: w* O4 U8 |$ C
        else inc A_i by 1
( s' H4 W6 j# x" |+ r    end3 v* g  j+ d) l# r0 P: O* Y
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是个什么东东?
0 D& `! y, z3 e( }5 hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 J* Y% K! v* D" K# t: v' f9 y; b7 g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 f1 |; u3 E5 {3 f- s
) r, `: E" i4 ]: C1 }; ?* E3 F
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ M. N' \: h( X2 h9 O1 V/ a8 [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 B6 y& S* Z+ U% u4 P3 f) c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# E6 {# Q9 F) Q1 d, ~2 _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& p/ |) J, V  s2 p" M  j
begin P_induction arriving, H, n0 E" J1 Y" |+ R" Q
    clone 1 load to P_pick(A_induct)
2 N$ L; s$ M) n- D5 Tend最大的系
2 ]) `# x4 |: d. M0 P( n7 y, d/ {
begin P_pick arriving' Q: Z( `/ u/ K' S1 q
    set A_i to procindex * 10 + 1
& b. k" ^( P. R) V& T% j) v    move into Q_induct(procindex)
0 t% ^0 ^& n5 l7 @/ o2 I    move into pickaisle.induct(procindex)
' ]! W/ O( R6 N! E    /*check the type of pickaisle.induct(i), for your last problem.*/
! t- ]* C& p6 e9 \+ K; V. A+ P+ F1 R/ u/ Y% Q, ]
    while A_i<=30 do begin
/ ^4 e2 m! N  u- N$ C' i0 R  a7 r        travel to pickaisle.con(A_i)
, \$ z0 I5 C; g8 K0 R- l& ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) F  g+ J9 `& y6 R2 i7 [, a        else wait for 10 sec
9 m( ]& M" a5 R8 j( g% m0 Y" V. u        if A_i=A_leave then send to die1 ^7 Q; S6 Y1 s+ X1 |7 \
        else inc A_i by 1
! `4 n2 c8 B7 W, G4 K$ {( c9 F+ ?    end0 W' e! _: u1 o* j. }
end
- O/ b2 o: N4 d$ g3 I: M! Q# K$ d  b; T1 P& s" }! n8 l$ z1 x
其中的procindex为整形,代表当前process的序号。
4 ]; Z/ x; u6 c1 [: @7 T6 A# bstation和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-5-6 01:49 , Processed in 0.017890 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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