设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13407|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ Y  V& a5 Z% b% D, e' `, J" i) R/ [& F- f" l: @; N, U% 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中的数值,不知道会不会有什么不妥。/ G* s0 x. U" s- r' _
3 s4 b  Z$ V; w6 w
begin P_read arriving
+ r/ M$ o6 A  C( _" W: Y8 c    while 1=1 do begin6 `% d" Y, D- F( L: f' i
        read A_tote from "data.txt" with delimiter "\n"% z  Z" @& f- }; O# T7 m- \: D
        read A_time from "data.txt" with delimiter "\n"4 S7 ~6 H2 G3 p7 }6 A, q* B
        read A_leave from "data.txt" with delimiter "\n"
6 W4 D2 K8 c1 |0 H        read A_picks from "data.txt" with delimiter "\n"
6 K+ Z/ R# t3 K+ o+ C/ t        set load type to A_tote
7 w& ?) B$ a' M        if A_tote="tote 1" then set A_induct to 16 {' S) [5 N! S7 R) I
        else if A_tote="tote 2" then set A_induct to 2
; ?  O1 h7 Q1 [+ M+ }- t+ B) ~            else set A_induct to 3   
, R9 F3 m' z. L% w0 I        set A_i to 0
5 M; Z, l! Q- I) }4 ?9 m5 f# n  k        clone 1 load to P_induction& i! w: Q0 d+ G. f* |! I& m
        wait for A_time sec8 U. P$ I9 K& u/ q5 U5 f+ u
    end
( @* g* P5 a! s4 @7 V9 L9 h( Aend
, V$ R& S; l* l/ F  W) |# ?; E+ Q: |: G4 x" x9 M+ `4 N5 N
begin P_induction arriving/ D( k% [; w3 n9 j: s) b0 |& x
    if A_induct=1 then clone 1 load to P_pick1
2 ]" s9 h" J! i0 {7 \, L    else if A_induct=2 then clone 1 load to P_pick2
; ?( s2 x. X! J        else clone 1 load to P_pick37 F' j& v* k  I
end. ^" t' K: M3 p) ?8 e
0 ^3 S+ O; ~" S
begin P_pick1 arriving
; g8 q6 S, o& R' J9 P1 p5 H. o    set A_i to 1" O! g* K1 Z2 @, D1 l+ J* L1 ^7 q! S8 ~
    move into Q_induct1
6 W. J6 S3 }& P8 O    move into pickaisle.induct1
2 \- x1 k& Q* p7 S% o    while A_i<=30 do begin
! `7 [' S7 Y7 F. b9 m, {% j        travel to pickaisle.con(A_i)/ [- \+ b: K  w* D- t) [/ y, z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; S1 f: S$ f- ]  [, s* f
        else wait for 10 sec
" A: x" j  d+ P5 Q        if A_i=A_leave then send to die
2 ^6 H; h( P$ z        else inc A_i by 17 J3 T8 l! @% U: ^! Y
    end
6 e2 t; C7 G+ d: s8 ]end
1 g, J# t, M. F; C
- x# P8 v' v5 m9 `begin P_pick2 arriving- M8 o: |- v; V) |1 s' w
    set A_i to 11$ u% A& ~' p0 b8 P" V) u# \
    move into Q_induct2+ z4 c% d+ _& L" m# C
    move into pickaisle.induct2
: n* |; U$ Q# D9 }/ T: ?. b0 O' G    while A_i<=30 do begin
( _- O7 R0 j! R7 Q        travel to pickaisle.con(A_i)
8 I4 X2 t& O4 `3 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; u: c" ]' s1 O
        else wait for 10 sec5 O. ~" N$ e! U: G  h
        if A_i=A_leave then send to die( E/ u$ [7 z: T1 Z8 w" K% ^
        else inc A_i by 19 h* \' ^+ Y. K" k) Z) a
    end! p0 S0 ]5 t* Y- L6 w; |- J
end( \7 L5 L$ S1 o
/ t) f1 n. O9 N" R% j) K* o) s
begin P_pick3 arriving
4 o6 Y9 Y' ~2 B6 f    set A_i to 21
7 O% c0 `( D5 r    move into Q_induct3* J) n" Y% X( n
    move into pickaisle.induct3
- H3 I- [$ K1 u2 Z    while A_i<=30 do begin
& w& j  V; e3 Y4 g        travel to pickaisle.con(A_i)& ?0 `/ G/ g% f: t! Y- ?: l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ~" H. ^. |# ^4 f  X! G
        else wait for 10 sec
( c5 v7 ~$ V+ S: X& m8 r/ N        if A_i=A_leave then send to die4 J2 ^0 O  E5 o- ^
        else inc A_i by 1
" l% S$ F9 Z8 \    end  s0 w$ _9 M8 j. N( v  K
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是个什么东东?! s+ ?$ m4 T2 e; A) _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% k5 k4 U2 p2 H3 i& P7 G
" m4 C) j2 Q( U1 u2 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& G, N! u% F5 v; z, O$ j5 O

6 m* }; r  z- `8 ^9 m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 s& `  F4 w+ _% ^( F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) p3 F. Z* f/ E6 P( A6 r
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ j0 }+ q, v* H5 p* G3 T, S
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! }% k& B1 l% M( A) A. L+ m2 Vbegin P_induction arriving
8 N; ~0 {) v) y. c4 ?    clone 1 load to P_pick(A_induct)
4 G) `4 A- Y  U" j" Dend最大的系/ g1 H3 ]5 f; D" B6 @9 N% V' G

- g& M7 Q" M2 e9 U8 gbegin P_pick arriving6 T; \, z. e, p4 T; s; ]+ W
    set A_i to procindex * 10 + 1' n+ Y8 g- Z; n2 ^
    move into Q_induct(procindex)$ G1 G4 y4 K/ {( B& H
    move into pickaisle.induct(procindex)0 r# `7 |7 |# W  O; G4 i1 E
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 q7 w5 F/ E% U: |+ v, s- E/ c: O8 i
    while A_i<=30 do begin
; e: m  Z& G. f8 R% @/ G        travel to pickaisle.con(A_i)
% N! ^: |  d" O! `3 h! C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ~6 r; g# f: }. I! m$ ^; B        else wait for 10 sec
7 \" ]3 K! j# L4 J" R( G8 e3 j8 |        if A_i=A_leave then send to die. c% Z1 m" x. i0 N6 {' ~
        else inc A_i by 1
+ G7 H) f  L+ S& O    end
, q+ `6 I& V; l6 a  X( Iend
/ Z+ d' ]5 N1 T& w2 z& T& }% ~8 z8 ]$ d' J1 Y  ]7 Z
其中的procindex为整形,代表当前process的序号。
# j, M8 w) S* P5 i( l4 U" g. hstation和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-4-10 20:40 , Processed in 0.017020 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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