设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10383|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' R9 R, e- m; `2 b
8 {1 ~& D: t! U+ x1 i4 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中的数值,不知道会不会有什么不妥。! g3 |3 t( c% t7 e6 I, N
; d2 m5 I' l* R7 x& F: b! H" b; f( k3 f
begin P_read arriving
$ h* H# K' q. U- c* R5 M    while 1=1 do begin$ Y- s. I  K+ A
        read A_tote from "data.txt" with delimiter "\n"
+ {6 ?( j( |* q% n        read A_time from "data.txt" with delimiter "\n"
2 m$ G" m7 X3 W& L- j3 W; i        read A_leave from "data.txt" with delimiter "\n"
8 [# Z8 _2 @. ^% `4 n2 a% h        read A_picks from "data.txt" with delimiter "\n"
1 J- Z2 d! m! K/ q" W        set load type to A_tote
: v/ }/ Q7 ^# q# c+ Z        if A_tote="tote 1" then set A_induct to 11 c, G( U  D* ~  O% X: ?- i
        else if A_tote="tote 2" then set A_induct to 2
3 K6 A" V. L/ c9 Z5 t; s+ z            else set A_induct to 3   
( v; b3 `( s" S" G* c! [        set A_i to 0
2 w: T/ f+ x& R/ F  B$ T6 j" F5 O! v7 p        clone 1 load to P_induction
+ b$ w! \8 R" F6 ?+ o$ n: {1 H        wait for A_time sec+ W3 N, o* S( g9 R5 f. n! F8 z6 g' p
    end5 j3 b9 ^5 N) a4 S
end- C( a+ w, b; X1 P+ r. C
4 ]. }- }- x. H; Y! B
begin P_induction arriving
0 {2 |; a- G! a. R    if A_induct=1 then clone 1 load to P_pick1/ \* o8 @3 e4 U  L1 ^. |" Y* |
    else if A_induct=2 then clone 1 load to P_pick2
0 U0 Y* z! q. O9 q        else clone 1 load to P_pick3# O7 u, _% H# u- v- e# X0 U6 R1 [
end) h8 a+ p7 F, i8 R# W9 \' C

, r2 Q  G1 j  _! p; A5 Fbegin P_pick1 arriving
( T5 t; d( A  W3 r    set A_i to 1; e  z2 a# P$ d; h2 T6 ]1 c
    move into Q_induct1
2 E, o( Y) E/ o! C    move into pickaisle.induct1
/ b- ~1 w$ i# p, p. s0 C: U    while A_i<=30 do begin2 j/ D3 ~+ Z' Z
        travel to pickaisle.con(A_i)
; ?. y! F6 }! B4 f4 Z( O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ~( H1 P8 n, X3 a7 }
        else wait for 10 sec
) L. R0 ?& t; |: P& H, A+ h: `        if A_i=A_leave then send to die. W, r9 i  S' p9 W. o
        else inc A_i by 14 s# W+ H& f) E1 |
    end# ]; V% T  ?2 a$ K& G2 A
end) C# S: `& u, n! w" o6 W% I5 \9 T
$ m# {* N- F. M5 @% a* m
begin P_pick2 arriving% y0 V( V4 T2 D& Q
    set A_i to 11: ^) X% ^5 A6 V+ s) c6 C
    move into Q_induct2
" Z' t& q; I' N1 f# V0 }. B    move into pickaisle.induct2
& ~! x, r5 V0 H" E  X5 b  F1 i    while A_i<=30 do begin! I& g! ^' m4 j% u2 \8 y5 Y
        travel to pickaisle.con(A_i)- }, t& i  m. r' ~. \8 O6 ?' E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ l4 P7 v! j7 b- R4 T: y% Y. C        else wait for 10 sec
1 V; |3 [1 [% r8 B4 i8 u& P, Q        if A_i=A_leave then send to die- S9 d; h. R) d6 o& h4 d% M
        else inc A_i by 1
+ k) T0 C9 [; O% [2 ~    end* m+ F: P6 C6 p( i
end6 H& E, R" C8 |' T. s( k0 O  E

' `8 K* S0 h9 ^; Z* @( R' Qbegin P_pick3 arriving
3 X- f. K+ P/ z8 r    set A_i to 21
6 i6 `, j* P4 n, W3 S& A6 l    move into Q_induct3' D( o7 Y% ]% {+ \$ `
    move into pickaisle.induct3! Z( S, [) c2 ~# k3 e
    while A_i<=30 do begin7 `6 Q3 y9 f& z0 _
        travel to pickaisle.con(A_i)7 p) i4 [0 m% R1 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- L2 ~* g2 u/ c8 ?
        else wait for 10 sec
) j' v) K( _3 U$ v! U4 K3 I" ?3 `        if A_i=A_leave then send to die
& F8 N9 z8 H" D) U        else inc A_i by 1+ D4 S2 g. c" \' U! C
    end( ]0 W' T& [- u& o0 j6 v
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是个什么东东?2 ~9 r! a3 S7 r) ~, h3 ]) c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; v. a9 \4 }1 x1 ]6 a* Q/ ^# \4 P% V5 B- O0 v2 _% U9 S( B% J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 T) t' q# o: S9 e

" u8 T# V$ C7 i4 k: w+ R1 z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) w: r( ~: O" [& s; z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 G8 _% N6 m4 x) `# x, B/ g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 D) C, I7 @, H0 }2 ]- T6 s8 a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% \5 V/ T" @6 nbegin P_induction arriving
+ b( H* ~- P7 }  X/ j9 `4 C    clone 1 load to P_pick(A_induct)
+ O- z# i; i) j. P* @  Bend最大的系
4 ~, n4 O+ P( E3 a: Q6 {( E, F
begin P_pick arriving5 s& R# z4 L# f
    set A_i to procindex * 10 + 1  ]9 M2 c# w8 u& @7 y, c% R
    move into Q_induct(procindex)
" }  z- l1 Y3 l; H# m9 f    move into pickaisle.induct(procindex)
+ y8 m$ a3 P- m5 f    /*check the type of pickaisle.induct(i), for your last problem.*// }8 d5 X  g% ~1 y, F# Y# j- f
$ Q. W3 ]( A' n, O! u- T
    while A_i<=30 do begin7 d3 P6 n0 a) {$ o4 n+ l; a
        travel to pickaisle.con(A_i)
8 i5 a8 N& ~. ~4 _( ^. Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# t& j$ q+ e/ T6 \
        else wait for 10 sec7 d3 U1 B/ M3 X/ E5 m' T' y
        if A_i=A_leave then send to die
+ Q" S5 ^0 o. g6 [+ O. ~; r1 i        else inc A_i by 1; H! M) U3 ?& N4 B! V, I6 v2 X
    end
1 T4 p8 v' \5 B# Zend; d# w* N+ r+ h' ~6 G
2 w, r/ L, ^1 N5 H- _
其中的procindex为整形,代表当前process的序号。
9 o6 d" C7 @) s. wstation和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, 2025-8-27 09:11 , Processed in 0.017207 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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