设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12663|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: A2 {6 {- {0 \% s) q0 m

/ }$ R" T' t. D( k. |' |' x& U' u1 y我的问题是,在每个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中的数值,不知道会不会有什么不妥。  Q; g6 _$ x% f. v. v2 D
9 x# a3 v: x5 O$ [; c
begin P_read arriving/ i# f! d/ P4 P+ ^  q/ m2 P
    while 1=1 do begin
6 y3 i9 D( v3 T, p: ?; X        read A_tote from "data.txt" with delimiter "\n"
) y& s% Z3 j6 {        read A_time from "data.txt" with delimiter "\n") }, [+ s* g4 O5 {  {; t  w
        read A_leave from "data.txt" with delimiter "\n"
! @9 ^5 b8 y/ t$ Q: R& D( v9 k; i8 k        read A_picks from "data.txt" with delimiter "\n"
/ j* W1 [& Z1 P7 X. l5 L        set load type to A_tote
& V6 [; i9 W. U$ _% }        if A_tote="tote 1" then set A_induct to 1
4 S( ]1 G/ {$ Q/ c# n  m# e        else if A_tote="tote 2" then set A_induct to 2: A" q. Q0 V5 z  L& C) a
            else set A_induct to 3   
3 Q1 F8 E3 }6 Q5 g' ~$ e  Z8 M* |        set A_i to 0
/ A% y3 V  ]" y- q3 L0 u        clone 1 load to P_induction3 {* c: Q& A. C3 b" V
        wait for A_time sec. |2 U/ D% Z4 X2 f6 v/ [
    end& g- C: Q! ^2 i, ^* e5 X
end7 u6 K2 L7 t# P

. I/ c% V7 s( z) U0 k- pbegin P_induction arriving) ?! f' _" w# T2 x  [6 x8 m" x
    if A_induct=1 then clone 1 load to P_pick1
+ C5 Q* q) y, e$ D. l7 o    else if A_induct=2 then clone 1 load to P_pick2
& P* e5 c1 e# i7 w        else clone 1 load to P_pick3
" k" U) x2 X5 q+ }  A9 u: Tend
/ q6 L" o" j& q+ I7 Y' A0 J7 p# Q! i
begin P_pick1 arriving. F, C% R& _7 h, R% }
    set A_i to 15 U3 K' }! K$ e% D* |. Z3 Q
    move into Q_induct1
5 n; u: D3 _0 z7 ~( A8 h9 b: b    move into pickaisle.induct1
3 s# M3 Z$ j" ?" M5 m    while A_i<=30 do begin7 @6 ?: k: i& a# ?  y8 d: C
        travel to pickaisle.con(A_i). E( \$ s1 s1 @& O8 W/ U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* v5 l$ [7 |& z1 G% U8 v        else wait for 10 sec8 u/ f1 I; ~5 G9 s& K
        if A_i=A_leave then send to die4 v' z9 Q+ j5 a6 @5 N5 _! T# b
        else inc A_i by 1
& Y! N' n- k6 V& G3 W* ^, q    end# R% i7 e1 v+ {8 w: N/ W, E1 t. L
end& s8 Q8 S3 w+ u$ y

! v3 H; f. B. b% xbegin P_pick2 arriving
2 H6 F* _4 h0 U. k; l& r    set A_i to 11
/ u' t. {% T" Z. n+ Y    move into Q_induct2% r! W6 n# `$ y; p8 r
    move into pickaisle.induct22 B' B0 R) t: }- A+ B
    while A_i<=30 do begin
- Q; @- j8 U9 R$ I$ V# h        travel to pickaisle.con(A_i)
8 J& p6 v# ^3 ]) P1 V. t. D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 U+ _: K  U4 s: [7 ^- A' b
        else wait for 10 sec
; L% W3 S) K6 g' o        if A_i=A_leave then send to die
/ W2 M3 P: g; \- [$ v/ W% ?        else inc A_i by 1
  V, i$ U& B, B$ t8 r; Y    end* U+ o0 M8 O' K0 ]( P. s
end: X! o6 h% t3 ~! E7 b2 n; @3 s

  f/ @0 f( l2 \) `  H, ]; x( s* E' \3 xbegin P_pick3 arriving
9 B# s4 K6 d9 \& F: J/ ?    set A_i to 21
. v  q& ?2 P1 L5 T    move into Q_induct31 j- \/ V0 P0 k6 R. a* ^
    move into pickaisle.induct3
! [$ w' d+ n* Y, S% f# W5 @- @! e    while A_i<=30 do begin
4 z- l$ c) U$ ]7 C* J2 W+ m        travel to pickaisle.con(A_i)7 y% y4 _0 Q/ q' G1 S+ f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# {9 A  D0 h5 O8 i. r% h8 m
        else wait for 10 sec! r% r% e& S7 r) T8 Q
        if A_i=A_leave then send to die
: Y# i1 Q0 }- v1 ^, P3 u        else inc A_i by 1' I8 i  Y! m0 M. H! I7 _+ S* p5 M# Y
    end4 V2 `  j+ }0 q' D
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是个什么东东?: O$ Y  a7 U6 E5 @2 ^" v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& E5 @; f$ e5 S2 k
7 |  k0 _9 P4 @6 u. T$ b6 T0 g5 C( NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 i% H) v9 c$ B/ B" l" g) U
, Z3 x7 r' Q% {" ^1 O: B2 l- A/ x( p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) f; a. T+ T, ~+ T. v; E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( u6 G# s: g* P, L1 c0 Q  M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ t: y3 |6 r9 u% n  D& `+ i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ V( J: \9 ]9 f9 J$ vbegin P_induction arriving
9 k" h+ O  h7 b) a3 @    clone 1 load to P_pick(A_induct)" O# k! ?! A3 z/ a8 _# V
end最大的系
+ O6 q4 Q( ]" z9 N; x9 e# ?+ k2 K" x0 l' y. s) h
begin P_pick arriving0 o% {$ ]) f. h- B! T; c5 E  d
    set A_i to procindex * 10 + 1& [' T. R1 c* d$ n( F3 e
    move into Q_induct(procindex)( q4 P% R, K$ ?6 x9 b
    move into pickaisle.induct(procindex)0 o, @% n1 P6 O  o' `
    /*check the type of pickaisle.induct(i), for your last problem.*/* M# `$ _9 @( x, d5 ~. E
- z8 Y2 B' Y7 ^1 m( U
    while A_i<=30 do begin+ ?; P: {9 A1 j2 `2 P+ f3 f
        travel to pickaisle.con(A_i)
% Y+ E0 v4 i4 x( z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 O, S" ]; w) w* x1 _        else wait for 10 sec
+ a4 w1 y( F5 H+ k$ {' ^- Z* t        if A_i=A_leave then send to die
) T. D& G+ b3 f' k& b        else inc A_i by 1
4 E5 b& i& N0 ?. }    end
0 H3 m7 k9 v& i: nend. l2 N( W3 M  o6 }2 k6 K. _
7 v+ m5 N: `$ y! z
其中的procindex为整形,代表当前process的序号。
. J0 d/ a" ^. p' m. ]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-2-9 02:32 , Processed in 0.015088 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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