设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15665|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. K8 H  a$ t0 [  j3 j% {, p3 r6 z$ [7 i' E) i7 a" y" V2 U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  P! \7 k/ y5 r8 \# Z3 s. i) T& e
8 y3 b! u: P% |* X6 V# Z
begin P_read arriving
- U6 {" H3 b& J% Z    while 1=1 do begin
6 m# n& H. q  p3 _8 Q        read A_tote from "data.txt" with delimiter "\n"( V7 G( c/ q. d( ~$ N1 j* C% D
        read A_time from "data.txt" with delimiter "\n"
. C3 ]/ Q5 T$ g" f) {! G; t        read A_leave from "data.txt" with delimiter "\n"3 U2 ]" e1 H! F8 n1 ^# E) t0 {6 n, z
        read A_picks from "data.txt" with delimiter "\n": {# b! P. c& k9 ]' W5 e$ K
        set load type to A_tote' `* R% ?! Q3 d2 ?4 l9 C4 |
        if A_tote="tote 1" then set A_induct to 16 `2 z" Z* U' K/ t* [2 o5 _
        else if A_tote="tote 2" then set A_induct to 2
6 ]/ u& W5 P4 V" `            else set A_induct to 3    6 M+ r5 F# j' ^5 M) a7 F
        set A_i to 01 l" V! H1 i0 k$ G) d# l7 i1 L
        clone 1 load to P_induction$ ]- n& e7 B1 l9 @
        wait for A_time sec9 q9 Q+ r, N; |6 p. a2 u3 m+ b
    end; |# Y+ g8 `% D+ d& j" v
end
0 ]' @$ \8 H' @& _4 I7 `, }( N7 ^5 A* K0 C' l# Q5 Z
begin P_induction arriving
' f% z& {( ?" o" _; K    if A_induct=1 then clone 1 load to P_pick1- o4 |" c( Z. U, {1 `
    else if A_induct=2 then clone 1 load to P_pick2
6 g" k4 k* ~1 a8 A, i) y1 l& `        else clone 1 load to P_pick3
6 f* V% z9 u4 Z! {0 u% Nend- u& U" J) h1 e
& L2 v5 W, |0 `( q" l* H6 X  n
begin P_pick1 arriving
, A+ n8 M$ k, |4 J    set A_i to 1* u. d- d$ L) E/ H3 g) e0 P
    move into Q_induct1
5 C9 r  Q& I9 @" h8 w/ ^9 U    move into pickaisle.induct1
; z2 h5 G# y# Y/ r  N8 Q    while A_i<=30 do begin
/ {. C6 D& f7 o$ Y8 w" f        travel to pickaisle.con(A_i)8 g$ Z: S4 Y: p' [; u% B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# o% V: T6 E7 b& v" G        else wait for 10 sec
2 b2 [6 V! Y" ^- @/ N        if A_i=A_leave then send to die
8 V7 o- v; r- H* X        else inc A_i by 15 ?0 L- f% C5 p
    end) j! _( [7 G% ]% g( {) Q$ H
end
- a, _1 H" _9 _: w. J* n/ w* P1 E& |, h  X, O6 |( `% W: Q- \$ c$ f
begin P_pick2 arriving
1 F% S# @! d1 T$ V2 A+ H# y8 u1 R    set A_i to 11( O; H6 }0 K8 F; L  Q
    move into Q_induct2/ R! c+ I- B# [( l+ p' e; o
    move into pickaisle.induct2. ?5 G: r' y2 P$ X8 p$ n
    while A_i<=30 do begin8 U/ j1 m2 n: U
        travel to pickaisle.con(A_i)) y. _8 m3 w# g- R6 m9 g5 o: W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 F# N/ O5 e) L# L3 w7 `5 G        else wait for 10 sec' K8 l* V: P3 l/ V: V
        if A_i=A_leave then send to die
7 L  K6 b& A" O, @8 X* \        else inc A_i by 15 G, n2 ^# |+ l
    end
. _: A$ `  m: Eend$ R! C% o! s2 f1 n$ y
8 Q: L8 D! T: e( y& y( q" Z4 {
begin P_pick3 arriving+ w/ a8 m: x4 t
    set A_i to 219 n; v- l" m$ C0 I; A! A; p
    move into Q_induct3% f+ u! B% p) h+ l8 v4 l$ h2 u
    move into pickaisle.induct3. l0 T- W( b; c6 V$ H, X
    while A_i<=30 do begin
& ]3 k2 m& f1 }# f1 Y/ `. v% t5 j        travel to pickaisle.con(A_i)
0 s* r( W! N8 R0 x, `5 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  H$ n- o; E% J! C! q% V        else wait for 10 sec
9 s+ R! {: m( |) u' ^1 t; }1 ~& ?        if A_i=A_leave then send to die& }- Y0 G6 l9 ~6 E- {4 d2 F
        else inc A_i by 1
# G, }& ]. i5 S+ |% K/ e  x    end
* b; p0 S6 L  O2 f  y' {: send

最佳答案

查看完整内容

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是个什么东东?& m8 a3 V( n% V. x6 \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 S2 t" V% H4 h) s  L, a
6 K  P2 [! o8 a" [" y+ r- PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* n5 U# F( }- `% T2 w7 G/ l  ]; S7 Q4 k
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 w; j# D/ S$ x. J2 c& e9 x% |2 G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* P! e1 P; {/ ^. E
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, p' {" n/ t, t: c+ `( q" a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- }% `5 b3 z; e1 n5 P9 Sbegin P_induction arriving, U3 q7 O1 h$ P: Q8 [5 l, Z0 i
    clone 1 load to P_pick(A_induct)" S- M$ O. H* F$ |: V
end最大的系$ u/ @) S% C0 x4 ]( ~" I% ~3 Y' ^
& H# N7 F+ [# I' M. g! r
begin P_pick arriving, F- J" n: N& |) n0 j4 q3 i1 o
    set A_i to procindex * 10 + 1
. j0 a  S. \3 `    move into Q_induct(procindex)! o0 R% I/ W  T& B& H; b( h4 H* }
    move into pickaisle.induct(procindex)/ w% b+ v6 i. T( W. q# k
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 M  d' ^- ?, d2 `2 D8 i: k+ j: N3 {/ u' M& m% i6 V$ T
    while A_i<=30 do begin
' w' W, P- A7 N$ a  v( _; g) n        travel to pickaisle.con(A_i)
0 U" ?! o! ]) t' y/ [& N$ X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 F* i( B+ ^, _
        else wait for 10 sec4 ?* y! A% x9 P* R
        if A_i=A_leave then send to die* A% I3 v; T0 w5 X; Z. `
        else inc A_i by 1% [& b( v7 U" k, s5 n2 L, i  F: b
    end
# S" r: N) H9 y3 y+ J0 F) Z( tend2 e# D0 G7 B0 [0 Z
# E+ A, k; Y+ V  [8 U9 c; a) i
其中的procindex为整形,代表当前process的序号。
" w6 b# L* e9 d" ?/ ~/ Jstation和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-25 21:12 , Processed in 0.019108 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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