设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13828|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; ~% p. |" L6 A8 ^3 {! m
4 ?5 P4 f8 N3 p  i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" |% z5 A. f2 K2 Y4 |7 s# m0 Y) E, |5 D/ {2 S+ N) i
begin P_read arriving
0 g$ T6 E" z0 D5 `# e8 V  l    while 1=1 do begin
2 N1 n& I6 q0 Z$ z! o. y        read A_tote from "data.txt" with delimiter "\n"4 H# C+ T! `. p0 h) o- r* B& ]
        read A_time from "data.txt" with delimiter "\n"! L4 W8 N0 \" D) ^4 y
        read A_leave from "data.txt" with delimiter "\n"
& N6 G0 v3 V/ _9 }' q        read A_picks from "data.txt" with delimiter "\n"4 s1 x! T# g# `4 ^/ Z/ s
        set load type to A_tote
0 s8 k! Q. x; k3 Y        if A_tote="tote 1" then set A_induct to 1
8 b8 ?& S) o$ I" j* i5 R9 B        else if A_tote="tote 2" then set A_induct to 2
* c, k8 K  D. O7 v            else set A_induct to 3   
, q7 e) B. k4 y7 l, D1 `" X5 X% E2 z0 y        set A_i to 0
- S1 X+ o) D; |; F0 w  R        clone 1 load to P_induction3 C% g% w) b( n, O/ i: N
        wait for A_time sec
8 g+ Y# p. |  T& e    end
# P9 b  A. ]4 N0 ?end
% k/ {% t5 F& Z0 m/ B( }1 U, ]6 t1 J1 J9 g) N0 |6 J3 K
begin P_induction arriving
) T, Y3 t4 v4 o$ w* A: ~    if A_induct=1 then clone 1 load to P_pick1
9 O& M  R7 d0 A" k  X1 J% i    else if A_induct=2 then clone 1 load to P_pick2
' D. _  B# Y3 t" Q# m* V        else clone 1 load to P_pick3- z* ~7 g: g+ X
end' t) k* d# t: Z8 j3 n, K" Y
$ D$ A- k) n& s! s
begin P_pick1 arriving8 V4 x1 k/ V8 y$ w
    set A_i to 1
% z3 c( Q( R4 T" @    move into Q_induct1
3 m# I: t/ M' i# e/ q+ X5 O" |; X    move into pickaisle.induct1
% N5 ?) K. D9 V6 N  Q% V& x    while A_i<=30 do begin
: n# k# r/ @. I9 f& Y        travel to pickaisle.con(A_i)( O" t+ Z6 e! @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 u: t6 g& Z' J9 Z( ?, A! e        else wait for 10 sec( R8 W2 O' V# r  @
        if A_i=A_leave then send to die+ B! }7 X1 `0 G  Q' j9 n/ V
        else inc A_i by 18 q( g6 @& y0 T9 B$ X: H2 i# A
    end
* ]8 x0 b/ M/ a$ y) Mend
! b- d1 b# {' A, H! ?8 e! \% D7 G" b, I/ v& P; N& m/ m
begin P_pick2 arriving
, ^1 \- Y* U- }0 y+ ^4 y' H    set A_i to 11& w7 S# m  ~7 L9 E' p
    move into Q_induct2
+ v0 D! Q. i5 g. W$ ]& D  M& d    move into pickaisle.induct27 v; ?. W6 r: t# S
    while A_i<=30 do begin
( D$ [3 p3 s6 o        travel to pickaisle.con(A_i)6 f4 O% J1 j9 Y5 b& e8 Z6 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [1 P! O  `9 ~( c0 g
        else wait for 10 sec7 f3 e2 P. |! o7 }1 g0 y
        if A_i=A_leave then send to die
1 G$ C( l2 I+ J1 X" V8 j        else inc A_i by 1. |: m) C# P, h! H
    end
9 X! m: K# ?0 Y7 u/ W/ O$ g( hend# k5 c6 m  f" U2 m2 p4 i' q
. m0 p. a5 W# A( c' k. \- O  d8 \0 q* t
begin P_pick3 arriving
4 Y  S* D  |7 J8 h( a, H    set A_i to 216 x) O' [4 c0 O) y- h/ M! R
    move into Q_induct3
0 u: H% ]* B5 l: {3 Y    move into pickaisle.induct3
4 @$ Y- }4 O$ ^, ?3 S    while A_i<=30 do begin
3 _) S( O: l  u% h3 A1 P4 N5 _        travel to pickaisle.con(A_i)
  ]' L3 ^+ |1 p; o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! H1 O4 u( n" K! M        else wait for 10 sec4 M5 j5 I+ K5 p4 X3 z2 M* W
        if A_i=A_leave then send to die; i& e2 M! X3 m6 f8 D) |6 d
        else inc A_i by 1
% ^2 @9 D! ]4 ]0 [; j/ R    end
/ M0 a1 p2 ^& |: U0 Jend

最佳答案

查看完整内容

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是个什么东东?5 b7 r% G( f$ Y* i. `6 o- W
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! \  h7 V1 K1 q0 F4 w* f) ]
% B7 J0 |: c% a% c# x. g& x/ E0 O* NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) l1 t0 B5 _1 r+ L5 H/ ?

$ |) x6 B+ z( p! N# e2 ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) r+ J- z4 ?- C' _2 y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 t8 S" A1 ^" |  y4 Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. ?- b1 \8 u' ^3 J# b# I3 A9 w1 U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ T% U8 Q, N+ v9 I, s0 R: |  q# Q0 Qbegin P_induction arriving
! x* l' j2 ~# }2 G  Q    clone 1 load to P_pick(A_induct)+ x* _6 d  Q" g& e4 N, `) E1 D
end最大的系6 f% g( n  j% M. L- U/ N* s6 M

( ~( G  y4 W% E* gbegin P_pick arriving6 \: P+ C' O" a1 }0 a
    set A_i to procindex * 10 + 16 Q; L" S, Y- y5 D5 X  ]
    move into Q_induct(procindex)( ^+ L9 u# ^% k4 Z& p
    move into pickaisle.induct(procindex)
- @; B' Y' N" D    /*check the type of pickaisle.induct(i), for your last problem.*/: H9 T8 |$ l$ c4 K/ }/ Z/ t+ A4 ^

0 C( k8 _- L3 O- U6 ]    while A_i<=30 do begin
; ]( [2 ~4 ?/ T( T$ G# W        travel to pickaisle.con(A_i)
7 s# _! h) {, ^, b- C4 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Z' V$ M0 i9 ]  X3 F
        else wait for 10 sec+ ^# V, T+ s- ^% m  f- p9 J6 ]
        if A_i=A_leave then send to die. z+ |8 ]& T( W7 g
        else inc A_i by 1& B9 p; j% g$ ?, W1 g6 K
    end9 q: X4 F- d' r3 H
end# j+ `" V! f3 W9 l* r# ?/ G
- x0 l2 P' n2 ]/ U2 @
其中的procindex为整形,代表当前process的序号。- G  F3 M! l0 D# |# Y: V2 h
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 16:25 , Processed in 0.022246 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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