设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14152|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 I' h9 f. h  a2 N; O2 `+ l

* L: j; ?; V& h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, S( @/ q$ r# _( X  a6 s9 I/ s: C8 C6 |( i, b2 w6 U# C
begin P_read arriving7 G& P9 J$ b2 |% k/ ]
    while 1=1 do begin+ I. B: X7 e8 U
        read A_tote from "data.txt" with delimiter "\n"
3 N: h! t; A! s" |# M2 f        read A_time from "data.txt" with delimiter "\n"
8 \3 `/ c$ |' q  T+ x' [        read A_leave from "data.txt" with delimiter "\n"0 s2 \  m4 d0 g' Y6 J
        read A_picks from "data.txt" with delimiter "\n"
3 R+ t2 o9 C! Y. J5 u        set load type to A_tote
' j2 Z0 S2 f: W        if A_tote="tote 1" then set A_induct to 1
, A( q6 U2 g! S        else if A_tote="tote 2" then set A_induct to 2: x$ G) y& y" Y1 `8 O  U
            else set A_induct to 3   
0 C) y. f( k5 K5 F        set A_i to 09 E5 h8 l5 x, l6 W( x2 H
        clone 1 load to P_induction
/ f  ^) B$ c" m        wait for A_time sec
+ F( I! ]9 V' ~4 l8 X% [& X4 e    end
6 t( `; X; N) R0 aend
/ e0 I+ z) o$ G5 [$ H8 z) I2 {8 [! m, W. i4 h1 m9 n
begin P_induction arriving7 Z+ W! T7 C4 b" B
    if A_induct=1 then clone 1 load to P_pick1
' Q! n% B  E1 O5 U# P8 Y: _    else if A_induct=2 then clone 1 load to P_pick2
3 m8 H" K. f9 L3 H9 _        else clone 1 load to P_pick3( `8 S/ j/ P. _' I, F
end
% {, ?' B5 C. P6 _
* x' x! U. u. q6 ?9 {begin P_pick1 arriving$ U3 ]% E) ?# A3 ]4 u  G) S- A& @
    set A_i to 1, B, H7 @4 k! T0 v0 s$ ?
    move into Q_induct1& V: e/ f, P: k# z" n* E
    move into pickaisle.induct1
3 h* q1 \. `. [4 `6 C/ W  S    while A_i<=30 do begin
9 E& ]: i. C2 A" O1 b  U* q        travel to pickaisle.con(A_i)
+ O+ p( P4 l& F. C1 k. [7 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 v, P: P2 H2 m4 b! @# c        else wait for 10 sec
* d7 y# S" x7 E; T, ?1 t6 r# M; @        if A_i=A_leave then send to die
. D, j/ z. m! ?. ?" }1 s; D  e- b        else inc A_i by 1
) l6 n* I- W3 H( j' f2 T    end8 v' F( D6 w& @$ N/ V
end: p. ?; `4 {% ]6 `5 `
- o, I& m. S. _
begin P_pick2 arriving
6 ]) H9 C; h( \& R$ }; j    set A_i to 11
* \! G8 a- }4 I/ }* P! j    move into Q_induct2
+ L8 L) Y5 N- x/ l7 W    move into pickaisle.induct2$ k9 n7 i* G' x1 J$ D/ a
    while A_i<=30 do begin
( w/ \0 o: a: b) R        travel to pickaisle.con(A_i)
9 M$ B) g1 _( P8 l8 I$ @5 s6 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: H8 T9 A  [0 z6 E4 H5 v4 Q1 V
        else wait for 10 sec
6 M5 q4 [* C! a* h  ~, L9 ^7 D        if A_i=A_leave then send to die
7 Q( b0 L* Q. b, N6 W$ _        else inc A_i by 1
/ m7 g# Y- c1 h& s- d, w0 Z# v7 x    end
% O1 _- s0 m! D, ~1 Lend
7 p' H* c3 {7 t! n7 O- N$ ^
( e& G: i- Y; w0 r: ~9 G: ybegin P_pick3 arriving2 f/ Y; C% V( x. t* ~: s+ q& Y
    set A_i to 21
+ [2 f) ~% F# {3 O, }* w    move into Q_induct38 c" v8 ^1 v. S- C8 U' D% w
    move into pickaisle.induct3. z" O5 D: k% i9 }& e+ A
    while A_i<=30 do begin/ k: o- H9 s& {1 g& t0 q
        travel to pickaisle.con(A_i)- C9 o8 X0 z0 @$ E8 Z5 K2 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. m% c& P- |- K4 D- |1 \
        else wait for 10 sec
9 v4 u! `+ q! v5 o        if A_i=A_leave then send to die1 I  m' ?7 v& ]. }
        else inc A_i by 1, h  ]8 I7 B6 N( r- P
    end+ d+ o. \+ l; ^0 u
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是个什么东东?8 C' d: W4 }5 x% s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 i5 ]; N/ R5 M; P, c) {8 O3 m+ J/ B0 R3 @7 L$ |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ z- ?* H" k/ Y; {4 C7 k1 ^/ P

! Y/ [+ d6 ^; @9 c0 U  f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ F% d( q( v( a# S1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ h& t* v3 x$ c/ A+ X2 Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- {) w0 x4 B1 a0 w/ b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" q4 C! r+ t( r1 }& y, M0 F2 nbegin P_induction arriving4 Y2 J$ v  @, e+ s0 t
    clone 1 load to P_pick(A_induct)( w. a  R! Q1 u, Q5 L$ o
end最大的系  y) U! ^. Y* p
  A* v* z* j! z! n" }' L
begin P_pick arriving
+ ~4 E- \# Z9 p7 W! y    set A_i to procindex * 10 + 1
! Z- g3 \/ h* s    move into Q_induct(procindex)$ ?% Y; v0 n! s: j8 p4 B
    move into pickaisle.induct(procindex)
3 S: |+ ~+ ^5 Z( o& b    /*check the type of pickaisle.induct(i), for your last problem.*/; u) Y3 k) I% ^' r8 c/ P5 z. N
/ K/ Y9 n* ~( A
    while A_i<=30 do begin
6 O2 `2 ]4 ~$ z* v; V8 [# x        travel to pickaisle.con(A_i)) K  y" `  J5 l- C! Y+ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# h  v+ S& K8 \* i" o2 i" h. _" f
        else wait for 10 sec( ^  |7 N; q& i# a# h. W1 K
        if A_i=A_leave then send to die
# \9 O- h+ c( m, Q3 J4 l+ S        else inc A_i by 1
- s, }- I% V* F! p    end, ?0 P# x6 @) A: g6 M3 f  ^) J0 m% `
end1 D& K: i" z( p$ J

6 t$ U/ y8 _1 P. j, {. J: V% R$ L其中的procindex为整形,代表当前process的序号。
) y( n* ?! J/ h) K9 rstation和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-6-14 16:57 , Processed in 0.016549 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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