设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12708|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* y- f& x$ M: b( V1 d/ a
# K" l, x* v3 Z% o+ Y9 G" p我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' U& ?' ^* F+ C: b& g, h, I) ~2 f* k( u
begin P_read arriving( }: _( C5 }0 |4 Z8 W7 R( G4 c; a
    while 1=1 do begin
2 W5 c  J; ?& U1 q        read A_tote from "data.txt" with delimiter "\n"7 b' f3 g& D( N/ v
        read A_time from "data.txt" with delimiter "\n"2 L; M( I: x$ ?  K4 Q9 g2 O
        read A_leave from "data.txt" with delimiter "\n"
7 R' k% e, h" E3 B; F, p        read A_picks from "data.txt" with delimiter "\n"( m5 `/ O4 a! ]+ v0 i4 U
        set load type to A_tote4 U* X- a$ d# y7 ~- X& n5 Z1 [
        if A_tote="tote 1" then set A_induct to 1- g$ f; ~# i9 t+ ~8 d6 ~
        else if A_tote="tote 2" then set A_induct to 2
; l: q. B% ]0 M            else set A_induct to 3    ! G4 ?) z" C" U4 R1 A/ L6 s
        set A_i to 0
, Q5 R; M% Q' m        clone 1 load to P_induction
! V/ J0 H8 G: J* z5 F        wait for A_time sec! }5 g! X. j: y2 e4 g. K9 K% c
    end+ Y+ X; W' U! A6 ?( C  `6 a# d
end% f, j) l2 B/ W0 P1 ]1 l

: }/ [# A' F& s; c: {( A: z  nbegin P_induction arriving
0 |# S1 ?& z- S: m$ J3 b  Q    if A_induct=1 then clone 1 load to P_pick1
7 G6 R! o* F0 }- g/ @; R3 x* ]+ L    else if A_induct=2 then clone 1 load to P_pick2
# G. l6 {: s" o5 n        else clone 1 load to P_pick3$ x- e3 x: {! Z
end0 v2 Y3 R& g0 X
2 E( _5 b7 w4 u% Q& o# ^! ~
begin P_pick1 arriving6 b1 y' i# C6 L# j, T5 w
    set A_i to 16 ]$ P* ^' F! D: J. u8 R. r9 v
    move into Q_induct10 x4 K. ]: ~( @3 ^/ _0 S
    move into pickaisle.induct1
% m3 n, \7 J$ n5 [) e; {! ~( h    while A_i<=30 do begin
7 X  K* j8 i" b7 D* _6 w- o- S9 n; p        travel to pickaisle.con(A_i)+ l9 C5 z; [  }8 G2 a; q# n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) K2 u  q4 ], V
        else wait for 10 sec1 Z% ?! `4 y! i4 u% l4 \2 L6 @$ {
        if A_i=A_leave then send to die- X* S1 A+ q+ }. I1 c) p" ~' [" X
        else inc A_i by 1' ?0 t' V$ z% n+ f; i
    end9 n* ^6 g, [) I8 Y3 }
end3 S! S5 u6 q+ [8 g

4 N, e2 P* o& }( {0 rbegin P_pick2 arriving
8 P; E) b+ y" y* }    set A_i to 11: i5 Q7 u6 K) b* d
    move into Q_induct2
4 X0 ~) ^$ m. w) Z+ A    move into pickaisle.induct2( F; r8 A; W5 y
    while A_i<=30 do begin
4 D0 V; g9 Y! b0 C9 V. s' G- ~& Q        travel to pickaisle.con(A_i)
/ k/ _4 I0 R: t7 m' l' J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  B  x5 o0 X0 P6 c, C# f
        else wait for 10 sec- M* d6 E; A# }; z; ?2 ^
        if A_i=A_leave then send to die1 q( }2 S/ s' v" n' v. G. m9 j- J
        else inc A_i by 1$ \( E& n% _: \. w
    end
/ E, [. n* ^# e: a1 g- G8 Yend+ Q# I: ]$ A5 g! n* x
+ A7 Q; Q2 ~4 g! y1 S) P
begin P_pick3 arriving
4 c  G, n  M8 |' v* E$ e" B- B    set A_i to 216 Y' A* m- {0 r2 ?( S8 p( u
    move into Q_induct3
7 e! m0 a9 w& J) p    move into pickaisle.induct3
* j& S3 K2 ~; s. x$ d3 T( V7 O8 f    while A_i<=30 do begin9 Q+ Q- }6 j, z$ g, I/ }( [9 T6 K
        travel to pickaisle.con(A_i)
& y) F" Q" g; v, A% p2 i, P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 W1 d# ]9 u5 n4 w
        else wait for 10 sec& O3 X+ @0 l6 c
        if A_i=A_leave then send to die
8 u, Z( D" Y# J8 p6 h        else inc A_i by 10 c7 {" @4 ^, r* w( e0 ~' z
    end
+ ?' r( Z2 T5 ^5 kend

最佳答案

查看完整内容

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是个什么东东?3 `8 O6 B; m3 J! z  y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) k/ R" S6 E; P/ S/ p$ Y* N5 e& Y- P- X
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 b" j/ B1 r1 @6 ~
$ q8 A, `7 |' B, S) |1 u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 y' m( X# y' y' r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ {6 g) `/ D- D" w" U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  D- d. C6 V1 a  e0 i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' _8 }2 b3 P' p) Ubegin P_induction arriving
& T. U2 N0 H4 S( c( h    clone 1 load to P_pick(A_induct)& A+ `1 r, N' {2 {+ ?
end最大的系
. E7 a6 w9 g" R8 H
  ?, i3 I, a  D: Ebegin P_pick arriving' I; q- K( Q. n  u  B
    set A_i to procindex * 10 + 1
6 K* K$ a; B4 u" M    move into Q_induct(procindex)* |4 T9 n/ i2 ~  u- ?2 R
    move into pickaisle.induct(procindex)
4 V7 [+ k1 k3 E( ^: W7 S    /*check the type of pickaisle.induct(i), for your last problem.*/
. {# O0 I, J3 ~/ j' ^
' \: A3 q7 O# @. N5 [    while A_i<=30 do begin
( n' D# T6 S5 D+ D2 `        travel to pickaisle.con(A_i)3 ?6 O0 {% b( r5 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  T; G' F* @. p: m        else wait for 10 sec( T& o1 |4 N) K, h0 J1 {0 M
        if A_i=A_leave then send to die
( y# C* Q; b! O0 S! t& u        else inc A_i by 1$ u, C9 S! b5 J" K$ C9 @
    end
, B  e  d& F: V+ \) A1 cend2 Q3 y) k! |$ T# y

; G- g' ^- B, ^+ d其中的procindex为整形,代表当前process的序号。
- u; c% t5 g1 ?9 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, 2026-2-13 01:32 , Processed in 0.023152 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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