设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14046|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% r( b( K, ?. I' B( t
: \" U' h* y+ J  F$ _& U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. b6 ?: ^/ k. J6 n

9 W; X9 Y: ^3 M/ _) jbegin P_read arriving
" M* N" I8 W3 [    while 1=1 do begin+ L7 [- q" L3 R" ^4 T  C, m7 p) C6 z
        read A_tote from "data.txt" with delimiter "\n"
% _2 p- n3 `7 f' F  f        read A_time from "data.txt" with delimiter "\n"# n. @, Z" m! w) P
        read A_leave from "data.txt" with delimiter "\n". j. E4 m! j+ U, w
        read A_picks from "data.txt" with delimiter "\n"' }- [( U, H3 B" n& s: p# ^
        set load type to A_tote# a7 l7 ^# ^6 W) ?+ g2 W, C& T
        if A_tote="tote 1" then set A_induct to 1
* g: T! t/ N3 h9 _. O1 T        else if A_tote="tote 2" then set A_induct to 21 o- o- Z- [0 k5 q+ S" s
            else set A_induct to 3   
" @. i2 ]+ O, {$ x0 c6 S        set A_i to 0' ~2 y6 F: D" w* b! _4 A3 `7 r
        clone 1 load to P_induction3 i2 s( _( |+ Y& M* L
        wait for A_time sec
+ d) |, `: A1 |+ D( \    end1 x) c) v  }' ]' I
end
* D3 P- m5 q) i0 D- P2 }# ^
* _) R7 A, g+ R9 R  f0 n+ @begin P_induction arriving
- |: J& h  c; E0 h1 u    if A_induct=1 then clone 1 load to P_pick1
! Z8 E: M0 W8 S* t9 r. h5 _( C    else if A_induct=2 then clone 1 load to P_pick2& V+ u/ @5 {9 w8 g6 N
        else clone 1 load to P_pick3+ Z9 ?: f% g! a' U& \/ m
end- T( `& a& _) a8 z
- {' `% R8 s/ U7 \3 m0 J
begin P_pick1 arriving# \' i% l7 Y$ ~6 y
    set A_i to 17 z: r: o) _0 b
    move into Q_induct1$ i6 r+ G8 M4 t) \( u
    move into pickaisle.induct1
  o$ Y+ u6 K! o- Q2 U. J& @$ k1 _/ N3 C% U    while A_i<=30 do begin
) D( x# D" U8 m9 e: r        travel to pickaisle.con(A_i)9 C3 ]' H3 X+ a7 j7 c- i- b9 R- a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  k- o8 H* S/ Q' I
        else wait for 10 sec
. y% M5 P+ S1 C* ^' Z        if A_i=A_leave then send to die* g/ r0 {8 n$ q
        else inc A_i by 1% y5 I: y, L8 C  ]0 p
    end
; ]6 C( p' K  R2 q7 D. vend% T$ [( t  ^; }. i& D3 M

4 A" q) j4 A7 {  M# dbegin P_pick2 arriving" m3 A+ R4 n, @% C
    set A_i to 11/ U) v" v" W3 r) o1 {
    move into Q_induct2( j" @- D9 ^2 [7 F9 H
    move into pickaisle.induct2
! v6 m9 s& G, a+ X; r    while A_i<=30 do begin$ P' e6 F5 m/ @- x( b; f
        travel to pickaisle.con(A_i)% v) f4 @8 J9 I4 D! ?( H  |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 G1 X' `% l) j+ t6 x' f7 w        else wait for 10 sec5 p# x: t, v, R7 _# ]
        if A_i=A_leave then send to die# s: N% ]' |* T3 F$ f
        else inc A_i by 1
* i! Y" @& K5 _  h* u! M    end
8 R) T! u4 \$ _! T# `+ D2 E9 r3 Yend) Z, Q4 F+ `- e6 Z  B% }' n9 ^

! r0 ^! K. l; `' V* cbegin P_pick3 arriving
/ A" \. R& k% x( D5 J% [    set A_i to 21
3 G+ x0 w$ E6 M4 G    move into Q_induct3( l2 L5 X. k9 F( o  ]: s' G
    move into pickaisle.induct33 L& Q; w. K" s! T8 S
    while A_i<=30 do begin
, _2 `% T3 Q- L( j* g! q' ]        travel to pickaisle.con(A_i)7 H' Y0 c7 Q9 k# x6 Z  j3 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# h/ R7 g7 k2 e" \" G        else wait for 10 sec
2 ?& Z: H% x6 \7 _        if A_i=A_leave then send to die
$ D0 z" k- O, o) u3 v        else inc A_i by 1# G0 E. O& z7 J2 L7 Z
    end; `+ b6 L: i5 z" l
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是个什么东东?1 q" ?& P  Z6 K4 C' @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) c$ h0 X2 _5 W; p6 ?9 I- |& x
% F) M! n, c1 I! X( l* E- ~6 P8 B  N
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ V& U- C% r) `* Z

; Z% G+ u) o7 b5 V5 [1 P另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 w; ?$ N9 G/ X# M7 k+ |. L$ r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" U7 {: r4 I0 E: p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: @3 `. f7 J: K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ v; B# p% s1 K2 o
begin P_induction arriving7 i: a+ h8 v- n! l, w5 i
    clone 1 load to P_pick(A_induct)1 Q7 G, ]2 K" [4 T
end最大的系! R' Y4 y1 A$ y

: P+ [* `' ^4 ?4 e3 J0 B. d% Nbegin P_pick arriving
/ h  q" D6 n  u/ N8 X    set A_i to procindex * 10 + 18 V9 m5 v3 n7 h/ Q, k0 y: `7 G
    move into Q_induct(procindex)* Q: Z0 e& X# P4 B8 N0 {9 \! ~
    move into pickaisle.induct(procindex)9 m! i$ R" R! t  T
    /*check the type of pickaisle.induct(i), for your last problem.*/- c5 ]9 z1 \+ [3 \. ]3 S* j
; ^" f8 j7 F  O! w
    while A_i<=30 do begin  ~% `1 ?  T4 ]+ q
        travel to pickaisle.con(A_i)% l; Q, Q8 R- v* p7 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* I/ l) g) B4 j8 q7 @; ]
        else wait for 10 sec' ^, r# F+ X4 A4 R# ^% m: d
        if A_i=A_leave then send to die
, C) h* I" o3 k# X2 R0 i' y        else inc A_i by 1
! D1 [2 N. T) e1 b3 x    end
: Z4 B' u9 `( Z. x0 ~8 Gend
6 m" a# v/ b% I; `9 |% L' _1 ]0 Z3 j* p" j: u/ C2 F" f$ u( T1 n7 I
其中的procindex为整形,代表当前process的序号。/ v2 P6 Q& [. \" i4 L( z) C: I' h6 q
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-6-3 09:13 , Processed in 0.014401 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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