设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13823|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ A, I0 \) T9 i& C6 W- I; I7 V# {, y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ y. ?0 r; i+ o3 U
5 d2 G' c/ c2 a/ s' B
begin P_read arriving! y; ~8 E! A5 Z- B6 S+ i
    while 1=1 do begin
- t# t* E3 E# T- S+ e        read A_tote from "data.txt" with delimiter "\n"
% j& i, V/ ?6 I1 O; q4 b+ M  e        read A_time from "data.txt" with delimiter "\n"
0 c% O8 J& O) d        read A_leave from "data.txt" with delimiter "\n": Q: z1 W5 {# T5 R1 P
        read A_picks from "data.txt" with delimiter "\n"1 A) ?; k: P& l0 }! p/ O  F
        set load type to A_tote
+ Z3 w; F% H, L0 C# T$ R  Y3 K+ r        if A_tote="tote 1" then set A_induct to 1
% `/ A1 A0 a0 ^5 E; q( q3 |! d        else if A_tote="tote 2" then set A_induct to 2
5 ~  ~" j9 C4 Q; r            else set A_induct to 3   
# ]% s+ `; l( u5 n+ {        set A_i to 0
1 V8 x" T) e3 v: Q7 j! x/ l( q        clone 1 load to P_induction# i# y8 Z6 M5 M& V5 {4 o8 p, t- L* N0 q7 l
        wait for A_time sec
" ]" f6 X/ \: }, _2 W1 H$ c. I    end9 q2 C( r. u8 D$ A& k
end' W! ^) w+ {9 A& z' z( Z
3 F2 a2 ~4 g! }( v
begin P_induction arriving) B2 g; F, U: }3 T" v
    if A_induct=1 then clone 1 load to P_pick10 A" P8 ^$ s, R
    else if A_induct=2 then clone 1 load to P_pick2* j& u! }( p: K$ h
        else clone 1 load to P_pick3$ p. d) c  p1 ^; A
end' C1 {- S1 o% S
4 `- B6 X% w8 u, E. u# Y
begin P_pick1 arriving
/ `  D. y& e4 H  y$ k7 v( s+ B* v4 B9 ~    set A_i to 18 c1 U3 h0 f6 T9 Z, A2 Z
    move into Q_induct1
5 ~1 Q  b3 I" P0 I; \( [    move into pickaisle.induct1
& l$ N. O( x8 F6 L9 f    while A_i<=30 do begin) p! _7 u. g8 Q3 D; H
        travel to pickaisle.con(A_i)3 L6 C$ C. Z* J. x" P; t6 u" Z# m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) c( O: f; E& L- l9 `6 B5 D        else wait for 10 sec
- W+ ^3 t* Z, @0 y& k% s        if A_i=A_leave then send to die
' A& R0 M$ F/ Z3 b        else inc A_i by 10 @+ V  i' S) I0 n
    end, x# U5 h: F8 C2 R& `
end1 k# T! K8 p+ l* Y
; f3 X7 i( O, R  ~/ g( {
begin P_pick2 arriving
& b% ]; e! {" Q    set A_i to 11
9 D, T& Z: ?( ?9 x7 ?4 z    move into Q_induct2
: T& _' J9 S6 Z* }0 F    move into pickaisle.induct2
0 A+ r% Q9 v% o    while A_i<=30 do begin3 h: s9 V& U, g( _+ j% k9 T+ }
        travel to pickaisle.con(A_i): R1 R3 j/ _3 A3 C6 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# E! j1 g9 E: Y$ }5 O  S
        else wait for 10 sec
% g$ X/ t& T( f; m+ b8 T0 h4 o        if A_i=A_leave then send to die
1 ^" K% S' D" w9 D+ R! [        else inc A_i by 1
& l" M' p# q. v( G; o% `    end( j1 X) T! r* T& j+ @
end6 y( ~1 p! I8 T& G2 s8 q

/ J- }  Y* H3 l7 F3 X- A' |begin P_pick3 arriving
5 N$ T( @& @* ^9 H5 z    set A_i to 21
2 o, j! K. T4 O8 N9 a8 m+ a    move into Q_induct3
1 G+ ?' f, e& l  U" D: ]) C+ B    move into pickaisle.induct3( z1 y. m! {/ i% K2 c
    while A_i<=30 do begin7 q* @/ R- j; t; r
        travel to pickaisle.con(A_i)5 e# d* b, m9 f1 l& u6 }$ O! ?6 g: ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, w5 I# f- r, s
        else wait for 10 sec
% E3 P- R! w: ~- O  ~% s5 F4 Q        if A_i=A_leave then send to die- I4 y- q. M+ \
        else inc A_i by 1  d/ M' J; ], v$ N/ w) Y, S/ o# r
    end
3 R1 l  ]% `! p+ {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是个什么东东?
/ r* Y+ [* A* u' P. t$ }* P0 amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ b6 |# e0 S4 q; L( V7 _# y5 _+ R6 L1 f7 F% T, z3 n' p: W6 m4 x5 _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* [0 J6 g7 i9 W* {
% s0 ~* E% O) p7 b) I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ P* O8 D  L3 K( E; r" `$ g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, [" n8 G& X* t3 M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) Q# z: E9 ?  ?9 D+ L0 v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 n9 d; D/ p& v8 M
begin P_induction arriving2 M7 M) H- o% X& o+ `  I: y
    clone 1 load to P_pick(A_induct)2 i( T. w9 T6 a+ f! O
end最大的系
* ]# N1 s  h) T7 k5 n7 k
8 }2 W! W# h; k- D! ^; \4 _3 |& Pbegin P_pick arriving' C: X: U$ N" U6 @& t9 \
    set A_i to procindex * 10 + 19 m/ ~6 h! Q4 C7 M0 k* _% ?: A% p2 @
    move into Q_induct(procindex)
* n& f" P, i7 Y    move into pickaisle.induct(procindex)8 |3 H; h7 M" p
    /*check the type of pickaisle.induct(i), for your last problem.*/6 q8 `% l, _* R( {+ j$ ^% v4 C

# U1 n4 g: k* o    while A_i<=30 do begin$ x0 S' G$ }* d6 P% w4 K4 ?
        travel to pickaisle.con(A_i)+ s% x) C7 D8 G* ?4 f# h- u- D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 m4 G4 H, [; w
        else wait for 10 sec
6 r% L1 F  P0 j0 }        if A_i=A_leave then send to die
( E  f# g, C: d) @        else inc A_i by 1  T' d' I" d6 h0 D( m! x2 y7 l
    end
6 ~+ V5 v: ]3 U$ U4 ~end5 K5 T. w7 T' \% ~

; i' W0 A7 O% N# I5 C其中的procindex为整形,代表当前process的序号。; h) E6 K; A+ O2 |9 j# p% L( }
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-5-8 14:58 , Processed in 0.014522 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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