设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13807|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ l7 F  ]' \# r- ?. X. Z
* N1 ~5 m  Y8 L+ b9 G1 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中的数值,不知道会不会有什么不妥。7 J+ [0 q; t4 ^+ F; v' ~4 o
+ c* e2 }2 D- ^" {( `3 G
begin P_read arriving  {" S9 b8 e5 S+ W! N4 I
    while 1=1 do begin8 ]& z' ]7 _" P% ?  ]& x$ g: x
        read A_tote from "data.txt" with delimiter "\n"; C, Y" l5 C0 y, z* l
        read A_time from "data.txt" with delimiter "\n": h8 ^, G% X: f9 X9 B
        read A_leave from "data.txt" with delimiter "\n"
  k. d2 q$ e4 S, `) b7 |        read A_picks from "data.txt" with delimiter "\n"1 c* [! W$ `6 N0 u
        set load type to A_tote
+ q+ v2 V# Y0 ]* b  y# t  a7 w        if A_tote="tote 1" then set A_induct to 13 n! ]3 Y' E3 t
        else if A_tote="tote 2" then set A_induct to 20 o" s1 M9 m* ~0 v& Z2 J0 D7 F
            else set A_induct to 3    , B2 D3 ^* T. C  R4 T, _9 X
        set A_i to 0
: h" |1 C$ Z, N        clone 1 load to P_induction
  ^% U# p: |9 k% M        wait for A_time sec/ a) J! A9 S7 n% Y6 {9 f7 W& v3 [4 m
    end
6 r" n; f. K" I" j. {end) m8 b8 Y# C2 c! o
4 P5 y  N8 p( C; v- y
begin P_induction arriving4 C( A" _, [7 l
    if A_induct=1 then clone 1 load to P_pick15 `2 ~) [' i3 U% E8 d3 Q
    else if A_induct=2 then clone 1 load to P_pick23 }) A. ~. c: Y( x# U; A
        else clone 1 load to P_pick3
# ~3 r- a5 N  X9 @& q( k& Yend7 g8 C3 R( w: o

; k% \/ x* n4 E" ~: s  [, Obegin P_pick1 arriving; [' \  U7 {- ?" ]8 F( l, b
    set A_i to 1
' e" T" A% \! T8 B! k$ g    move into Q_induct1% X, t5 ?; B. ]- F4 z4 l
    move into pickaisle.induct1  T( ?0 i0 ^3 a# \, {  p4 X/ ]
    while A_i<=30 do begin, p( W' _; J% |$ i+ @% I3 a
        travel to pickaisle.con(A_i)% T% s  Y$ U3 g! |7 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ h* d% `, m3 [" M6 T, y        else wait for 10 sec  `* |6 D" f- ?' w. _3 `
        if A_i=A_leave then send to die  u; T, H1 X: s$ A' A
        else inc A_i by 1
' `! o' n- \6 `( K9 f3 z    end
8 L' G" P0 a; z6 I- W1 c) zend9 E& n6 j# I! P: E+ F! S: Y

. {6 d8 w0 j$ i4 X  xbegin P_pick2 arriving
, f0 F& T$ {) H" F. ?# H1 P    set A_i to 110 w7 i! O) m# R" V6 W
    move into Q_induct2, T! c: Z" I% n7 \( V% K
    move into pickaisle.induct2% V; `& V/ ]0 A" P: H9 p* [* _% J6 Q
    while A_i<=30 do begin
% h! [( t+ n8 D. o4 p) B1 C        travel to pickaisle.con(A_i)
6 {0 n; i5 A8 O% i/ Y& [$ v: H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 g/ s0 U4 }. z. ]$ h% K7 c/ [- V
        else wait for 10 sec3 {+ A/ C9 l( s- N
        if A_i=A_leave then send to die9 {" q) `. ]+ z9 v$ P4 \
        else inc A_i by 1
+ n" Z9 n, \. }    end) ]+ s8 A' E. l3 E- ~3 h. F
end. _9 s/ z' d4 A

, K* c9 g. T3 q' h3 V5 q: ubegin P_pick3 arriving
( r" a4 O9 l  L- S    set A_i to 21. ?; E2 Z- x+ `4 ^1 _2 k: n! U
    move into Q_induct31 H$ [) X) X3 t  H$ o
    move into pickaisle.induct3
) @+ X8 G: b. Y" l9 S    while A_i<=30 do begin: f2 P5 D# Z$ D- Z1 b
        travel to pickaisle.con(A_i)* X& ~9 e% M) C3 ^9 t. n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( C2 W* }8 @! G: a; D- }* K
        else wait for 10 sec
8 G8 u* v7 A4 Y* Y        if A_i=A_leave then send to die
* j4 s, ~5 r  R' Q) v1 a        else inc A_i by 1; u" Y( ]  F0 v+ w
    end# F. V1 e( w* L, u
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是个什么东东?
3 g5 G# Y) b+ E* O4 J) k: q: [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' }* j4 U4 C' g# E3 A3 H- O' v( c% E

7 p" p( @) d8 p4 ~: rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; N8 j; e  U9 O+ U  ]1 E5 [
6 G$ @# k$ J4 h  c0 C
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. r2 B' }) I7 F# w8 f+ l$ \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* B6 m3 e1 T8 a/ `) ^$ ~! ~9 ~4 a; s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! }8 z( @3 ?" d+ [2 X' b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& o: ]4 B" A: G, l9 sbegin P_induction arriving
6 Y4 n" s. x" H. v  C! C/ u4 {    clone 1 load to P_pick(A_induct)+ F# H9 r- f$ p8 Y. L5 j
end最大的系4 {+ K" w( v6 D1 t) {+ |

6 y8 b( Y' N4 r& T, ?/ ~begin P_pick arriving0 a  C( N0 L# D
    set A_i to procindex * 10 + 19 k5 S3 k  P5 B, E# U
    move into Q_induct(procindex)# C3 f& X: R$ `+ t2 A& U2 ~9 B
    move into pickaisle.induct(procindex)
1 u% l3 C+ l6 x$ o    /*check the type of pickaisle.induct(i), for your last problem.*/
5 X# U$ ^2 V3 d5 ~: u
6 B: r% C) u' h$ X" n" c! w    while A_i<=30 do begin
3 X9 h( J9 `8 h/ O* {$ s  V        travel to pickaisle.con(A_i)
4 v. f3 `: [% _- {" T; u& L% g& h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. R. i0 D3 Q' ~" A3 K        else wait for 10 sec& B1 Y; m, d0 D% U: ?% c
        if A_i=A_leave then send to die
+ d/ {" a2 r, [        else inc A_i by 1
. m3 |3 \4 K) _    end/ ~# ~; d8 r4 h
end
( }3 Y2 z) C5 x: x2 M
1 X( E$ Y" Q- w. B其中的procindex为整形,代表当前process的序号。
) {9 Z, W* @, ]. n6 `( Xstation和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-5-6 16:51 , Processed in 0.024550 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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