设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11479|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% |& t% g# k! j" R3 Z, t( t3 g

  p. M3 t& D2 X* Z# L7 p" p& {- 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中的数值,不知道会不会有什么不妥。
  n$ e. M7 ^' V( Z& {& T9 N* r# q9 s" U( P% r; i
begin P_read arriving8 ]1 [3 n7 c' r/ D7 X
    while 1=1 do begin) v% m6 M2 m6 }
        read A_tote from "data.txt" with delimiter "\n"
8 S# E" w* F) F        read A_time from "data.txt" with delimiter "\n"/ @% [- ^% J, H+ L: B
        read A_leave from "data.txt" with delimiter "\n"$ O( s; V- x5 p' F1 f
        read A_picks from "data.txt" with delimiter "\n"3 W0 H6 d2 X) \9 f
        set load type to A_tote, o/ L& b) r" ]# T4 P
        if A_tote="tote 1" then set A_induct to 1
8 x5 n0 K( z% A! Y3 u' b        else if A_tote="tote 2" then set A_induct to 24 R' H* h( y: T1 v# y. L0 i+ H
            else set A_induct to 3   
; Z( u! ~  e, Z2 O1 E8 d# D        set A_i to 0( {1 M8 g& a; O* g' ?- a! L
        clone 1 load to P_induction
4 A. D7 s. J, n& X        wait for A_time sec
- a" F% `( a: ?    end
4 T7 I  S5 x# i3 \; Y: Tend
* J4 N- g" L" s1 r- b4 y  ]5 ~6 j. C) j" W& p: Z
begin P_induction arriving3 B* R1 r1 ^3 g- _  j# N
    if A_induct=1 then clone 1 load to P_pick1
* s& E& h8 z! ]$ |+ s8 Y    else if A_induct=2 then clone 1 load to P_pick2
. s& m5 b7 ?+ M. a! |        else clone 1 load to P_pick3# |& o+ I: i, S5 `4 I
end4 V+ W& ]8 C: Z- |8 U
; W8 X" {- p/ u* s4 q9 S! g
begin P_pick1 arriving
" H" I* q/ _* s3 F8 \! I' \    set A_i to 1% ]) {- @0 r" C/ O( {& k0 F5 }; ~
    move into Q_induct1& d% V# S& ?! b: a. O/ c
    move into pickaisle.induct1
5 ]9 \, U2 w* I2 g    while A_i<=30 do begin
1 n, l$ K: _: m: c+ I2 N        travel to pickaisle.con(A_i)) y4 i- r3 g3 N/ R3 Y) |0 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- d8 e+ A- b1 w  w, N
        else wait for 10 sec4 }) S0 z3 I; x4 @7 I
        if A_i=A_leave then send to die7 A" y, p" U) {# y
        else inc A_i by 12 f& ~6 ~$ A- k
    end
* u% u! k: k1 Y) M) Z% Nend
! Z. x# i0 V1 B4 l1 D' E. I9 T: k( b3 ~: A
begin P_pick2 arriving
$ \% Q- L1 ?7 C3 a    set A_i to 11
" L' G4 V8 `, h" _    move into Q_induct2
; n8 s, V3 m. m* q3 ?; i2 v" U    move into pickaisle.induct2/ r: @, w% U7 R. Q+ k# @: i, s
    while A_i<=30 do begin" B/ I$ g1 G7 t; Q
        travel to pickaisle.con(A_i)( O# w, r3 S9 `3 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. |* l- j/ B! b; |* k- R        else wait for 10 sec. q# H, \" `9 [6 i: I/ E( y7 g
        if A_i=A_leave then send to die$ O/ V" a  f4 ]& Z& y
        else inc A_i by 1- M) j8 g$ S  k" W% ?
    end( R; n( _8 D0 q: A9 h. s- x
end
+ p, }* u- C1 G" }" z% B5 D7 d/ ^. S" T& |
begin P_pick3 arriving
: w6 `) I- c: ~6 `" w    set A_i to 210 P$ y# X2 Y5 n
    move into Q_induct3
# u# t: a6 j" q( `5 @' s    move into pickaisle.induct3& [& R" l; ]9 C9 J# h) |' Q/ r
    while A_i<=30 do begin# j4 ?( Z" ?- Z4 n! Q/ J% e. O( F. W
        travel to pickaisle.con(A_i). K" l3 K3 S" V1 ]8 F! T0 h7 G% I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 E' e; ]6 W9 b; z, a6 `+ j4 ]        else wait for 10 sec/ g4 i4 l6 t/ n# k; S* b
        if A_i=A_leave then send to die' {. A, \, W& B
        else inc A_i by 1' p, S7 Q8 P( e# R# k
    end
$ v) \0 {6 K  {  ~: e+ ]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是个什么东东?
) z- f, c' f: B) P5 M& O! @0 |: }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# f) [) x/ b( d  a' V, o0 {
) W8 a  \! `+ |/ e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. E' M: o# C! P5 ]
9 Z. ?9 j& \6 M' l& N/ l! T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 y+ Y. B0 U, _3 p; p& c& f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 ^% I+ _; S' @6 `3 s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 T! ]; p* H, C  G; u9 W! _7 W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, R: z5 O8 u8 Y. b, j# K: b
begin P_induction arriving
: r, Q2 P: v) N8 b* o3 v1 \1 S; W' V    clone 1 load to P_pick(A_induct)
' n6 k6 a! l0 {( F2 m3 G# ]/ Send最大的系6 y$ s; k) N' p
+ ?. U1 x, C$ {7 L4 B4 J! ~7 |/ @
begin P_pick arriving
" i' W) g$ Y3 T% E9 l    set A_i to procindex * 10 + 1
' K5 a. f* }. Q5 j8 Z- p    move into Q_induct(procindex): O6 i  D1 ?8 F7 j4 f1 V
    move into pickaisle.induct(procindex)' [7 ]; Q; {  K" J" w
    /*check the type of pickaisle.induct(i), for your last problem.*/* ~6 X1 W0 z( u  j6 F, d2 K% V
  }" x$ l) H1 r, o( t4 h
    while A_i<=30 do begin/ j4 F4 ~' U2 H
        travel to pickaisle.con(A_i)
# @% @3 M4 E& ?! G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  L! V1 x& M# L! p        else wait for 10 sec1 u9 N0 {" Y; w- B
        if A_i=A_leave then send to die
4 |$ H! y4 I* Q2 p- A/ V- L4 T        else inc A_i by 1) e( @2 o- e; n  O$ F! i# }
    end
' \& ]# Y4 L, X( U2 C- rend
5 I+ A5 w9 x5 m* \9 k6 e9 y! x# j/ u1 W+ ~2 r
其中的procindex为整形,代表当前process的序号。
- P4 O7 x& A% v/ cstation和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, 2025-11-15 12:17 , Processed in 0.016196 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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