设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15047|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" c4 J/ @6 B, N0 {( f3 H
# Q; o  M- K8 X/ R3 g: X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 V, D2 Y: u9 p' k, k
0 D) v+ u0 V  Qbegin P_read arriving5 c; o# o- R  p& E, ?+ z
    while 1=1 do begin* ^6 ?- E9 w( c, I3 B7 V
        read A_tote from "data.txt" with delimiter "\n"
: L8 i2 [8 Y: ~        read A_time from "data.txt" with delimiter "\n"
: x; z! E" K3 H  u" H0 B, v8 u        read A_leave from "data.txt" with delimiter "\n"
9 y/ l: a% i( {0 ]        read A_picks from "data.txt" with delimiter "\n"" H) I- h7 x7 t( y$ ]# k) C
        set load type to A_tote& v+ Q' _: U( Y5 h' j; `
        if A_tote="tote 1" then set A_induct to 1
$ B) A0 I; ~' t, t+ ?        else if A_tote="tote 2" then set A_induct to 28 o6 F1 d# ~: M1 ]; m8 \
            else set A_induct to 3    5 w7 G6 c8 L3 c" k$ k* B: ?  j- O" n
        set A_i to 0
, T/ [7 d, d7 z  r2 h1 I        clone 1 load to P_induction; @& s  \6 K' c, a1 p
        wait for A_time sec
. Y4 Y, R6 I+ ?9 x, \0 {6 v  S2 V  T    end- F2 L1 i* I" ]& H4 G2 J
end1 t7 d) X# `/ F

4 F6 [) }* |) g# L6 M# sbegin P_induction arriving% r1 M3 O: Y. T, x% `# x
    if A_induct=1 then clone 1 load to P_pick1
  e3 Z' x! Q& ~$ n6 x    else if A_induct=2 then clone 1 load to P_pick2
! M7 `6 @% m. c& O6 I0 c2 z% F        else clone 1 load to P_pick3  |& _+ `1 U: u  ~: H7 S7 C2 l' {% E
end' c3 ]: c1 [7 h. I' B
: O6 H& ]- x$ ~! f2 Q1 M* j
begin P_pick1 arriving
- i5 {+ }2 A3 `, w    set A_i to 1
- Z$ F7 `) a! L& R' Y# t6 I- Z9 |/ J( r    move into Q_induct11 @: i* X% T0 K
    move into pickaisle.induct1
7 E" ^; \6 d& w2 }4 a    while A_i<=30 do begin& K  `2 ]; Z8 p4 V/ J( P( b
        travel to pickaisle.con(A_i)
% k; J, a5 m$ _) Z1 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ R; N6 |& O8 m7 l7 R' _        else wait for 10 sec6 x* K0 c- P* e7 ]4 C# [
        if A_i=A_leave then send to die" S$ o* `! _; V9 n9 s! u- c- E
        else inc A_i by 1% I2 r: l( N3 N/ Y
    end3 z7 h+ A' k( u: Q9 i  P; s2 l# m
end
5 `, d" `7 |" C0 A5 E- t% `/ t1 O; U* K& {8 q9 P; ]
begin P_pick2 arriving& L( {; p& Z! E: |& E. {: D3 R
    set A_i to 11
7 E  F  d2 h5 f$ I& H    move into Q_induct2+ a# H" X& P% A( d
    move into pickaisle.induct2
7 c1 k; n' \8 |  [, k% T    while A_i<=30 do begin" @1 c( E% l& A8 }" m8 f
        travel to pickaisle.con(A_i)
  r2 p9 e8 I3 Q& [2 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( h# K4 L# I; P+ M* Z6 G1 Q
        else wait for 10 sec4 E) v6 O% J; k, e* w
        if A_i=A_leave then send to die
/ S* i) m, F1 N, W! R2 ^$ I2 z, ~) K        else inc A_i by 15 W3 ~& a3 D3 A$ E$ u, d
    end) X/ O$ k0 E" `' R- {* U- {
end
3 G; p6 S& B( s8 c( u
* z) o) `/ A9 H' v1 qbegin P_pick3 arriving: w, T9 d1 k! u  h
    set A_i to 21! U" {. ?8 q( n6 F1 g
    move into Q_induct34 f, Y* A- L; e7 z1 m7 T; h
    move into pickaisle.induct3
1 W- O$ e' \7 [! o4 l( ~4 H8 b7 z5 a    while A_i<=30 do begin
3 q/ x! |) z0 X$ e, [        travel to pickaisle.con(A_i)
1 C# e5 `, U& y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 W! E# D% d% ?% y# o
        else wait for 10 sec& {6 N( Z' a' P1 n6 j
        if A_i=A_leave then send to die" k1 W8 |2 S2 o/ ~
        else inc A_i by 10 c' t6 V0 m4 G
    end3 a) W$ k( Q+ f& A8 G
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是个什么东东?
6 \! V4 L6 ~; P+ hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 ]: s0 T: Z2 G! F- v0 G
6 l' N  s/ G, P! u7 {7 @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) M. C9 Y7 P# D/ X8 d- u0 n! c& K1 e
- }; `9 n" {4 q5 j1 J: ]; G: y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 R( b4 |# X1 {9 }' O7 L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ p1 }- P$ ?- S1 w3 {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" F' s  J. \( c& r* I9 J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ B  a3 R6 |8 h+ Y! f, v0 }5 ^begin P_induction arriving
: w+ l2 e0 _( Q7 z    clone 1 load to P_pick(A_induct)2 |+ s8 k# _0 T" g
end最大的系
  g4 Z2 a% Q) q. t- k8 O6 f9 O" [4 c  h% K  ]2 |% _  Y# d
begin P_pick arriving
8 A! r% _: S8 Q2 Q! l4 G: [/ U    set A_i to procindex * 10 + 17 |/ u" ^/ c- f( V2 F
    move into Q_induct(procindex)
  N3 F% x$ ^# e: u5 u( a    move into pickaisle.induct(procindex)
. |% e8 H& q( b* |' ]    /*check the type of pickaisle.induct(i), for your last problem.*/
0 U0 n2 e) ^( r6 N
7 T" ~* ^5 ?% L2 k6 j- c/ \; h( X    while A_i<=30 do begin
8 v$ U" E( h' D" _1 c: x# S        travel to pickaisle.con(A_i)
" m6 B/ }$ Z8 Z/ X+ Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# N6 A/ H+ Y0 ]# t& a$ N2 c
        else wait for 10 sec
9 J8 a+ h$ R1 ]% r1 w3 ^2 Q* y        if A_i=A_leave then send to die
) @- }5 Y$ o) ~7 ~" ?/ }+ d( x        else inc A_i by 1) U2 `/ p) y8 F. F4 Y5 H/ a$ Q
    end' N* m; K6 k- c
end( I- P( q+ c9 c( i! a3 q) q

2 g0 t# @3 Q, e1 |5 Z# c( j其中的procindex为整形,代表当前process的序号。, n, K/ I" ?; Z
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-8-6 13:27 , Processed in 0.018031 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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