设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14854|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# G; z7 j0 F, O

" i. S! V. z6 e- f; V6 l+ i$ n我的问题是,在每个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中的数值,不知道会不会有什么不妥。# R5 M: j) K5 I  Y( o

7 j4 j# T" T  q6 W1 ]+ m3 w1 X6 l9 {begin P_read arriving$ H; d7 \7 y$ J6 j; ~
    while 1=1 do begin
# A9 l9 a6 j' q# O; l6 {7 k        read A_tote from "data.txt" with delimiter "\n"1 X! J+ n2 b* F
        read A_time from "data.txt" with delimiter "\n"
* Q# o" ?0 }: {* x& r: a        read A_leave from "data.txt" with delimiter "\n"
  r2 A1 o) M  C7 Z/ `        read A_picks from "data.txt" with delimiter "\n"$ u2 a0 ]' q! O9 ?$ w0 K( G  a
        set load type to A_tote
& J8 ^$ x! H) G5 f        if A_tote="tote 1" then set A_induct to 19 F" f$ G6 L5 h
        else if A_tote="tote 2" then set A_induct to 2+ |) |: Y) [+ ^$ Q" Z! n  Q
            else set A_induct to 3   
) H. w& z  J  v* O4 @6 a5 D* l        set A_i to 0
3 o' T8 v9 t( e  i6 M- B# |        clone 1 load to P_induction
3 ~% k7 _0 z% `% u( g3 Q        wait for A_time sec$ S+ B- u8 ^+ h$ H9 W1 @2 }
    end+ i: ^/ T4 _+ y5 e7 m; e
end& J% \7 Y* a+ x/ q1 g2 L" h8 P8 @
  X2 K& P* D, e8 w
begin P_induction arriving
/ n7 b' c+ a0 [  s4 c% M    if A_induct=1 then clone 1 load to P_pick1
* ^3 }  ?' a6 d1 E! ?5 F3 @& H    else if A_induct=2 then clone 1 load to P_pick2
$ n7 J& B; r: q. {3 t% \( U; K        else clone 1 load to P_pick37 o4 ~( s! ^" D$ P
end+ A8 S7 h. R- t- m/ N: f5 ?3 @
( F! d3 t: k7 s
begin P_pick1 arriving
* p5 Y. m1 O- y8 p( K% G5 F    set A_i to 1, b( l+ y. }( b/ m5 I! P5 Z
    move into Q_induct1
) G$ z+ w9 K) o. A& x    move into pickaisle.induct12 p% R8 e; U4 m/ o
    while A_i<=30 do begin- D- \8 q4 U) N! D
        travel to pickaisle.con(A_i)
0 G3 C% l  ~: E* ]4 Y! p; H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" k) N) b: e  C$ n4 v- M
        else wait for 10 sec
+ Z1 N" W2 D5 \9 l0 [        if A_i=A_leave then send to die
# r5 P& W* d" w+ K/ O0 z3 V" l  n        else inc A_i by 17 X3 q9 r9 d, f1 U
    end( M- E& k6 U& ^4 }. G7 |
end- w3 p9 z+ g0 Y: Y
/ n- ]2 [6 Q; d* n
begin P_pick2 arriving
9 `! N: V$ M8 X0 M7 H    set A_i to 11% Q2 O! Y# _- I  [
    move into Q_induct2
- K' ^8 J% m$ P, D/ e/ D9 Y4 V    move into pickaisle.induct2
! c; R# Y; W! O3 S( B7 U2 E/ n! p    while A_i<=30 do begin7 B: W9 F: Y; ]! ~3 q
        travel to pickaisle.con(A_i)* Y* d7 R6 U# w+ x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h7 O6 k! D3 I6 A, [. ?        else wait for 10 sec
$ G& M* ]3 ]4 x2 k# `0 h' k        if A_i=A_leave then send to die( I4 P) x  x& u3 Z" q6 X
        else inc A_i by 1
& Z. j5 M* F  j% ~7 n9 M    end
2 }& h$ H) y: Y! Fend7 f( h: \$ `" h

: O0 u1 k$ D2 R- ^: [! G, xbegin P_pick3 arriving
9 R4 O7 {+ U; z$ @, a8 Q    set A_i to 21
, ?$ k  a) T- y2 n; X4 W4 y    move into Q_induct36 E5 C, a1 ?4 e
    move into pickaisle.induct3
* S2 u; Q2 _3 F( [; ?2 z* R" e& e0 _    while A_i<=30 do begin
9 a. ~: P% Z5 U8 u( Y6 G# `1 z4 {        travel to pickaisle.con(A_i)
# w* z  _/ k& D1 h" G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ X) m1 W( F% [1 M# _        else wait for 10 sec: K! q+ i0 t* q3 T/ x
        if A_i=A_leave then send to die
) Y: I( Z" U  @        else inc A_i by 1+ Z7 W/ ]% _8 Y# V
    end
7 V2 u, h, ^2 b2 [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是个什么东东?2 F) y+ j4 g' ^1 j2 s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# b1 {* F9 J" G3 \

1 d5 U1 @. c5 U. O- p! T7 c2 B" _AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 ]8 w6 W" g1 {6 H8 F& c) E

. v* ]7 [" v  B另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 B6 W) d, P6 O, f) ?1 k
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" H' P; E/ _% r: m! h1 ^' F3 `! L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 O3 t2 z* O8 |  h( o$ f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 N8 q. z+ c! g: ebegin P_induction arriving( I+ C3 H( s) o8 X8 @, J* T6 }
    clone 1 load to P_pick(A_induct)! x# q* x& d. {1 E! \( ~+ }8 `! K9 q2 q
end最大的系
  q: W# ~' L3 e2 d8 j
$ g& ^6 t' R) D( O7 U" gbegin P_pick arriving
! Z3 S1 ^4 u2 u" N: D    set A_i to procindex * 10 + 1
: _  @# c0 Q# O, V/ p/ n    move into Q_induct(procindex)
- i" B5 F0 D! m2 U    move into pickaisle.induct(procindex)
$ S/ @- |1 K$ B: M" t+ b1 f8 z    /*check the type of pickaisle.induct(i), for your last problem.*/
2 w2 o/ R$ f+ u7 K) \- O% J+ L* O& a) E2 ^7 n
    while A_i<=30 do begin0 t! S( I% c7 P6 I& p) b% s. i
        travel to pickaisle.con(A_i)
9 b/ T: L0 O' e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 R2 ?* h. K: U! J% q
        else wait for 10 sec
6 P$ n* m  w2 B8 W4 |0 C        if A_i=A_leave then send to die
, h0 O! [2 @8 l* p* h        else inc A_i by 12 `& S4 C7 o5 {
    end
; c. _8 K( @' \" L1 S6 Z4 Cend
7 ]  i; {& G$ f: }  Q
) i, @9 C% F8 e) K- t7 F6 F, l其中的procindex为整形,代表当前process的序号。7 ?4 X0 Q& r' J; v) Z
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-7-29 04:01 , Processed in 0.014972 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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