设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12939|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) O) y) m6 U. O% F* O5 t" W3 g

4 q& |% H7 c6 j. [1 K# i我的问题是,在每个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 {4 P  G: H9 Z7 _
+ h4 X5 m+ _3 A, [7 T
begin P_read arriving
" s! P. \6 J$ O& N( J9 C    while 1=1 do begin* E* P# t$ H2 n/ v# l& u
        read A_tote from "data.txt" with delimiter "\n"
1 j% I1 T' L6 i2 O3 i* \. \3 z        read A_time from "data.txt" with delimiter "\n"
$ R  V3 v3 Z) E        read A_leave from "data.txt" with delimiter "\n"0 B# P4 m( B( _  a1 L
        read A_picks from "data.txt" with delimiter "\n"3 R& h8 w/ h+ I  W; `
        set load type to A_tote
* \  |& A1 m* u( Y        if A_tote="tote 1" then set A_induct to 1
7 T& D3 h  L, Z1 T9 j# u( o        else if A_tote="tote 2" then set A_induct to 2
$ ~. `! Z( ]$ y            else set A_induct to 3    9 ?1 d" f1 [* V
        set A_i to 0
0 I; @" u* ]% ^5 U3 c0 b. c        clone 1 load to P_induction
* X- @. @* S/ I# {. i# C; I        wait for A_time sec9 h+ t/ m1 j/ l9 R7 u
    end6 p* {7 U0 R  X# u. h. Q
end
, {- S8 l5 \) O6 s+ F& t
. {9 |6 g- d/ E4 m7 M1 T1 o1 d+ pbegin P_induction arriving
6 n; v6 R9 }( @0 V    if A_induct=1 then clone 1 load to P_pick12 {" N8 y8 ^4 s+ H. |6 i/ Q8 Y
    else if A_induct=2 then clone 1 load to P_pick2
3 W1 U" ~4 I1 W0 r4 w' C* g3 A9 D        else clone 1 load to P_pick3
) `( \( G) o- ]6 L; R" @! mend
2 {6 c" L- ^2 K* a9 [" }9 n  E1 e/ K  }3 o" E9 u
begin P_pick1 arriving1 W, ?, Y4 f0 z0 t
    set A_i to 1, H  p! b$ U$ _! b! Y
    move into Q_induct1# F" _/ J# n. n
    move into pickaisle.induct1+ N* y$ q; J4 b4 R
    while A_i<=30 do begin1 C; L5 Y; F0 s( {
        travel to pickaisle.con(A_i)" X! T8 @1 J9 R1 q1 w  g/ D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( j: j# V# v9 x; j$ C  f
        else wait for 10 sec/ b( g5 r  r3 p' H
        if A_i=A_leave then send to die
) H( \1 |" X6 @  |8 X        else inc A_i by 1
0 d3 G$ w8 @% q8 K; ^7 h    end
/ g+ i% O$ a9 V& b: T9 [1 Y/ H( Q, Send, {5 G: f# k) X: w" k
% h3 U9 z1 @2 G! @$ i8 L1 }# \
begin P_pick2 arriving# [) B' F8 y) _- b6 H( G2 d
    set A_i to 11% w- x  g7 s8 e$ R+ }9 N
    move into Q_induct2
  z, M7 A0 d, C4 I. Z, A! n9 w    move into pickaisle.induct2' y1 b$ a- D/ K+ {/ @( {0 K
    while A_i<=30 do begin7 O* s) r( i' O
        travel to pickaisle.con(A_i)
. B( }1 {* }7 C- I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; z; l; d* m7 i2 Q& B
        else wait for 10 sec. M5 {4 o- i2 ]# ]* g2 a
        if A_i=A_leave then send to die2 H' E' h# e! ?; x) d& @) ?6 ~  \% n
        else inc A_i by 19 p3 ^2 t9 J& f& N5 `
    end* q' s% Q- l2 s  w9 F+ y) l
end
# w4 L8 T' G- V1 c5 d
% m& M6 M) u+ K  C6 N2 obegin P_pick3 arriving# V8 g# B1 m, D3 }: d  K
    set A_i to 21
8 ~8 n" O  r# L6 _/ I/ N9 `    move into Q_induct33 l  ^+ v+ ]( R& a
    move into pickaisle.induct3
. w; C; R+ J, y5 B    while A_i<=30 do begin5 z6 \& J: `$ j/ x/ s& J
        travel to pickaisle.con(A_i)
( V: r7 O& h4 c* m1 `, b& T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 A8 X& E( e6 Y' I  J- o
        else wait for 10 sec7 }& l+ S- H1 Q  C* N) h
        if A_i=A_leave then send to die; h* M2 R1 m$ f
        else inc A_i by 1
5 ^4 l4 h6 k, F( c; ?    end
6 F' [/ D' \/ Q0 Pend

最佳答案

查看完整内容

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是个什么东东?
; Q$ W% C9 G3 t& ~* M9 F* qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 K5 l/ ^$ k) r7 P7 L$ n$ Q* x( v# I  f' D9 t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ r3 b8 p1 g' F) G6 o$ o5 \% }& B4 g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& g4 z# l3 _) Z  o9 H% N5 G" i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 \6 G! I+ L3 T: Y* w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. h( M4 q+ n/ q1 H0 [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 K  Q  W" r( x* l2 I/ q
begin P_induction arriving) s6 q6 y7 X, V) k) U
    clone 1 load to P_pick(A_induct)6 F1 J- A, ]0 Q0 N1 ]. r
end最大的系
/ R2 }9 W* x" E; r
! a% u/ h* Q' x/ v# S0 nbegin P_pick arriving$ P# @7 X7 Z- C; r
    set A_i to procindex * 10 + 1
# ~. }" o% a- Y3 Q' b4 Z+ M- f  I    move into Q_induct(procindex)
$ R. Q; p$ q  ?3 O) Y    move into pickaisle.induct(procindex)
& m! U# R; w8 X    /*check the type of pickaisle.induct(i), for your last problem.*/
' X- v+ u1 Q  E0 n
, x, @" |2 z: n7 r$ N    while A_i<=30 do begin
. k) ?8 k8 Q' C6 X* w% {* G        travel to pickaisle.con(A_i)7 N+ ~. T: S+ k- N4 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, }1 ^) ^3 J" P0 N
        else wait for 10 sec
* z/ O: K' U# F: F. \7 ?        if A_i=A_leave then send to die7 Y. u' I6 F8 {! I9 H9 q
        else inc A_i by 1' @* u( D0 B9 Y
    end
6 ^+ E/ r, q3 O9 iend2 ?6 X* O( Z4 E! c) ^

: [9 G  A8 M2 C$ m其中的procindex为整形,代表当前process的序号。
& J! d6 L' {7 _* Dstation和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-3-4 08:21 , Processed in 0.017140 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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