设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12896|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* r: [; p+ o  |) ?6 h/ x) |+ Y
7 o& T$ o4 N# d9 `5 e2 r( d" y& M2 T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ ~+ M0 U. u+ p# l+ f

$ W, A  P  {( Y' y  V2 `1 mbegin P_read arriving, O0 Q7 f8 [' K3 M9 v  q
    while 1=1 do begin- e) E1 M" R7 r9 p# G$ Q6 n
        read A_tote from "data.txt" with delimiter "\n"' ~. d9 Z: c( g# _
        read A_time from "data.txt" with delimiter "\n"7 w3 R" h( M4 P, l' z3 D
        read A_leave from "data.txt" with delimiter "\n"/ j' @. z4 V0 p* D! r' Z# o4 E0 Y
        read A_picks from "data.txt" with delimiter "\n"8 i; j* e0 f/ }% j/ h8 u0 Q
        set load type to A_tote$ p7 X2 r. V' v3 Q
        if A_tote="tote 1" then set A_induct to 1! I1 L8 y0 d( ]+ \
        else if A_tote="tote 2" then set A_induct to 2
8 ^  t8 d: N4 I0 T2 D. P8 s  X/ @            else set A_induct to 3    ' B7 A1 h$ G1 O& q( s4 S# K( }  _
        set A_i to 0
) k4 O% a* O( ^* C+ M" L- W        clone 1 load to P_induction
3 W9 }9 L( p* N: k# \# F) V: ]: u# X        wait for A_time sec
+ v. C: ^( L7 B! l2 x2 ]    end
% Y2 I* l5 u  y/ F9 T% q# ?4 b( l0 Pend* e2 `. d7 Z+ x; x4 L+ |2 E2 g( e

2 c/ d. q5 N& _! y' \begin P_induction arriving: P  V. n- ]) t# b0 w* k
    if A_induct=1 then clone 1 load to P_pick11 `" p2 f+ [! L
    else if A_induct=2 then clone 1 load to P_pick2  r: t+ ^4 d; P9 ~- I
        else clone 1 load to P_pick3
" t5 y" g4 _: l, T; B& m- M: Tend
* H& B& P9 T2 P, Y( h0 `! O* s) d! X, I* W& T
begin P_pick1 arriving
; Q3 U/ d' E& f# d6 r    set A_i to 1! p& `4 V/ u) s$ Z. V! Z) t8 g
    move into Q_induct13 {8 h, |; |" D. k
    move into pickaisle.induct1
$ o$ }3 {0 F/ R2 H/ D    while A_i<=30 do begin
6 I* ~# Z. k, X        travel to pickaisle.con(A_i)
& z6 I  O, Z2 R7 }7 }' `# B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- r8 h$ ^7 k7 D7 C7 e, R  M        else wait for 10 sec
/ m* M: X6 u  o2 o$ T        if A_i=A_leave then send to die) B/ I3 X% j: {$ j6 q
        else inc A_i by 1) o; ^3 i- a* I: u$ Z, W8 ?
    end
# M( ]* W' z4 [2 n/ |+ Nend) H$ n+ o8 {, p$ B& q5 m; r
1 \7 T" `; m/ M7 Y4 m: A* \+ A
begin P_pick2 arriving4 }4 h" f# a1 G/ |; |
    set A_i to 11
+ p& s4 y) w, h' i" x4 }" u    move into Q_induct2
  `& j; u3 S, k# e8 |9 P6 G  l    move into pickaisle.induct2
; L7 ]: ]; ]& G2 W. g  R, Q3 n    while A_i<=30 do begin
* j1 u' B0 l/ i( k* _9 {        travel to pickaisle.con(A_i)% [3 p1 ^. O! ~: E; Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 T6 Z1 z" p4 S" m5 M% e- h
        else wait for 10 sec. X( U/ Z7 [- n; s/ \
        if A_i=A_leave then send to die
6 ~0 _- m; E* J        else inc A_i by 19 C% ~4 p/ v4 ~  N: W: G* C
    end3 G0 [  e; p9 g
end. o# K% a2 }+ R

: d; W) g6 X' T( C& [2 kbegin P_pick3 arriving! f* P) w, x  G1 t2 h
    set A_i to 21) l8 q0 k  V! |1 \
    move into Q_induct37 y& f" Y6 Q1 l" x
    move into pickaisle.induct3
6 I2 B1 B, D$ |6 s    while A_i<=30 do begin* q4 d- T9 y' h( h$ o
        travel to pickaisle.con(A_i)
, l' i+ \2 Q& G" }, ~+ A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. R7 t" L6 _8 A# L, `* Z9 M        else wait for 10 sec
! U& A! [4 ^* b        if A_i=A_leave then send to die
3 _! N. K4 i( Y        else inc A_i by 1
% r( `) h1 _* p    end
# L& k$ c4 z& G* c+ i9 ^, ~8 ~$ Pend

最佳答案

查看完整内容

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是个什么东东?: Z) j: y7 v5 q  _8 L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( z8 l9 @& Q5 Y- C. x
- \* s! h$ }$ p4 U& p9 O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! c, D" t" v! K  p6 I9 K+ S
/ w. j( d. X/ ?& O  V0 a1 n: |. v6 m6 F  c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" W$ y0 [0 x3 Q+ y- M4 R
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, i. p+ q4 d5 P( u3 ^% ^
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 {) H) b" q9 \: O& H& I$ U2 X& R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 l! {" L4 u2 L* V
begin P_induction arriving" R) D9 h& T7 v" I
    clone 1 load to P_pick(A_induct)
6 o7 L2 ^1 |+ K. x) H1 d6 I0 X* Uend最大的系
7 L9 u# B. ?( _! i8 |8 j4 n9 D: s
, ^$ t$ u$ C) g/ z$ nbegin P_pick arriving& [3 x8 Q; {! q% S
    set A_i to procindex * 10 + 1
+ z. X; D: V# Q( d    move into Q_induct(procindex)
. S" y- z* O* l, n3 G8 `0 S- P! y' H    move into pickaisle.induct(procindex)
: V8 Z: ]# Y$ k- x9 n    /*check the type of pickaisle.induct(i), for your last problem.*/; P9 M+ ]5 m: f2 J) v; ^' Z7 K& ^5 H5 W
" \% k5 b+ K2 M+ C) ~
    while A_i<=30 do begin" |( j) H( \! u  k) u1 a+ e8 S
        travel to pickaisle.con(A_i)3 `4 g1 U# L3 V+ x3 b2 @7 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# T. \) b3 b# h5 t% s4 A
        else wait for 10 sec8 \/ y% S+ A8 K1 x3 S9 v  S, U, W& q, d/ T
        if A_i=A_leave then send to die+ ]# R; L, s' ?
        else inc A_i by 15 d& p% p2 f6 z' b" S$ s, u
    end4 J" g4 p, g$ r/ T
end/ T8 [9 Q! S( G; x! ~1 O
, P( O3 l/ M" j. [7 k0 K
其中的procindex为整形,代表当前process的序号。
6 @0 Q( ?0 J, 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, 2026-3-1 00:23 , Processed in 0.016514 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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