设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15583|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. r: c% k3 }' R( x4 F/ n
: b+ B: v/ P$ [- X! J+ u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. l# z" h$ b5 J/ f0 C/ x; `1 Z8 O: ?/ W8 _# d0 F  K) e1 W( Z
begin P_read arriving/ S8 o- H! y: m, E+ P
    while 1=1 do begin
2 T" Q0 n! A; }* y$ }        read A_tote from "data.txt" with delimiter "\n"
) O' x) S- s, N* {7 ^        read A_time from "data.txt" with delimiter "\n"0 `. D; D: H+ p) s3 v0 p
        read A_leave from "data.txt" with delimiter "\n"
' G# B2 |# f% Q; R4 W  k$ f6 k& R        read A_picks from "data.txt" with delimiter "\n"
' \0 z2 _. e$ V+ K$ c1 C        set load type to A_tote$ O: |+ Z0 a1 i% d
        if A_tote="tote 1" then set A_induct to 1
0 y1 U3 A+ {, k4 N9 d        else if A_tote="tote 2" then set A_induct to 2
3 [4 M2 n0 [# v6 ^5 ^2 O+ s, M            else set A_induct to 3    , D1 c0 G5 ]3 A1 R6 \
        set A_i to 0
$ f9 b/ m) x' L% v5 e3 c7 {! t  C. p        clone 1 load to P_induction. Z  l6 |% l; e1 o; s+ W
        wait for A_time sec. p; Q0 a" u0 T, R* h( p
    end% x0 c) e( k% p5 o- G$ x+ ]
end$ G$ m% X$ t4 A( o

  l& C- T! D2 Hbegin P_induction arriving9 Q9 k  W- O, U9 c0 f' t+ O9 C
    if A_induct=1 then clone 1 load to P_pick1
% [7 G" z' I/ [2 {" ]. Y! D( f    else if A_induct=2 then clone 1 load to P_pick2+ F; Z' }, ^$ G9 I' y4 b& O4 G; ^
        else clone 1 load to P_pick3
" b; f& V4 x' @8 f4 Pend7 H1 ^* o/ w4 P% {
7 g' T( q, ]/ L; O% _( L: l0 z
begin P_pick1 arriving- G7 u6 W2 d' {& E
    set A_i to 1
9 _1 ?1 f, A) T* n' X    move into Q_induct1
9 P% T1 d8 a5 u$ z6 ?5 `. d) T    move into pickaisle.induct1( B/ L# x7 Y0 O( ^
    while A_i<=30 do begin
3 L% K. k& B1 y6 e        travel to pickaisle.con(A_i)) ?3 {8 d6 [4 i3 _) c' I' a  W4 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ B$ J$ K4 R1 r4 S8 J4 d
        else wait for 10 sec  H3 S/ a7 d# r/ H9 J  V$ |+ Q
        if A_i=A_leave then send to die) _3 k- c3 x1 r! g5 x0 `/ J! I
        else inc A_i by 16 @9 q  A+ I4 }- r( g
    end
: W8 p% x; V, R1 Q. tend; g# b! }0 g) `$ q. G5 j8 F

7 m6 _' a, `' z6 T0 S- x" qbegin P_pick2 arriving; T: U) B* c4 f9 k: ?+ I2 `
    set A_i to 11
! v: S# q- F. W. Y" R9 c    move into Q_induct2
( B7 i. Q: ^  ^6 b3 X6 y: i    move into pickaisle.induct2
) ?  S0 T; E! X5 w3 k" O8 m1 y    while A_i<=30 do begin; o* T) X+ \" o/ g
        travel to pickaisle.con(A_i)
) }: y- W& Z$ P- P. t1 x# I6 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M% ^( d8 `, U" ^; A( `        else wait for 10 sec
6 [+ |0 A* _$ q! ~; o' y5 o        if A_i=A_leave then send to die
7 e1 e) R# R: j& }- d& ?! W0 s        else inc A_i by 1
  {5 X( k2 x7 s; J: }    end4 ?0 b, u# b: ^% x
end3 ?- V5 ?8 d0 s' L  B, d/ C
; O* v0 b# y% g4 ^- Y% A
begin P_pick3 arriving
: R5 F" @  c4 o7 Z- {" q1 O: a, b. q    set A_i to 21
- l# r( B7 L9 ~* Q9 x% t7 D    move into Q_induct3* R1 X% [3 ^  z" H6 Q7 T, E! t" s
    move into pickaisle.induct3
8 C6 [; I6 d" ~+ a0 l) \$ J    while A_i<=30 do begin, U' S2 A" ^# u, B/ D6 T; c
        travel to pickaisle.con(A_i)
$ ]/ }# h) Z% ?- I) Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Y0 b8 Z* p$ |) n
        else wait for 10 sec' G  d+ V4 _2 p6 Z% S3 ?& T+ V
        if A_i=A_leave then send to die
: d' W# P2 x: K6 u        else inc A_i by 1
+ G# t) ]4 t4 e4 k. N" y+ s    end1 |4 f8 _( ~# R
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是个什么东东?
: a& ~3 f: B! C8 J' X' ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" {2 i; C' G: p5 E6 I- _% m9 S" Q: ^) ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: @& x) j# ]8 s% B8 P

6 [; r- L; n/ T& [5 |- g. l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: R2 P3 E( Y$ L$ A. `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ T" |: l' H7 E& h  Q' [
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" q* G( u: ]7 q3 ?4 Z# @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) f  O1 O6 o2 `* @begin P_induction arriving
2 C$ x4 B7 ^" F- h9 S& M$ E    clone 1 load to P_pick(A_induct)
/ D! s& m4 U7 N3 ]end最大的系
# N1 ?  t! w1 }
1 }: D" {- N# Z/ n' H- ?9 vbegin P_pick arriving
: U( C" ^4 S! Z* J# ]5 m% p    set A_i to procindex * 10 + 1& w% `, W# _. V/ l3 d" s1 a( a
    move into Q_induct(procindex)) a; z0 B& U- x3 A) _) X( K
    move into pickaisle.induct(procindex)" C2 B+ @1 Z" D/ B( Q
    /*check the type of pickaisle.induct(i), for your last problem.*/
; \& F  O8 S" M  Z- h
& F% ?+ l5 ]& N2 p' k# P- B    while A_i<=30 do begin' v2 C4 I- i, j6 |
        travel to pickaisle.con(A_i). e; x' M1 [# |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, ]  x! k  a2 \6 f        else wait for 10 sec& |- Y# Q  j5 Z9 K. u
        if A_i=A_leave then send to die
8 J3 b; \. k3 I9 X8 c1 l, a" M        else inc A_i by 1% l+ W, ~0 w# X& p) U9 }
    end
0 \9 c5 o6 H0 _3 M3 h$ V/ Nend9 V, u1 w3 U2 W. ?
. y3 L) b, z# ~
其中的procindex为整形,代表当前process的序号。2 r9 d6 v) O- r1 a( [/ i5 i
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-9-21 06:44 , Processed in 0.016800 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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