设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11838|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( t" N7 U7 E( B, o- e" W' V: y" k) t+ [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  w) Z) T3 T' Q9 x9 m; U: u5 D+ P0 i( I# @
begin P_read arriving! }6 V7 s- B) ?8 Y* ~% a- p( ^
    while 1=1 do begin
3 r8 ~: w* d+ S- I4 C        read A_tote from "data.txt" with delimiter "\n"" w2 S& X  @, A& D' m! D( R
        read A_time from "data.txt" with delimiter "\n"& W! H. D" Z8 v$ w& o% C
        read A_leave from "data.txt" with delimiter "\n"
4 M* @1 ?- Y' A# F3 J4 D        read A_picks from "data.txt" with delimiter "\n"; \& d& _( |0 J! _
        set load type to A_tote5 _0 [7 I9 _5 `0 J( ~) C, [
        if A_tote="tote 1" then set A_induct to 15 w& w; y; r/ U/ h$ v
        else if A_tote="tote 2" then set A_induct to 2
: q7 {7 M; B/ }# `: H" Q$ I3 E6 x            else set A_induct to 3   
3 ]( i+ L$ A0 _3 u3 N$ v        set A_i to 0" z2 z! z: @4 z" Q/ f( v
        clone 1 load to P_induction
6 M5 T& u9 ^0 |" n2 W/ l        wait for A_time sec9 y, s. L) n5 l- m
    end
- O1 x6 [% _. }9 v/ [end" l* C. h/ p5 A7 {, f
. y- r$ S, _' d: e( y9 i  w7 _
begin P_induction arriving
$ N. K8 o- ~" t6 |. u. ~. j    if A_induct=1 then clone 1 load to P_pick1
8 |6 Z, f) Z$ h1 v6 ~4 ]    else if A_induct=2 then clone 1 load to P_pick2) O2 I0 G7 I# ?
        else clone 1 load to P_pick3
) q' c5 ~+ d* ^) _: ~' `end* ]# `/ J: F1 S7 D: U7 Q+ }

+ g. t- L4 y& s0 f7 S+ zbegin P_pick1 arriving# Z  ^# {( B& u' s0 k
    set A_i to 1
( N5 f& K" r% l% ^. K: ^    move into Q_induct10 n* |5 |& S8 q/ G2 d; Q
    move into pickaisle.induct1) ]  a2 }' k! }' o4 Z! |% p+ `+ B
    while A_i<=30 do begin2 H; A2 g) ?7 U; x/ P" h
        travel to pickaisle.con(A_i)$ |# V" v0 _( Q/ _9 ], f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 o+ K, M+ r# Z9 G+ K4 [        else wait for 10 sec$ U' a. b; Y: s7 o! b+ F) B
        if A_i=A_leave then send to die! r7 f* F- R1 x
        else inc A_i by 1
: f& V5 E( s& n+ |7 Y4 H& |    end5 ~9 l. ~/ o, o
end
( k. X0 y+ i# ^9 m0 y
. V& j6 c$ g" p/ xbegin P_pick2 arriving( N0 i9 k. u( y( b* b
    set A_i to 11+ |! P. Z6 B; }
    move into Q_induct2' |9 O5 d' ]5 ^
    move into pickaisle.induct2
$ L6 b& ^9 R4 m1 L1 z0 Q; _) t4 @    while A_i<=30 do begin! Y. _; G, j0 d; r% x
        travel to pickaisle.con(A_i)
. c; b  Q  o3 H1 |7 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i' h3 e8 F1 S5 ?3 c
        else wait for 10 sec5 V6 R# `0 o3 d3 F& O
        if A_i=A_leave then send to die
; L+ m: q9 a7 f# {  l        else inc A_i by 1: J, E' Y# N4 V  D) T. R, j
    end
' @4 n4 y9 ~: ]* F" tend* @9 u) r! p, i  P

; h' C' Z- \; s# O9 {. X+ w9 u3 }begin P_pick3 arriving
# F; M. Q9 ?& }    set A_i to 21
# F: M( ]; w' R1 o# s* ^1 I2 u( L" l    move into Q_induct3
. Q) S1 y' G5 e  o) v! f% I    move into pickaisle.induct3; a8 j# |: b' e; [- h0 e
    while A_i<=30 do begin
7 N/ }! i. {# m        travel to pickaisle.con(A_i)
* F5 n9 t' l: j/ U( ~1 h  J5 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 k% y$ w) x! y. }% p
        else wait for 10 sec
' V' p$ W) u; l) O. J! X$ k) V0 K        if A_i=A_leave then send to die
2 V7 G7 @" q. J4 d" E        else inc A_i by 1
; o3 {% A7 @3 T3 h/ v6 c, U    end" o9 C0 Z, }5 c5 J+ m6 J4 p$ A
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是个什么东东?
3 A, M6 @/ h- i/ Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; ~7 y. O# r! i" Y

/ r/ j' D# `6 Y5 O9 G) ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, ]5 F5 ~' a: r4 P4 ^

" K' W% }( i: f4 Y3 Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 r- j& G3 ]- i$ ?! ]$ t1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- ^3 R: ~; G. |" j; z$ @; d4 }! T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 z/ i* r" b* p& f7 i; T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! C0 G# k6 ^( d8 o$ t0 w, h8 e, h
begin P_induction arriving, d* B8 A; s' f# P/ c) i; L
    clone 1 load to P_pick(A_induct)( K: w$ {& O8 t+ M: O, t* g
end最大的系. v. L( n. m1 }) N# X

% t) e, o* N8 L$ l: m. D0 kbegin P_pick arriving
4 t0 U6 S: l! B; m* x    set A_i to procindex * 10 + 1
6 M* O) V: N" H: I+ P7 q    move into Q_induct(procindex)
" _$ e& A3 g2 ]0 X" x- X- G    move into pickaisle.induct(procindex)
3 U$ }7 I% f3 x    /*check the type of pickaisle.induct(i), for your last problem.*/
0 G$ M$ s' r1 ~. M1 G, f; X) Y
7 v' S8 u" ?1 e$ |+ ?    while A_i<=30 do begin
5 N# I3 V' k) O2 R6 H9 _. u( q        travel to pickaisle.con(A_i)3 ^5 N6 ]; }0 V- U; H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 |7 W7 t# ?& g        else wait for 10 sec' k( F# y  }4 J
        if A_i=A_leave then send to die
# v5 I; ]8 [2 `- Y" r) ]        else inc A_i by 1
5 A: _) t8 v  z; L% j0 T0 e* o    end
3 I+ B3 \( j" |! ?4 ]& ~* @" Aend! W( M% F. b: W4 p- F
, G9 x+ U9 @8 U# `) z5 p! s+ w
其中的procindex为整形,代表当前process的序号。6 |* E. {0 c/ i, ]$ n+ l
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, 2025-12-9 09:01 , Processed in 0.017581 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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