设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15333|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 c$ E1 i3 W5 ~1 l  \. K/ m
# ^  c& I+ B- i. @; 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中的数值,不知道会不会有什么不妥。
$ Y3 Z' v9 u) I+ ?8 _& S
9 y' }4 t5 Z0 b" T) gbegin P_read arriving
( h$ G# L% n. H5 N) B4 w& H    while 1=1 do begin
* {. t5 v- A& {8 y- S' S: u        read A_tote from "data.txt" with delimiter "\n"
% d: v/ A0 A% p, _        read A_time from "data.txt" with delimiter "\n"
8 Z- J  S, M9 j7 R: D; s        read A_leave from "data.txt" with delimiter "\n"
4 c0 Z, L2 M# @1 g: A. u1 l! [( B        read A_picks from "data.txt" with delimiter "\n"
* T0 k, g" U6 p1 d        set load type to A_tote
! w2 Z1 s9 U; I& ?8 u- L. T+ M        if A_tote="tote 1" then set A_induct to 11 ]/ G! j3 P) }" }! V
        else if A_tote="tote 2" then set A_induct to 2! G; R0 t& O- z1 y$ S
            else set A_induct to 3   
6 ]7 z) @4 H1 V6 f' n& B! j        set A_i to 0' X5 m) ~7 Y0 b$ I
        clone 1 load to P_induction% `9 B4 S) D& r3 s) y  o
        wait for A_time sec
0 N  E  Y9 v+ P5 y( b    end5 d0 J+ Q( J2 g% D
end
- T) I  v& A4 o2 a
' A( |: N, ~7 S+ ]8 a5 rbegin P_induction arriving
- K5 y7 B! l/ W4 r& Q    if A_induct=1 then clone 1 load to P_pick1
. O( G! E8 d7 B( P2 K    else if A_induct=2 then clone 1 load to P_pick27 V4 P/ k/ d, y: X% ?( L6 n
        else clone 1 load to P_pick3
( N! G0 I( S( u- }end: k& `. G+ N+ t7 X' v; V8 I
" A; J7 H5 E  f7 r: V5 V' D: @
begin P_pick1 arriving3 }$ a( y: q0 T
    set A_i to 1& E0 M4 ^; g( Z4 V0 i1 }
    move into Q_induct12 ^* ?4 l4 h$ n$ ^5 ^' J% h& N  V
    move into pickaisle.induct1) V! ~4 `/ b$ q, _+ C. z. j
    while A_i<=30 do begin
( r% I' {- T( V( ^        travel to pickaisle.con(A_i)* s# M* K8 z" }; Z6 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 M& J: L7 U3 M        else wait for 10 sec
# ^! G/ B3 S: `2 s( k        if A_i=A_leave then send to die
8 v# `1 T, i0 T        else inc A_i by 1
4 F: E. v* z) n3 w    end0 T9 r" g) ^( r- c3 C
end6 Y0 ?  Q6 _8 @3 a' C& p
6 {/ |- L, l5 e! s/ y% U
begin P_pick2 arriving
+ S: a3 H& ]0 [7 A, R; Z/ Q    set A_i to 11
9 W! q+ y  f% J) @    move into Q_induct2' {# u) O4 d7 q, l# x# G9 j3 v
    move into pickaisle.induct2
+ D6 {8 c4 o& l: L1 V; _    while A_i<=30 do begin
9 ^0 @' ?1 F: f        travel to pickaisle.con(A_i)
) K3 H- A  A% N: d# Y' p7 Q! t  h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% |* _0 I2 k+ j" T        else wait for 10 sec
( t- T! ~' c8 u" P        if A_i=A_leave then send to die
; ^5 k, i- G2 C% C2 d2 H3 I% k$ V        else inc A_i by 1* Z( a' p) t0 B5 d
    end6 G- X- o: c6 s
end
6 c$ W0 v6 d1 i$ }) z4 F$ y) G+ E* R# k9 J' z
begin P_pick3 arriving- |4 [5 n- f! ~7 Q& H
    set A_i to 21, H3 m( R9 h7 y
    move into Q_induct3
  m1 T0 Y# f7 W. G9 @; r4 N    move into pickaisle.induct3+ G5 R+ P4 u9 x3 O1 s, z% a) x
    while A_i<=30 do begin
" T6 M* \$ B" o8 J9 h        travel to pickaisle.con(A_i)1 x# y- w' ~5 X) X; W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* U4 `5 I7 M; f7 U/ z        else wait for 10 sec
6 ^  O' D  x5 A        if A_i=A_leave then send to die- w4 s# \7 h( V5 H: w3 H
        else inc A_i by 1
: B, Q* e% i' L& Z& E5 `    end* j( l' p, P: s/ @/ @$ L
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是个什么东东?
/ Z; D" v, B, w9 K6 l  d, kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: d$ v2 U5 z) Y$ J. a$ Y7 G2 p, j3 x2 h" W" e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 z3 ^2 v  y' G5 T0 Z7 R" |  S
' f7 \" r  A+ K$ g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* s" ^! c( \# B2 G3 u- A6 H1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- B0 V. `: l5 f% g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, [/ P: q. K* `, j1 w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" B* D! P! }- W* `3 b- p0 j. h
begin P_induction arriving) J/ j" m3 V" u3 t+ O
    clone 1 load to P_pick(A_induct)7 v( e0 a' G- Y6 c% Y! z2 `
end最大的系% M, m& f+ `% |

1 i; `0 i4 u1 B* ~begin P_pick arriving& {/ B0 s6 M  Z! r- g6 k% _( ^$ g
    set A_i to procindex * 10 + 1
$ V- p  D; r$ X; D) n; C3 s    move into Q_induct(procindex)
: R% r: S- s4 }6 a/ l" {: a6 L    move into pickaisle.induct(procindex)
6 c  P" Q% }1 X% @4 n    /*check the type of pickaisle.induct(i), for your last problem.*/" o; @7 D( {- J. P. P% C( P5 ^% _

. T, B* r" U+ k2 r    while A_i<=30 do begin
' D' j$ |( d) I, h        travel to pickaisle.con(A_i)# \5 G  W6 d' k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 [$ ~4 _5 P3 K6 d: M' j
        else wait for 10 sec
& e: W) M* y+ J        if A_i=A_leave then send to die
, l, [! C7 ~0 j; d* Y1 r        else inc A_i by 1( C/ Q" P. \5 \* V! Q& G0 ^! q8 x. K
    end
, K/ }( z5 `  W% ^/ F3 U5 E8 p, Bend4 p/ ~* i7 L8 y' T% x# n- Q
0 B4 J( L9 g  W; W0 F/ ~- V6 X2 s% ?
其中的procindex为整形,代表当前process的序号。
: W( p( I: p3 ~, Z2 rstation和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-9-3 10:36 , Processed in 0.015664 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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