设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12167|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 T; h6 ?& o6 f  H- g
" i+ Q  Y$ Y# t1 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 x7 f1 i' P5 g) I
% `4 p4 l+ f8 |9 E6 h' M- N6 C' \
begin P_read arriving
1 n$ H0 D, t) q( v3 w7 `6 f    while 1=1 do begin
2 }$ u7 m! T/ P( G3 E( Q" j        read A_tote from "data.txt" with delimiter "\n"
3 ?; V; i# d. i2 l8 W, o; e8 _: y        read A_time from "data.txt" with delimiter "\n": b- D8 ~3 [/ W0 N
        read A_leave from "data.txt" with delimiter "\n"
- ], I4 q. q: K- @: d+ v" z8 C        read A_picks from "data.txt" with delimiter "\n"4 Y0 ], c% Q) V1 E9 L7 C
        set load type to A_tote
9 s  @; t: M6 Q4 i) S3 b; u        if A_tote="tote 1" then set A_induct to 1
4 }) i3 u$ M3 ^        else if A_tote="tote 2" then set A_induct to 2
# o6 e/ I: @. Z0 Z            else set A_induct to 3    " W2 |( P5 P+ a1 [$ N$ X
        set A_i to 0
9 ]! m' }" t4 O# ~) n- P1 ]; |        clone 1 load to P_induction" z! R# t: r/ V5 v- D9 h
        wait for A_time sec
% w6 y) H! F" T    end& f3 X8 K+ B# y1 l. x( S
end
, `5 R5 H( J& ~7 W- |1 x6 Q+ t1 Z( O
begin P_induction arriving" }0 {( [; f# j. ~. W
    if A_induct=1 then clone 1 load to P_pick1; r# R. T+ C$ k. d1 m, A- T& l  D
    else if A_induct=2 then clone 1 load to P_pick2
4 r9 U' R& J: P' t        else clone 1 load to P_pick3
# Q# h- I% r, N! o# t. k  vend
3 q  a! H$ C, e! Y7 r. p/ x0 V# E5 V
begin P_pick1 arriving
' |4 H9 ]' l7 v$ ^    set A_i to 12 x7 \% Y6 N7 S" A6 d9 w
    move into Q_induct1
1 N; M. |# {* r$ t9 p1 B    move into pickaisle.induct1* |* K' `) h/ e$ C: k
    while A_i<=30 do begin
- j% X9 Q0 ^, ]/ [        travel to pickaisle.con(A_i)' E3 {3 E* B3 H2 j! |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, s8 y: _# R6 c; E0 ~7 I$ H& j        else wait for 10 sec
  I: C0 V$ }- j9 u        if A_i=A_leave then send to die1 C+ d3 s  q: T7 }
        else inc A_i by 1! G7 c  x: F/ ~% k
    end
6 |+ Q1 b4 D- G8 G$ l2 k# xend
+ Q: G  D7 R* S; ^& P
7 c5 q& M3 \1 G6 Y7 o6 B+ Cbegin P_pick2 arriving
; A& r& F' {8 V5 {/ P% z    set A_i to 11  C4 y( m$ d! Z) t- m7 g7 Y
    move into Q_induct29 W' H# G. W2 K4 q! }8 {7 v7 E
    move into pickaisle.induct2: x7 w4 _% o+ s
    while A_i<=30 do begin8 a) b0 [7 W  r: I( M! d
        travel to pickaisle.con(A_i)
8 Z# i0 S4 O6 S% _9 V' j0 ^4 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 j* h4 ]5 k; U' `. k
        else wait for 10 sec
" G) }) @# T" S) _        if A_i=A_leave then send to die
5 @) _% _. E5 D( r- j% B8 G        else inc A_i by 1
: ^4 G. |0 ^# r* ]1 W% s    end
6 T6 _8 J: {4 a4 Iend
! s. l0 @- |1 K/ n
+ q! X1 p6 v1 ?& j( fbegin P_pick3 arriving
% @% y; K* F( J    set A_i to 21
  g0 z6 ~; o7 p0 i4 `8 g    move into Q_induct3
: L7 s/ T" K5 R" V6 m1 |, m: c    move into pickaisle.induct3
: H+ x% v9 u3 q5 K8 j, j    while A_i<=30 do begin
8 ~. Y2 r6 s( ]/ \; y        travel to pickaisle.con(A_i)
' {* s; g/ k5 Y, X: |* P; R+ X2 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 I8 M9 ?# l1 o. _. `1 R6 h
        else wait for 10 sec
0 ?% }9 s1 D8 v; b6 I6 f* d7 |        if A_i=A_leave then send to die8 X. R, Y" p8 \3 ?0 Q$ ~
        else inc A_i by 1
$ U1 C0 b6 v# X: J    end5 S3 D1 A8 V  N
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是个什么东东?' Q! l7 |8 d+ O/ T* T* I
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' _7 y( e- k: ?; `$ E7 G( }) v' E7 |$ G: k: ^8 P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 B) c: N. [9 [& B% T' ?0 [  S
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, }0 g( ?9 E; R7 X, A0 n# K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 ~8 p3 I* [+ J$ I1 g+ E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 Y1 i. A. Z/ y' [  b/ a- d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 [% {" k8 U! U0 H2 |" I* `) }begin P_induction arriving
6 F" S" ~; H* N. i' `    clone 1 load to P_pick(A_induct)# {4 z6 p- R8 [! x3 q
end最大的系  M; M& g5 }; _& a; c3 i7 i

, H; d$ C0 j8 K9 n& h9 j% c+ Dbegin P_pick arriving
/ C1 c4 X$ a& e2 G. k    set A_i to procindex * 10 + 1# W' s' k% i; W  ~* W* {
    move into Q_induct(procindex)
( F5 M! O  _) s0 C8 |    move into pickaisle.induct(procindex)
4 z6 v+ {, e- A) {2 D6 m    /*check the type of pickaisle.induct(i), for your last problem.*/: M: n1 {7 S; P2 @+ S

# E$ ]1 P. A! g! i    while A_i<=30 do begin
! ?! m. O. N4 a6 `, _9 N        travel to pickaisle.con(A_i)
& f+ {1 q, `) `1 C6 |, y- j6 j* H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- B, P6 S: K# y' A7 @& _        else wait for 10 sec  @* j% e- K/ K% j/ B3 ^; }/ W# @
        if A_i=A_leave then send to die0 |+ ^  l6 q8 y% S* M$ L
        else inc A_i by 1
0 l& O( f0 [! M    end
( s" w2 M7 a0 b. `% ^& G7 rend4 i, T) i; Y4 Y8 R, I$ }

; s, f, w4 r2 R其中的procindex为整形,代表当前process的序号。6 J0 J# D3 V$ t. ?; t* G" U
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-1-1 21:31 , Processed in 0.014934 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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