设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13184|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; e& R# J* K0 k, Z7 a. m; G
2 C- F3 b$ @6 o/ l/ D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) ~5 Y; h+ C  m$ o4 v

6 [  m  p) S, P; B: Tbegin P_read arriving
/ |4 {, l! G( N* z/ Y    while 1=1 do begin( f* [6 C7 t) I
        read A_tote from "data.txt" with delimiter "\n"" N9 s- H. y2 Y* t: ?
        read A_time from "data.txt" with delimiter "\n"
8 c' r- f3 s6 k& g, y  ?4 h0 B7 P        read A_leave from "data.txt" with delimiter "\n"+ s& t" |$ S- f' A  Y
        read A_picks from "data.txt" with delimiter "\n"
/ t6 O" X8 O. x0 {$ r/ n2 q0 b! V        set load type to A_tote' T3 Z( Y' w% a5 ^
        if A_tote="tote 1" then set A_induct to 1, V% o$ D: `  l+ |1 S8 ~, t
        else if A_tote="tote 2" then set A_induct to 2  N1 A8 K1 \8 B- C
            else set A_induct to 3    9 o/ y7 X( Z/ X6 o0 o4 H2 M3 M
        set A_i to 0: U; L7 V$ d3 I
        clone 1 load to P_induction8 N% l2 Q4 n) O, q3 [
        wait for A_time sec
* o$ U; A, J" ?6 w" T    end5 x! j+ i# r. B  s
end+ `6 e) m3 @0 `2 X: o7 b
% U% d3 L  N- N5 C# `
begin P_induction arriving# i8 S/ q; G  {* X
    if A_induct=1 then clone 1 load to P_pick1
: {0 s3 ], ]- d2 K    else if A_induct=2 then clone 1 load to P_pick2  j! R3 v6 a5 H5 ?" }" ?
        else clone 1 load to P_pick33 p. ?( M% \9 [2 q3 j; J
end/ G, ?! p. v" Z" W6 i
) U) V1 ^% v( k6 U4 S- [* M
begin P_pick1 arriving: W* N- e( K+ X2 y( ~1 C, o
    set A_i to 1
0 k$ _" ?8 v1 Y& T" k    move into Q_induct1
* X, I6 h+ M7 s6 k9 l: s    move into pickaisle.induct1
* J+ {/ u3 M- Y5 h    while A_i<=30 do begin0 J; Z: b; ]4 T# A  Q
        travel to pickaisle.con(A_i)! n# R) [4 \; g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 Z( Y, K7 g" V9 [        else wait for 10 sec
* f  M. R6 o7 l2 d  |        if A_i=A_leave then send to die& d  x- l- T9 Q) T. [( _$ m2 ^8 B
        else inc A_i by 1; l+ N6 j" B, M1 m
    end9 {8 K5 X( ~. H8 ^  |! b
end
* ?) Y- b$ F$ o' f
& J6 h( I2 v6 b) x& ^begin P_pick2 arriving/ m3 ]& ?, c# s9 r
    set A_i to 11
1 B& m* X5 ]* \% R    move into Q_induct2
( ?1 Z& X9 i! A% Y* ^- C" @    move into pickaisle.induct2! b$ `1 o8 E3 Q3 x. a  v# ?
    while A_i<=30 do begin
4 j4 q: p& C6 O5 {3 P. r        travel to pickaisle.con(A_i)
  R# [+ o9 E1 F" f, i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 V6 U5 _& H7 k5 T        else wait for 10 sec
$ ~7 `" Z! E# Y) D! F        if A_i=A_leave then send to die
* x. l/ V2 N4 m" ~2 q' f) e        else inc A_i by 12 }2 C; s3 M- C' V$ I
    end
% H! D$ ^) t) a0 y# A8 U! oend
" f$ F$ @4 t  H" Z' `3 A6 X$ t* }7 m$ v' A& ~8 q
begin P_pick3 arriving% C( {/ \; t: d& K
    set A_i to 21  C, a* e1 _' v% h
    move into Q_induct3; U7 x3 C( n. t
    move into pickaisle.induct3/ P$ @, j, a3 V. P' ~: `1 f" s! |
    while A_i<=30 do begin
6 }) x6 n7 s3 V# D& ]        travel to pickaisle.con(A_i)
  a* s# s: X- I9 p# z( Y) l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 V$ _: i( F! z9 `( j
        else wait for 10 sec
! N7 l  g' e. O        if A_i=A_leave then send to die
1 {! A8 ?& H9 W" @$ h1 J; J        else inc A_i by 1. S' T# e1 X6 Z1 O
    end
+ ]9 b* a+ [% ]8 D& Zend

最佳答案

查看完整内容

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是个什么东东?' M* o. n" q' I9 `* X
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ z! w6 ~- Q" E% r3 u0 B
8 P) g: P2 h% ]7 ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( c6 ]4 [) W" m; B9 d) ?  w
% {8 `7 h0 L9 p) w/ {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ b6 y: E( V2 x+ I0 Q9 j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 k! f6 a$ h6 |* K" W
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 N7 J! R, f7 _2 E3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ W" ^7 U( ^5 R5 \: g3 ^: p0 Hbegin P_induction arriving
% n. `3 G" Q6 |/ ~9 b2 X! K    clone 1 load to P_pick(A_induct)
' g6 v) W& o2 Hend最大的系
+ C/ T! [& ^, z3 L2 n! `" O5 b) x
/ H4 ]; `! U0 y8 h5 Qbegin P_pick arriving
# C2 I* s3 p' r: P    set A_i to procindex * 10 + 1
* s" u! j' a& m, q! p2 E' i  R    move into Q_induct(procindex)% e% O0 ~7 `/ b& i6 V: \! z
    move into pickaisle.induct(procindex)* L2 m) ~1 E+ A7 ]: e6 v/ a
    /*check the type of pickaisle.induct(i), for your last problem.*/$ G/ c4 f3 r: l! c% a- s

. X# b# ^! g$ @! S  K    while A_i<=30 do begin9 X+ Q  }7 `) S7 t  n& B' X
        travel to pickaisle.con(A_i); {; n2 y3 T& U( g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( T; ?7 h2 a* Y5 d5 S) M% J0 h' h        else wait for 10 sec
# e& W9 ~3 _) Y; M7 z        if A_i=A_leave then send to die
" N! Y1 f# g5 G* |* T3 f% s        else inc A_i by 1/ P6 c+ O% F  `' r% R) P# r0 U" J
    end
* l! i4 w0 J+ Y( [* p$ Iend
6 M* u3 [  i7 ^8 U$ P* w% v8 v# w- w- U* p0 V  p
其中的procindex为整形,代表当前process的序号。
5 t$ Z# q3 `' K6 vstation和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-3-25 07:23 , Processed in 0.017607 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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