设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13884|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% t+ q' B' I* u) ]
. p( @$ |$ G7 D( _# V9 r. F  X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! J& ?' z. g5 O

; n- P( `* H' A$ r+ Fbegin P_read arriving
9 h" x& K) N& m- u    while 1=1 do begin" h+ N- f1 T; f% }& b2 k
        read A_tote from "data.txt" with delimiter "\n": _% @4 A. ]1 h( u+ F, t" i
        read A_time from "data.txt" with delimiter "\n"/ ?8 t  _9 N: V3 u
        read A_leave from "data.txt" with delimiter "\n"
0 p+ m# @0 P9 k; v9 j. ^        read A_picks from "data.txt" with delimiter "\n"
$ O5 {" ~: r, s: d        set load type to A_tote8 c; h8 Q! x( ]3 ]5 ]1 v0 ~
        if A_tote="tote 1" then set A_induct to 1
$ v/ P3 a4 D& l' c+ K        else if A_tote="tote 2" then set A_induct to 2* C/ \6 `: j- ^" k
            else set A_induct to 3   
/ W! }# x/ r* R        set A_i to 0
- E! P. A% |1 b( d1 [$ ~( f        clone 1 load to P_induction- U$ f; [# {) M9 _* ]; K# S
        wait for A_time sec
( Z4 V2 I) p; @' z4 s, T; J    end. w; X: k0 Z. t
end
6 _- O, m9 l, r' S' h2 o6 @& x
4 t6 ^+ }( R! g- |& p( N4 Lbegin P_induction arriving9 k5 Q& h& \! m) ~0 r3 w3 n
    if A_induct=1 then clone 1 load to P_pick1- R, Y2 S. F$ {; V$ H) q7 {
    else if A_induct=2 then clone 1 load to P_pick21 o+ i/ s" A# I
        else clone 1 load to P_pick35 O5 T' Z$ z' P0 K
end5 W. \* _- y7 j8 }, Q% ^4 [
" _  `! T$ d, [1 _
begin P_pick1 arriving' E& H; B: U2 P' I! g6 r
    set A_i to 1% |; G8 c- y, b/ {
    move into Q_induct1
+ G9 D! {$ c2 i0 `    move into pickaisle.induct1
* n) ^) I& M1 A, @  J: C" ~    while A_i<=30 do begin- L4 t- J+ q. N; A$ _6 M
        travel to pickaisle.con(A_i)
2 K& A( O) @0 u) v& m2 }2 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* D0 u) b6 o6 C" X
        else wait for 10 sec
2 [; h6 N4 J  Y( E2 X        if A_i=A_leave then send to die* Z, @- p# e( h# z$ J9 p2 R% a. G& @
        else inc A_i by 1+ C/ ~: g4 Y7 n9 X
    end% A! f: h9 T* K" P1 |2 k! n
end( p& e! x4 M0 }7 |: A# `

; Z$ v( Q1 ], f4 G1 S4 c! d9 vbegin P_pick2 arriving
# ~3 Y( Q& v. p    set A_i to 11
  j& ^2 U$ `8 n' D    move into Q_induct2
  ~8 B; W/ K8 Q( ]. |    move into pickaisle.induct2
2 ?4 V* V1 s$ y7 V    while A_i<=30 do begin
' D8 l- h, q: s- j$ _( H( `0 l- c        travel to pickaisle.con(A_i)
- c' N. Y- y% k- i2 f  {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; V2 c: e. x# j$ x7 A        else wait for 10 sec
6 \3 c/ J+ ]. R8 D- H* W        if A_i=A_leave then send to die
% I. o8 t& S& ^8 ^        else inc A_i by 1
3 @% b1 [; U5 a0 u; [$ b    end
7 S# y& m  Y- [end
) N) a7 Y5 w, n% ~
- |& p6 h7 r, _+ u/ g2 W# ^begin P_pick3 arriving$ i3 p- u6 _# f. f
    set A_i to 21; m" Y+ @' W/ L! z3 v
    move into Q_induct3# Q3 A  ]7 \( j% m
    move into pickaisle.induct3
* b: f; J8 E# t2 E    while A_i<=30 do begin: x- v1 v$ y# d1 L) ]" e+ |# q
        travel to pickaisle.con(A_i)
" q! }' P! O* H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ Z) x( D( J6 x6 u. Y
        else wait for 10 sec- _3 h  U# p( b; t, b2 L
        if A_i=A_leave then send to die
1 `5 y+ R% A* d2 O/ U        else inc A_i by 1' D3 e3 H% W% Z# W
    end% g8 K9 A) z, e4 s7 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是个什么东东?
6 v5 s' t% R* J  `, A9 Q. ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' @8 V- K5 o& F* ?
$ j% d# ~% s* C: {AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 K; Q9 S$ `5 J
4 P' i; q! {3 G" |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; Y! b) \) X+ p5 V% \3 \# `1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 o; j7 t" r1 ]. h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ I% s- K$ y( R6 l3 {5 w3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) U/ w8 T( C5 w$ S. wbegin P_induction arriving
" U+ b5 P. G/ z7 l    clone 1 load to P_pick(A_induct)
( `) J0 c4 L9 |  {( z( tend最大的系
1 I0 ]$ E) m2 N4 I2 {! ^& C! f2 g$ A
begin P_pick arriving4 b; N' I* C, p! R" g' Q
    set A_i to procindex * 10 + 1
3 n! ?9 L2 F6 d    move into Q_induct(procindex)% L; q1 I; p: ~) Z' b  E: Z; Z
    move into pickaisle.induct(procindex)
; j' ^1 R  j- e  d' l$ a. \# C    /*check the type of pickaisle.induct(i), for your last problem.*/
) ?  T8 K! A# j. ]0 Y
$ R2 V# C9 j) w8 x    while A_i<=30 do begin# ~# ^: o' M" e) f' |8 [/ \
        travel to pickaisle.con(A_i)
5 @/ f( g. K, I  y. A& ^9 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* s) F: R" c  J3 w- l, G  e6 S        else wait for 10 sec
3 `/ ^  U  a/ e+ R        if A_i=A_leave then send to die! X) j. K/ t0 j: k
        else inc A_i by 1, t$ W4 l8 H' [* Z. Z1 u' }- r
    end
; X6 x+ c' S+ y! e: \end
+ w( O0 W& ~% s# q- [  c' U
$ L# Y( H$ c3 f) g其中的procindex为整形,代表当前process的序号。9 L3 ~+ ?4 H, E
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-5-14 14:41 , Processed in 0.018417 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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