设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12717|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 m  x- N: T& q# c
) p$ G0 x" \1 D  V% a我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- `, o7 a! ?9 f4 w5 N( a
8 S* x& p1 ?* V. W; L7 Kbegin P_read arriving
# V7 ~# u- Z: F* f4 d9 J    while 1=1 do begin
! D, ?, x) W! z# {9 o        read A_tote from "data.txt" with delimiter "\n"
6 x9 X( h' l$ m, W# K7 g        read A_time from "data.txt" with delimiter "\n"
* T6 Q& _5 ]  C# \- ]& G$ u, W% H        read A_leave from "data.txt" with delimiter "\n"
  @$ y" }& U6 G. |% [. W( C: C        read A_picks from "data.txt" with delimiter "\n"
- ?) ~/ Q1 O( N* D( X. }        set load type to A_tote% n. q% f8 ^( g' z$ {, t7 }3 P
        if A_tote="tote 1" then set A_induct to 1" K$ h3 x1 S& L
        else if A_tote="tote 2" then set A_induct to 2
" {1 j- m7 e/ c$ K) o$ T8 A% l- k            else set A_induct to 3    0 e" F' u' W4 J; N
        set A_i to 0# }3 L; x) N9 S. t3 E0 B
        clone 1 load to P_induction# ?! d- Q3 C& M
        wait for A_time sec( O. b) K6 K. h1 N
    end0 ]' d' o6 R0 {  `
end- u) m- S4 a; \' C9 Q" e
! q2 t/ O9 B" Q4 t
begin P_induction arriving
% U, s( u3 Q* i$ x1 u! h% r    if A_induct=1 then clone 1 load to P_pick1
6 y. P# N+ I& W& t: S    else if A_induct=2 then clone 1 load to P_pick2% i- n8 T/ L0 f5 Q/ w* J8 I
        else clone 1 load to P_pick3" w7 }, l  m! C6 K' i3 ^& D+ v
end
! k& O! H5 S  Y* {, a% s8 K2 A( l5 ]  I3 |
begin P_pick1 arriving- e, V3 [6 ^% w  N" ^) D- I+ b
    set A_i to 1; ]) C5 y) @1 |. r2 }
    move into Q_induct1& D0 Z! T7 X  R' x
    move into pickaisle.induct1
/ v- _; [' Q: T7 S' X  W0 N& d1 ]3 A    while A_i<=30 do begin
5 D2 k! _  I# ?; L: e; F& P4 c        travel to pickaisle.con(A_i)' U$ w% H" C6 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, P3 J& M( U# S- D5 i# P! w% o# {
        else wait for 10 sec! ^; q) K: X6 d9 q+ ^* h6 S6 u9 z- h
        if A_i=A_leave then send to die6 I' x; C! N  a7 f5 ^# k
        else inc A_i by 16 l" V* B6 P0 v+ J
    end
, o: D+ b2 n( y" hend
( h4 W* @. c3 h9 B  t7 A+ N
% a+ b8 j9 p  y4 M) H: w! Q: K& L$ Xbegin P_pick2 arriving. s4 t( H8 s1 d4 P
    set A_i to 116 i8 ]5 M- T/ g% Z$ R+ c3 u9 Y. B
    move into Q_induct2( \# P* W( C( p* f) p
    move into pickaisle.induct2# I% ]5 K% y8 J0 C. h) v  v
    while A_i<=30 do begin: S! _% C: C8 p7 g# V
        travel to pickaisle.con(A_i)6 K# c# i0 ]5 S1 |' ~8 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 X- L% V. @( ~  p        else wait for 10 sec! B8 r7 X( c- u. @% L& K
        if A_i=A_leave then send to die
3 m9 D$ M* ^# h& c! d9 }        else inc A_i by 1
/ P% p- b% r) A0 y    end) @# Y& N3 m% J$ P7 m+ |% _
end6 n5 x+ {- ?' d0 p) d
0 l0 R" b5 i( P9 M0 g0 e# a8 t! V! B
begin P_pick3 arriving
, S" ?% V2 ]3 D" A) H  T& A8 g9 F    set A_i to 21
: N6 G; E; D9 Y7 s    move into Q_induct3
2 H  }& x+ ]6 w4 L9 o0 r( o    move into pickaisle.induct3
& R9 T. h: [) g0 F0 Q, \9 V  e) P    while A_i<=30 do begin6 j$ f$ T5 F. R' z/ {# R( k. J) N
        travel to pickaisle.con(A_i)  u6 {, H+ @5 M2 {, n' N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 s! m; z8 x- z& _# v. F* s$ u7 T        else wait for 10 sec  s2 b, A$ e  e% y
        if A_i=A_leave then send to die
) d0 W. _% S5 V/ o  s( r, D        else inc A_i by 1
" p5 C- r3 P. y8 Q    end1 y" m0 ?: [" X# n3 ~. J; `5 |
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 b# B; k, V) V) R$ ~1 s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 ?, x" `: ^0 e( O% r8 D, W/ r
5 k4 k3 d5 J: @* h: j0 vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ z# [) @- n( X2 j) m& V

6 j" u. t) U; S' t3 _& ^: z0 V另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 X$ t! [( y' ?. T2 a# Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' j% I- S9 i. V" H& {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 R) ?$ u5 o& }' u: V& o  A- B, B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- Y! h2 d  F3 Ybegin P_induction arriving0 w) X9 k% S1 r4 @5 N
    clone 1 load to P_pick(A_induct): S/ {! X& d$ @
end最大的系2 [, w' @1 P9 m  ~  O1 e: v& G2 {1 {" d

6 R6 L8 h9 n4 d, C" y) zbegin P_pick arriving
4 m3 _# k+ }& I- [/ ~3 u    set A_i to procindex * 10 + 1" c8 I! x4 a" o$ Y
    move into Q_induct(procindex)* N* s/ E) f) b& W( a; S
    move into pickaisle.induct(procindex)0 Z9 X0 c5 ?7 _1 j+ _  Q
    /*check the type of pickaisle.induct(i), for your last problem.*/; @8 ^* ], |* C% s! P7 [+ k
. ^) ^( E0 v" I1 y$ c
    while A_i<=30 do begin
8 W/ W, o5 d6 h        travel to pickaisle.con(A_i)) S! S0 U: d( @7 s+ D. ?0 Q9 q8 _6 ?# g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) M! y. h* s3 X5 A% [        else wait for 10 sec
8 d8 E9 }5 o/ k- ?6 b        if A_i=A_leave then send to die
1 |" {6 }( Y8 d( B: t# H/ F$ i        else inc A_i by 13 ]8 i" r5 u  p
    end% G1 R$ d' b6 I
end
# n2 E) o% |  l/ z
. @3 @. x1 @$ d5 d$ M  L其中的procindex为整形,代表当前process的序号。
3 q7 u2 `/ n- W$ Qstation和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-2-14 00:40 , Processed in 0.018112 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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