设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11643|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 M1 E4 E6 _; C( @3 P9 B4 f

/ E) k' V8 r5 p6 C' [# v/ q我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ t7 Z9 `3 f" k+ i" O  b

2 Q. _+ f6 b5 \begin P_read arriving
. ^! X; g: E& [5 s% e    while 1=1 do begin5 T; [3 m  F! I6 U2 L; b3 H
        read A_tote from "data.txt" with delimiter "\n"
& `9 Y  f9 i# p% ^5 ?& H# d        read A_time from "data.txt" with delimiter "\n"
3 N/ i4 F8 w# g9 J8 c        read A_leave from "data.txt" with delimiter "\n") u2 o, N$ S; M8 E
        read A_picks from "data.txt" with delimiter "\n"  T! ~5 A) J; P, y, r
        set load type to A_tote
# g+ x) U! b" `5 D6 B, ]5 y        if A_tote="tote 1" then set A_induct to 1- p. i( d9 o. K% S3 J' L3 l5 g
        else if A_tote="tote 2" then set A_induct to 2
1 @$ @# }! }3 s! W5 x3 W( g, ]            else set A_induct to 3   
0 K% A( k: v2 m. j7 K        set A_i to 0
0 @( u/ T, n; q2 y7 m        clone 1 load to P_induction
& j! q, @3 ^3 x2 ]6 I        wait for A_time sec
3 p6 j# J1 m2 }) m    end  X1 @  N* `. l0 B! `
end) [" u  r. T6 j6 m, G
5 g8 F; }7 A3 ]: g  h' Z
begin P_induction arriving
7 X, [# h& t5 z  v- _    if A_induct=1 then clone 1 load to P_pick12 o, p. n( l: K9 ?5 ~- S$ Y* i% `
    else if A_induct=2 then clone 1 load to P_pick2
9 I8 Z6 G: N* H" ?  ~8 T' h- ^        else clone 1 load to P_pick3; [0 R4 l7 Z- l# E+ L  x! v! i
end  @/ _' s  Y, x+ B/ V
/ f, _# a/ @6 Q) O
begin P_pick1 arriving$ U/ t6 F% \) H$ \  v8 ^3 O* a, l
    set A_i to 13 {8 t$ q' j8 @9 p) i9 t. \$ c
    move into Q_induct1
6 |5 A- P" K: F: k/ C) k7 K: l2 K    move into pickaisle.induct1
/ P, W. p/ t3 E+ J4 q6 X7 ]( b    while A_i<=30 do begin' g4 m0 n* s& l' X& ]
        travel to pickaisle.con(A_i)
, w, G: P$ V( ^" p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 N8 Z1 l$ O, q        else wait for 10 sec
6 K8 [: D; R" M* w        if A_i=A_leave then send to die% b, T1 Y2 A  p5 n# {7 |
        else inc A_i by 1
' p$ ?) K( w" K$ b- g( h* i    end
# R5 O! k$ l, h; V! Vend
9 M; S% ?4 S% H) _2 O, N0 u- Z) Q" N6 p$ U
begin P_pick2 arriving
' e. Q. }4 s1 g4 r2 n. v9 f" o+ O    set A_i to 11
- d/ ]6 L( ~, D6 G    move into Q_induct2
) N# }9 P# w& x    move into pickaisle.induct2
2 g3 B8 E% D0 V2 l* j    while A_i<=30 do begin
9 D8 |" l$ b1 a        travel to pickaisle.con(A_i)8 A1 q  b! `# M( V$ h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% X9 c% ^* e" x        else wait for 10 sec
1 ^+ W: \1 G+ a9 i. X* V        if A_i=A_leave then send to die; b8 h. v8 G% F7 v
        else inc A_i by 1
0 M$ {# V- T% p  Q( {5 ?! R    end3 W  ^: ~, G8 G
end
- J; c$ n: @+ Q* G8 B, U* m
$ R0 D. K5 B, o7 p7 u, ebegin P_pick3 arriving/ C1 M& C# q$ ~. x7 B( a, F
    set A_i to 21: G, ^2 P6 ?5 S/ q0 ~# x
    move into Q_induct32 Y3 i9 ~. N% A2 c- J
    move into pickaisle.induct37 x. K4 p; O9 c; x# |
    while A_i<=30 do begin+ }6 z# P2 j" X/ |7 q
        travel to pickaisle.con(A_i)8 G1 `9 q9 k% |. v6 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- [) r" E! Q, d4 S* z( z6 ~( p        else wait for 10 sec2 b3 d. K# {" G- I
        if A_i=A_leave then send to die
$ b* S- A7 P) d. _1 x& T4 _# O        else inc A_i by 13 u9 W, d6 I# j7 l5 a( V
    end! U3 U. k8 V* L4 u( S" @# R3 g
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是个什么东东?
) L3 X1 @& @$ W# d0 s1 |/ x' T7 Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. I8 E6 @. c! W* q
* c" ~6 \  V2 W' _6 h5 G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. C8 Q& v, Q' W7 l; K
" z8 c% M; G, u0 l6 R- U) N另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- Z  K, H# w; I6 S
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 K0 p& Q4 {2 M2 R1 m6 J: F3 X8 Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 _" L2 ^' @% a5 _2 N! e5 p/ H6 }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& U- J% z) y; {' Dbegin P_induction arriving
  k) I2 s  @% Z. P" ]% E. Z    clone 1 load to P_pick(A_induct)+ C. v" Q+ S3 |5 K8 o& A
end最大的系
& m* [1 S# e* o. t5 e  N+ V0 Q# }9 a8 \
begin P_pick arriving
* N4 N, C9 j: M% }$ U    set A_i to procindex * 10 + 1
2 A, `5 @# P3 z) Q  Q3 x    move into Q_induct(procindex)
$ X. `4 D% J0 X% F& C) ^2 s    move into pickaisle.induct(procindex)
$ Y: x: p9 o4 b3 k3 w& S! J    /*check the type of pickaisle.induct(i), for your last problem.*/
0 j; U  j7 y, }7 ^, Z1 m% _5 t9 e2 O8 _! t
    while A_i<=30 do begin
6 ]! ?8 h; E, L( N6 r) ]8 S        travel to pickaisle.con(A_i)
& E! ]6 A* v5 @, k6 {; c; g" @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 R8 U9 Y+ [! c' M# V
        else wait for 10 sec
$ A' r' k1 n3 Q" m        if A_i=A_leave then send to die1 }1 g+ M: _  U- t! l* C: S
        else inc A_i by 1
# y9 C: l0 q  i9 f9 k1 r  p    end  r$ X) W. z' M+ {1 H* m
end
* T6 S: h- y# N* k$ }4 P* j$ P: z" |, d, _2 v* ?0 Q* _  {
其中的procindex为整形,代表当前process的序号。  s8 [4 j0 k" S% [5 N  l2 O
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, 2025-11-25 16:31 , Processed in 0.015890 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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