设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13670|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  q: t0 V0 T1 x, \& J% T  U
# ?4 i$ w. p2 Z4 l我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 q9 u. Q4 V2 l2 \8 q* E1 R( c
0 x& J; O+ k6 a: H5 V/ r( K1 N, Zbegin P_read arriving
* `5 `/ l' q2 z* z7 F    while 1=1 do begin' N9 ]& M% c- c' G/ ^
        read A_tote from "data.txt" with delimiter "\n"
$ X2 O; c# Q+ @3 S& C3 U( b        read A_time from "data.txt" with delimiter "\n"- h6 E* q+ W; u& F- w1 [: B
        read A_leave from "data.txt" with delimiter "\n"
+ B0 B. o4 ~, K6 |        read A_picks from "data.txt" with delimiter "\n"
% b9 g. D- H$ m7 l8 ?        set load type to A_tote$ T. \6 @$ ^( J6 n  P1 M* _  s
        if A_tote="tote 1" then set A_induct to 1! f# \& _5 K1 F0 X7 C, w# O& m" p
        else if A_tote="tote 2" then set A_induct to 26 ]# a8 X2 ~0 }* ]0 p
            else set A_induct to 3   
3 O& U! `0 R) k: h( B" a        set A_i to 0
1 L) J7 Z: z3 A# X# w        clone 1 load to P_induction
5 l1 O: ], d- |, B        wait for A_time sec+ f. j, `2 |- _# s. ?) H, w( ?
    end
, }6 p' z* L$ l1 ]" zend( K  _; X  C# l: L2 v$ O: i

- k) C& N) ^6 P3 A9 Lbegin P_induction arriving
6 ~4 F6 s) j$ x) `- w( D+ u; w# S    if A_induct=1 then clone 1 load to P_pick1$ @0 L3 F# t: g8 b
    else if A_induct=2 then clone 1 load to P_pick2
9 d7 [1 s4 P) ]+ ?) Q        else clone 1 load to P_pick3- n6 p# ~5 b( i0 ?" h2 T
end
$ f5 Q* S7 f4 {1 q" [* K3 x# n. `9 H) w
begin P_pick1 arriving% l9 ?8 T$ x7 M, n; S0 K7 ]3 n
    set A_i to 1
, K# p6 Y/ s; \0 c! d# w: V    move into Q_induct1
2 {1 E1 L0 B0 K2 j6 t    move into pickaisle.induct1
( f- h5 M  t. q    while A_i<=30 do begin
9 m3 _  W1 K1 i; w        travel to pickaisle.con(A_i). @6 u2 c0 K* s3 K/ k+ c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Z+ u% G; D' o; D7 o/ o# A
        else wait for 10 sec: S4 Z  A4 W( T4 x& `
        if A_i=A_leave then send to die- p9 c; x- n2 m  z: h
        else inc A_i by 1
0 l; p9 v. u1 o  y$ J# o& I    end
6 m: A% y' C( [& Y9 \7 C; _% `end! p) R7 [& j8 \1 N7 O+ d7 s

4 Q" D# D! Y# |begin P_pick2 arriving
# s" P9 k) T) _( c# n    set A_i to 11
) Z( r% w, o3 ?9 X, _6 X4 o    move into Q_induct26 C: a' t3 c6 O! @  o% c
    move into pickaisle.induct2
: i& u7 @) S/ a    while A_i<=30 do begin
( C* K) W1 ?# _4 W1 \3 P        travel to pickaisle.con(A_i)
5 G9 p, n" B6 }3 J* i, K1 D6 _1 R: f, F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# A. K$ J9 D6 p( i' L8 t
        else wait for 10 sec
, W  s- R3 |" E        if A_i=A_leave then send to die
% U# p- ~4 Z' ^( [& a, k0 R* e        else inc A_i by 1
% K+ r- v8 `8 b3 l. h9 o, W$ C    end
, D. O! K4 u0 M; n1 u2 Pend
+ l! u3 ~# U5 k6 ~
$ {% k$ L% E8 g" Lbegin P_pick3 arriving0 o4 z9 I4 z& V6 ^" x8 y
    set A_i to 21
/ `6 R/ o6 ~: `9 g9 @1 ]    move into Q_induct3
, E2 l2 [: J9 N: T3 c    move into pickaisle.induct3
! s( F! i  @% p8 R7 n+ Q, a) n  p    while A_i<=30 do begin
* ~5 r' r" j) x! g# x! Y  m% T        travel to pickaisle.con(A_i)+ z* u  E: z/ y; S) g: @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 `9 E; R/ ~, j$ K; v
        else wait for 10 sec- h) Y: e1 z: t( a; u/ D
        if A_i=A_leave then send to die
6 L0 }/ R5 G6 Y        else inc A_i by 1
0 L' a4 Z" X3 O2 j4 s- }. {8 L% m    end- a$ G0 x: Z* X. g. Y
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是个什么东东?
! m3 S; [( l) L3 N3 Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! }. I0 c. M8 h8 c# R

& E6 R0 [( g/ d! Z6 `: vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% n9 {! t  Q4 w, k* n
1 X# s* z  l9 S+ z; _8 y: m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* ^% _7 i5 B+ d' g  N) J* z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 P, v0 j+ H/ H, w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  T+ D9 F( T+ }, R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, ^6 x' O0 K0 V, c( X
begin P_induction arriving
' I5 ^8 i8 ^4 c% s" Z1 o    clone 1 load to P_pick(A_induct)
" p( c* ^/ e0 S& e, l/ ?  Nend最大的系4 c) O! C9 V0 V/ x9 _; w7 W7 b
" e( d4 Z2 o" A+ U& i
begin P_pick arriving
; C  W) F5 f, b$ @" W    set A_i to procindex * 10 + 11 W  e% d5 B' w/ S* i6 \& S/ h; Z
    move into Q_induct(procindex)2 f7 E* O! r6 y$ H/ \  o
    move into pickaisle.induct(procindex)7 W; X5 p. M, L
    /*check the type of pickaisle.induct(i), for your last problem.*/5 ^. o7 ?" p+ o

  z/ J# t4 U( r6 H1 [6 n    while A_i<=30 do begin5 X4 \  L/ t! M, T1 P+ l
        travel to pickaisle.con(A_i)6 Y, t5 _$ s8 K6 p- n% O" c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  S0 c6 \' D( x5 J9 ^+ A. {
        else wait for 10 sec: o0 `; B5 @6 I% x. ?. ?
        if A_i=A_leave then send to die
! x  i! ^  f  ^* u. |+ l. M# W        else inc A_i by 11 [' `; S& [- q
    end
' r) {6 _2 B9 t5 P4 G9 oend) s, R; p) S9 O' `3 G

8 a3 X" u( {3 g! q其中的procindex为整形,代表当前process的序号。. `* B4 o, K3 R. F9 Q
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-4-27 23:28 , Processed in 0.016966 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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