设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12619|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 z" K' T! H; H: p7 w6 g: J
/ I- i: w. Z8 W3 B* k7 G% j! K- k/ S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 ]% C2 R: s& o. R) l9 c# ~
% b3 k# n( c; |0 b2 S) gbegin P_read arriving
8 z$ I& z' z+ M6 B7 q( s: y7 E0 o& v    while 1=1 do begin6 B: e2 \. {' r, B: a
        read A_tote from "data.txt" with delimiter "\n"
' u' R5 n( z* C1 e3 `        read A_time from "data.txt" with delimiter "\n"
, U6 g7 T2 k3 D4 p4 V0 F7 i        read A_leave from "data.txt" with delimiter "\n"
% |1 H* T8 g! k4 m/ X; q# _$ W        read A_picks from "data.txt" with delimiter "\n"
* {/ \+ r5 `, ]3 U; L3 m  Q        set load type to A_tote& [% V2 O9 b& Y% D
        if A_tote="tote 1" then set A_induct to 1
. O/ S) \! X( ^  U! c        else if A_tote="tote 2" then set A_induct to 24 d4 z& ~* g) Z! n
            else set A_induct to 3    1 ?, n8 B* a* g7 U
        set A_i to 0
! G+ W+ x, R! h1 [% L1 h        clone 1 load to P_induction" V# E# i. C8 V/ {% N1 d
        wait for A_time sec7 b2 Y) U* O! i8 P+ \2 A
    end
' i1 S6 p5 H$ @) W3 F5 Qend
  g4 [- p7 L% W8 Q" g, A
7 A) C- G: T/ i9 [3 M" [- [1 }+ Nbegin P_induction arriving
4 Z" A) c0 _! w" e    if A_induct=1 then clone 1 load to P_pick13 r% r6 [4 |$ ~
    else if A_induct=2 then clone 1 load to P_pick2
8 M# H3 K8 f/ I# o) O$ g4 K. r        else clone 1 load to P_pick3( v1 k# R% }3 U' n
end" d( X: x) c9 k* D: Q. D" ?* X
$ [0 L7 |5 L0 z2 i, n
begin P_pick1 arriving
: ?  A$ d$ z" T  k: V; i* e% Z    set A_i to 1
) o0 E: l7 t% J    move into Q_induct1
" t, i  p8 C. R! \# W9 _    move into pickaisle.induct19 k6 \$ h7 b0 a
    while A_i<=30 do begin7 [! n  L! u9 H
        travel to pickaisle.con(A_i)
; ?: c6 Q: {. c; V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' Q$ R. P( l9 i, ^2 e
        else wait for 10 sec
+ {% C# f$ ~: B7 [  m% M        if A_i=A_leave then send to die
  [. p2 _( q) x6 ^        else inc A_i by 1
4 }- h! ?4 n- g* c/ S    end4 I8 f( x8 _+ `/ l+ J6 i
end, N+ X+ b3 J2 _) a9 ~  `% S; d5 n
; K) R/ L+ G) Q0 u5 N& ?
begin P_pick2 arriving
0 x- k6 E* v9 R7 y- d" _: X    set A_i to 117 g6 u3 |: E! N( ~3 e! J, N- Y) A
    move into Q_induct22 B4 [1 T' j; _+ r  g" t6 Y& W/ o
    move into pickaisle.induct2
. v2 k2 v6 A. s( T2 \    while A_i<=30 do begin* h5 w$ G' z/ l9 D. u
        travel to pickaisle.con(A_i)$ H4 o$ o5 B8 D0 f8 D0 s- p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) A3 g; u! _  y( L3 `# X+ [        else wait for 10 sec5 b2 A# E- l" ^4 r) w) a6 v
        if A_i=A_leave then send to die( \3 Y! T$ {/ o
        else inc A_i by 18 w: M" i% R4 k0 ~8 t
    end3 t* o5 P+ v% M
end; s( M, ]% R5 ^9 Q8 E
3 k  Z  ]+ V( \" \4 `! K
begin P_pick3 arriving( F+ B* M8 J) U+ g2 x8 V3 y  E. ~
    set A_i to 21+ y# h8 }0 d2 r% x/ h1 S$ G  `" G1 o; X8 z
    move into Q_induct38 C9 Q& V% B- M6 o
    move into pickaisle.induct3( ]; b' i4 Q3 T7 l! u
    while A_i<=30 do begin' g+ v, F8 R' ?! J% t  b
        travel to pickaisle.con(A_i)
  c/ H6 e, Q/ [5 j/ ]  H9 D2 H/ g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S' U) D& q5 P
        else wait for 10 sec
& E* K- \4 z; u        if A_i=A_leave then send to die
$ z" e! C8 c8 U3 D        else inc A_i by 1
3 L8 G. @; F' y1 |; u1 `7 {    end
% d) E$ |, j. n$ x0 Qend

最佳答案

查看完整内容

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是个什么东东?
$ j, {: d: {' Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 z2 }3 `$ V5 _

: U% Q1 X% D" }  S: n* LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; z. A& q( M5 ]

7 k" Q8 X8 Y" |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- s9 @, _" n) D2 C6 ~" n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; L: l7 z  _  ]& i( G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ A' _) z) C& ~' l0 m" U+ H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" D) }3 |$ {  C( r. Q
begin P_induction arriving
9 q  W/ w, _! ~    clone 1 load to P_pick(A_induct)
# ~" J. ?; G7 dend最大的系
) w) J' U2 ~. z) _* d& k9 h: g$ R' N
begin P_pick arriving
, x% ^- Z8 ^9 U; F' Z! D: Y    set A_i to procindex * 10 + 14 e! W2 m& K. k& {6 u: i
    move into Q_induct(procindex)0 S- K. d/ B$ b7 \! L+ f& E! d
    move into pickaisle.induct(procindex)
! l1 ?  V- e" Y& |4 i$ S    /*check the type of pickaisle.induct(i), for your last problem.*/
: Q( _6 a# I6 U" D5 d  l
2 S$ B9 G8 O$ b/ B6 i3 q    while A_i<=30 do begin' e  Z7 J  T* x
        travel to pickaisle.con(A_i)
* h1 R' K2 o, F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, v  {: o# D- [9 z' W+ R2 Z        else wait for 10 sec; y* K: A* }% i4 t2 ~* g  O
        if A_i=A_leave then send to die! e- R1 @# o" a( q4 J! B
        else inc A_i by 1
9 B% \  ^. f2 w3 \' k    end" v2 Y. z: j8 |
end
1 N: u, ]4 T3 X  y0 [
& ^# Z) ^, h9 I) k其中的procindex为整形,代表当前process的序号。
- J9 {9 C+ N* \: k" Estation和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-5 11:21 , Processed in 0.017970 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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