设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12716|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 c+ v' {8 x( i, O' M( u9 s7 a
1 z) ]; a' Z/ P/ r4 ?# ~$ f
我的问题是,在每个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 V" w# O: ]0 _/ J9 f$ i
( b8 z3 e) u5 `  r" {3 X: G0 c
begin P_read arriving
( F( ^: d4 q% C# u7 x4 ?    while 1=1 do begin9 d/ k, d$ d) G  J2 L# R
        read A_tote from "data.txt" with delimiter "\n"
/ T3 L9 h4 G, O# I& q6 ^        read A_time from "data.txt" with delimiter "\n"
+ L7 Y6 [  K, _* ]        read A_leave from "data.txt" with delimiter "\n"( i, J& S5 K8 z. o/ `& b* n" r
        read A_picks from "data.txt" with delimiter "\n"
& ^! D* |/ j- G        set load type to A_tote
* o3 b5 Z4 R) Q) n% R        if A_tote="tote 1" then set A_induct to 1
3 i; R, B& e. F; B" t: Y        else if A_tote="tote 2" then set A_induct to 2
  l2 j4 X1 W3 `4 {9 h. x9 J  Q3 {            else set A_induct to 3    / Q; z6 w, ~0 l0 i: G* X0 A* X
        set A_i to 0* g7 G" ~& ?' d3 g
        clone 1 load to P_induction
( O8 s# I/ Q! K4 N! y: f        wait for A_time sec
0 j! f) @! N6 a% b$ G- `    end+ o9 k$ d) ]6 z) M/ O2 ^& Y" h
end
# f* p% h1 X# ]: G4 ]
% L0 @% j* o2 g" x5 `begin P_induction arriving' G- _: U2 }4 Q7 y
    if A_induct=1 then clone 1 load to P_pick1
/ K# W( U5 \' Z$ A3 _    else if A_induct=2 then clone 1 load to P_pick2
; v" W! \; ^  K: ]        else clone 1 load to P_pick3
) x/ T, f/ A# r4 o" s' f4 r9 Dend4 P. ]/ f" s; S& c$ {) B

7 [% H2 n! H7 U: Vbegin P_pick1 arriving3 r  t  `& m/ U- @8 I* M
    set A_i to 1( B: N/ x% V. K) `, L! }; E
    move into Q_induct1
8 C* |2 A3 X& T5 C% ?* c: ~    move into pickaisle.induct1
4 M1 ?. e, M& ~. ~% J. l& K! b  f8 |    while A_i<=30 do begin
+ K6 `! c, W' W  B+ M' ]$ g& p' }, J        travel to pickaisle.con(A_i)9 P/ T' ]8 f7 B3 ]& \" G* h% x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 r0 r1 w5 h, V
        else wait for 10 sec
8 H9 e% H  H7 n8 U1 f3 g( |        if A_i=A_leave then send to die
" x9 d& y$ B; J' u1 u( Z        else inc A_i by 1- ~3 H% X9 |/ A+ i
    end
$ D, ^3 K9 X% a+ Y! H* Z; N0 L1 pend% P7 y( E- D) ?$ h  W
  a. ]; A9 p$ Y" a+ _0 Q
begin P_pick2 arriving
( H# D; ^( v; i5 M* i0 W9 e    set A_i to 11
) L, N! r4 V' `, _    move into Q_induct2' O+ O4 b# \! A* K. L
    move into pickaisle.induct2/ b9 X! b! R8 u) d
    while A_i<=30 do begin
& T& o1 e; e, r3 g: I        travel to pickaisle.con(A_i)0 J" {6 C5 ^4 d8 r; Z& u& }3 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ k8 n+ G7 m& ^8 `) y( Z        else wait for 10 sec# V$ d; \- H  \
        if A_i=A_leave then send to die, {# F/ w6 [6 X. o3 w
        else inc A_i by 1
! f* k, R* ~, H/ {6 @    end
8 Y( \  t# A. K) k- L7 ^* iend
3 p: B) r! K/ y6 Z9 ^& V, u
1 L, r' Y3 A" z, u" `) c) Qbegin P_pick3 arriving
  T) I. t& m" `6 k    set A_i to 21! [" W4 Q: H' P/ H$ n0 d9 s/ c
    move into Q_induct3
" M& \2 p+ T" i) r+ c, U    move into pickaisle.induct3+ O4 h, m9 M8 D; \
    while A_i<=30 do begin
- m6 ]. n* b3 L        travel to pickaisle.con(A_i)
( b4 q$ g, f& A( }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) b  B( W& B' w8 i' Q# c  t        else wait for 10 sec
# g1 v4 t5 h" k: Y: B2 o( Z        if A_i=A_leave then send to die  J1 I  E5 R0 [, q
        else inc A_i by 14 }1 ~. k, T; Y/ `0 u$ T, d% t- ^, n- S
    end
; J7 N# K, r! _; f  I2 Vend

最佳答案

查看完整内容

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 h. _2 D% l6 N+ F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ @; l; J! g- S1 C" b3 g. |3 E1 Q6 C9 w4 |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 p; q4 c* k( j" |0 U7 Q3 H1 z$ f; Y6 h' G: @' j2 T+ R1 l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; g: [  z) Q' x8 [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ c4 k  b- Q7 y' `$ K2 v8 L& s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 e5 |1 j9 v6 ^
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 c1 y' {8 F# V5 R5 Jbegin P_induction arriving
+ e: Y9 B8 c- s9 Y0 C, C2 C    clone 1 load to P_pick(A_induct)2 g  f1 q& H* Y) W1 ^
end最大的系, V" |/ v8 c/ i; p1 Y4 m6 z+ O
% T8 D' A+ Y0 d& {" H  d+ S4 P
begin P_pick arriving
5 N% @2 l/ H: N' |' w    set A_i to procindex * 10 + 19 m2 \; c+ q" q1 U" b
    move into Q_induct(procindex)2 w, p7 x" \: r# I3 x$ K
    move into pickaisle.induct(procindex)
$ M2 o/ i8 \9 n& h. \9 Q  k    /*check the type of pickaisle.induct(i), for your last problem.*/
! o# N, Q6 P% D( k; ?9 y3 F. z0 A* I' t1 Q) q4 w- H5 c% o
    while A_i<=30 do begin1 b' M2 d3 j4 M3 t" F' p
        travel to pickaisle.con(A_i)
3 f9 |5 Q8 p' l7 Z. M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 l& ^9 ]9 j& c" H/ @        else wait for 10 sec
3 d9 H3 F  b9 T  I* E        if A_i=A_leave then send to die0 |) b* s: k; d$ J
        else inc A_i by 1( I. Q$ ?) ]2 E9 g6 n1 A( c1 o
    end
8 v" b9 R/ a- N& \end
4 d' O" I# h7 T" ^% _
4 G, e- y5 ]) ]5 `其中的procindex为整形,代表当前process的序号。, ~) P7 u. }' r8 i, W; @6 h, X" t
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-13 19:10 , Processed in 0.019446 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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