设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13269|回复: 2

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

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

5 P) l, c& w4 i我的问题是,在每个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* _# {; b% D- G5 \! Q$ H1 _% @
2 e: B! ^4 {. R4 I% g6 ebegin P_read arriving* j0 \' M9 G, q. J5 b) |/ h
    while 1=1 do begin3 @$ G; M, Z' y) c% n- z. _0 j
        read A_tote from "data.txt" with delimiter "\n"8 k5 ]! S* V5 K( f: q* t4 L
        read A_time from "data.txt" with delimiter "\n"
+ A1 [' Z$ h! q. ^        read A_leave from "data.txt" with delimiter "\n"
/ Y) U* f) D( q( u3 C5 b        read A_picks from "data.txt" with delimiter "\n"
8 s% K& J% g! P' L        set load type to A_tote: d0 T" l; |' r/ N, F' N
        if A_tote="tote 1" then set A_induct to 12 O/ l  A. y# ?  {: B; S
        else if A_tote="tote 2" then set A_induct to 2, }9 X* }2 B2 N& o" |7 B4 y$ {
            else set A_induct to 3    ! b) w" @: {4 N  H, b
        set A_i to 0
. U/ h! l; [, _4 g! B: k        clone 1 load to P_induction
- Q. |& i* [2 \! C# E% S) S        wait for A_time sec
# Y$ b. O# T: _1 Z    end
" S, d& }$ |6 v; Gend
0 N6 e, A6 P- l  a; t/ [2 u1 \0 L+ o
$ _  X2 `6 h# {2 H8 `begin P_induction arriving1 g- [. v1 K, }0 Q# x# o
    if A_induct=1 then clone 1 load to P_pick1& F" b! w% |- ]: k
    else if A_induct=2 then clone 1 load to P_pick2( e( Q6 h0 Q1 V- p5 s5 |
        else clone 1 load to P_pick3/ ~, w# n: i* Q
end
' Q+ _3 L$ Z7 f! l
: d1 L' W9 b8 cbegin P_pick1 arriving7 l7 |# b; ?2 P
    set A_i to 1, [- q3 q/ u3 z, i
    move into Q_induct1
7 x& |- @# H+ Z0 T& r    move into pickaisle.induct1+ x2 Q% N% P& E, b. w
    while A_i<=30 do begin
6 a7 J5 S! M6 L+ s/ @3 n5 l        travel to pickaisle.con(A_i)  V( V7 d- Z1 q# W( v. o! O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ C1 ]; x$ D4 I3 s
        else wait for 10 sec/ r9 {5 ]: b( p0 ?  Y1 U
        if A_i=A_leave then send to die
$ U+ k, S5 e) y        else inc A_i by 1" S* _/ k. a% o( p2 h6 I, _  V
    end
6 ?) a+ R2 i  [  Hend% g" e* Z; R$ l/ o' P6 x& F! i; Q

: X$ H2 A) h, Q2 d/ Hbegin P_pick2 arriving
3 w" n( O5 ]  _' ]: V; V    set A_i to 11* F( a( S* ^7 x
    move into Q_induct2% h! Z9 M% s) N: E2 f3 D, _0 i
    move into pickaisle.induct2- S  ~9 \/ z' x6 Z/ ?+ L
    while A_i<=30 do begin
' }) V1 E4 a5 @9 @        travel to pickaisle.con(A_i)+ B2 O2 d! D! `% ]1 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& Y5 y# ^) {5 W/ F* m, }
        else wait for 10 sec5 d0 b" R, Z: p- N
        if A_i=A_leave then send to die
' M" `2 U/ Z6 I        else inc A_i by 1
% a& w& d5 j6 l4 z( z    end) I9 f4 g( b3 p2 N. x. `+ g# B
end
5 J- l# u: u$ c
' U$ J! c  c2 m- C3 S( T- m/ _$ f! P/ Wbegin P_pick3 arriving
% P2 S  o4 G( J( }7 n. ?: j    set A_i to 21. O' h6 n: b( s5 M. Q
    move into Q_induct3
5 C6 a; N4 l9 v& x: N- v    move into pickaisle.induct3
& L: b+ T4 K3 U* k8 R5 O3 C    while A_i<=30 do begin
0 C& l- F. d: n! \        travel to pickaisle.con(A_i)# q  y. k9 ^, L  k2 s/ q4 N6 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 _; q, h2 p6 S( j
        else wait for 10 sec
! E. M( r  `" L  T* w- p. Q        if A_i=A_leave then send to die
) w# a  Q0 |  G9 q        else inc A_i by 1
' |' l0 }- _3 A8 h# S1 H    end
: ~4 X. }8 ~6 [' G6 B9 }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是个什么东东?% v9 C" @4 h7 [& W2 {  p( W1 G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, X: M6 C# l0 C6 g8 u1 l
; A! x) |1 R/ z, O! G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% x* i, w; C( g( K9 U
  B# e, H3 r& @8 ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 z4 m; I, `* T
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: B3 @" ^. `' U- \! s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' z/ h% ^  ^! ]  u  ^# Y0 B$ W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( D# Q. ]" A- K
begin P_induction arriving
* Z/ F6 ?4 ~: F- n# t$ ]    clone 1 load to P_pick(A_induct)& R$ g& N- q! u2 p
end最大的系; K  a  q  u' I$ [- q% ]' {

2 O9 v+ u- y& J* Z5 i: fbegin P_pick arriving
6 A- a, w" m* V$ |, {7 q1 K1 \1 W6 x& `    set A_i to procindex * 10 + 1
! a  Z4 t' d) t0 K2 |  f$ d    move into Q_induct(procindex)
$ v. X8 q# f  ^; t3 r4 }    move into pickaisle.induct(procindex)  g! S6 D7 B; ~+ c9 X
    /*check the type of pickaisle.induct(i), for your last problem.*/" n  \) S7 p+ e" K% Q6 d

# l7 x; }: I) a  }5 h    while A_i<=30 do begin# S4 ^% n6 s& _/ O6 i! ~
        travel to pickaisle.con(A_i)  O8 T- A; d0 z8 l3 U3 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. b; T  \3 K% U% O% s
        else wait for 10 sec
# H0 G/ L$ O7 Z& c( H        if A_i=A_leave then send to die0 I* P4 l9 J5 W+ k: \+ c! C! T
        else inc A_i by 1
9 \& l; Y, Y# f: n    end6 D- o; w8 r, z4 K, D0 r1 b1 j" V6 a) F
end
' D+ \# F! x( U9 G! Z5 b* H) t( k6 d: D0 S
其中的procindex为整形,代表当前process的序号。+ w; @$ M" v4 _* n8 W6 U2 W
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-31 12:41 , Processed in 0.017704 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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