设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13047|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' X) F9 d( g( {( u& j1 B- z, `* V  e) G8 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! O: d' L8 h) |- S% C% a6 s

0 B' C/ F# o2 D6 ^begin P_read arriving
, T& b# z0 \; A  Z( ], G7 j    while 1=1 do begin
: P( ]- r- d% ^- K        read A_tote from "data.txt" with delimiter "\n"
! q0 X) n* w$ q4 x( f# K/ D) a        read A_time from "data.txt" with delimiter "\n"
6 F0 O* b1 y. H, E& R        read A_leave from "data.txt" with delimiter "\n"1 h$ v+ p5 F, r: K3 \0 f
        read A_picks from "data.txt" with delimiter "\n"
9 ~+ v. I+ t/ W& t4 h, J        set load type to A_tote
$ b3 i6 j) u% s6 o. r2 l7 k        if A_tote="tote 1" then set A_induct to 1
  d: r# w9 R7 r* |, n& R" D        else if A_tote="tote 2" then set A_induct to 2
" U; m0 C( f& d, S0 k            else set A_induct to 3   
1 ^( H. T. m: ^: O7 J        set A_i to 00 p3 `. L8 @9 h2 v) n: Z
        clone 1 load to P_induction8 r; f- J( ]" y9 u& q8 _" U: J
        wait for A_time sec
$ q! d' a; A* q6 Z8 U    end
4 y- y& a/ s2 K2 Jend
2 Z7 c) e  J, g# ~/ |$ @* u- D0 D% |4 ?& M' F" }  e! V& u( j
begin P_induction arriving! H0 C5 P' x0 m# t, R  {
    if A_induct=1 then clone 1 load to P_pick1
  ~+ u7 y6 _6 F/ [0 G    else if A_induct=2 then clone 1 load to P_pick2) g5 i; q6 D% B' h$ s2 _$ C+ ~; v
        else clone 1 load to P_pick3
* r" L, ^% N* h' x# }' iend% p1 j* X2 M9 l: {0 m% N5 \* B

- R: T+ \3 j" R4 Z5 Dbegin P_pick1 arriving- X. s3 R. T* T. d6 T# A/ Y' R
    set A_i to 1
7 L/ B' C* L* n5 K: Y    move into Q_induct1
9 I) X) r/ s# h! C    move into pickaisle.induct1: p( I- v1 k0 D  A5 ]
    while A_i<=30 do begin6 s* t) J$ j9 j" g  o
        travel to pickaisle.con(A_i)& {( l! g$ T# o( C; \/ L' e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" B" i' R5 v1 _7 X; N, x) B        else wait for 10 sec
- r: q% J2 K$ ^9 G$ p7 `6 |/ k        if A_i=A_leave then send to die
) Q7 f/ C, h# N% N        else inc A_i by 1& f# E& b! j9 z
    end6 t4 b7 H1 g2 y! M4 c
end* |7 d0 F% R- e* S
/ o  j) d% W' C' C
begin P_pick2 arriving. f7 }* @/ @6 v) c9 u- I3 `
    set A_i to 113 D2 H4 K9 m: ]! S& l
    move into Q_induct2$ p" g+ w; x  i1 o+ j* Y
    move into pickaisle.induct2
  O; o: X- M, A! w& Y- E    while A_i<=30 do begin
) S: {' t9 v6 d4 C% y1 ]6 C        travel to pickaisle.con(A_i)
7 b2 [& a5 W: A0 ~# w2 \! p: `1 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Q6 [' B. Q1 }7 w( F# {
        else wait for 10 sec1 M7 ~$ S) {2 r3 O+ `5 E
        if A_i=A_leave then send to die$ a3 W* Y% G' ?2 j
        else inc A_i by 1$ W1 _7 f0 \2 f; |: ~5 H
    end0 w6 E# J8 z6 P% R8 G
end9 t9 j. b8 j# ?  D& u: [" C2 _) p* S

  N+ _( [/ p! i2 T6 A1 E$ ^begin P_pick3 arriving, y; a; P3 w: ~8 Y0 a/ \
    set A_i to 21% E! o" B, N1 k& K& Z2 I
    move into Q_induct3  e5 A0 L/ }# i. e& c- S+ L
    move into pickaisle.induct3
+ R8 d+ a/ c  Z    while A_i<=30 do begin" G0 y$ n( f* j. N* O% a6 ^, B
        travel to pickaisle.con(A_i)2 {8 Q( L1 N2 ^; S4 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) W) h1 Z" F$ T% H7 ~2 c' X
        else wait for 10 sec% t% z3 C) A! a# h
        if A_i=A_leave then send to die
8 B6 C" [& k9 u1 ?) r        else inc A_i by 1
# X6 R2 j4 P8 x0 n1 y9 B: Y: W, I    end" d  Z' l9 q) b. r- |- s
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是个什么东东?
5 y7 E6 J* J. ?, s. emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ R) ?" q  q9 n5 S8 v
$ I+ @- X; G0 o) gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 a4 y0 n% d& Z8 l" b% J9 M9 A$ ^$ `- z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 U) ?- \& u! w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 d6 ?! Z7 I6 f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 X- P4 Q3 ?# i/ _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; T- l2 l) C( rbegin P_induction arriving8 b# ?; ]- `' J
    clone 1 load to P_pick(A_induct)  L3 V; X: S: `/ h; w3 P% U
end最大的系
- L: g& I0 B7 X$ k0 J% Y
. c7 @( d' d! I+ Obegin P_pick arriving
6 y5 N* R6 ^) t5 y; g9 S" i" H    set A_i to procindex * 10 + 1
8 f3 g. e; O* R+ h% E5 y    move into Q_induct(procindex)
9 E! H1 Z: @; u' Q' L# Q5 V+ S    move into pickaisle.induct(procindex)% _+ I/ O! W0 L- y" s& M7 V
    /*check the type of pickaisle.induct(i), for your last problem.*/* ?6 I+ j; i5 H

2 o' j0 V" M, n6 ^% x" F  f    while A_i<=30 do begin( s5 v3 B- S6 J6 I* ^: |
        travel to pickaisle.con(A_i)/ d- @7 [9 [% }$ H% n' s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 H$ L3 v: j% K6 S) F# H$ _9 a- N( e
        else wait for 10 sec
1 [/ f( c3 y/ v8 Z: F        if A_i=A_leave then send to die1 H* X- g' s! B1 R
        else inc A_i by 1' B0 ^- x/ z3 H
    end) v, k6 b2 B/ y
end' E/ d: d% P# w/ p: ?8 a# ?3 L! w
! X; e; K. b0 N/ n/ c
其中的procindex为整形,代表当前process的序号。
/ u& y) q5 V% ?  G$ [* @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-3-13 17:32 , Processed in 0.013878 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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