设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15598|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( E$ u% F+ v' B5 [  J' {
1 A8 v; Z; L" d7 R3 Z0 L# s8 t1 ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 _4 j  L9 a6 ^. M. ?; U2 R7 S4 A; ~8 J' h' f. ~$ k
begin P_read arriving! R6 M+ J* i' n+ I7 D( g9 R5 Z
    while 1=1 do begin2 {7 W* h7 x& g6 a- [4 B1 J
        read A_tote from "data.txt" with delimiter "\n"
% E/ Y4 L" x& l0 O2 w        read A_time from "data.txt" with delimiter "\n"
& F$ P0 i* [; M7 ?1 J5 O0 C4 a        read A_leave from "data.txt" with delimiter "\n"
" I- z% x7 T; \" `0 A- G% M; N' m% d        read A_picks from "data.txt" with delimiter "\n"
2 ]5 B/ U3 R0 A# ^1 k        set load type to A_tote
! T5 \) J: A% N9 X' F; `; S        if A_tote="tote 1" then set A_induct to 1
; g" b5 W: o% c& f+ P. f        else if A_tote="tote 2" then set A_induct to 2* c7 A& ]8 |2 w  V3 b8 J2 _
            else set A_induct to 3   
$ l# M) d& R. c% g1 ]/ r        set A_i to 0
' c! D1 l: ]+ {$ Z2 g  H' Z        clone 1 load to P_induction
! K1 K$ _% X8 ?2 `) {. y( I        wait for A_time sec
7 W( q4 e; n/ X. z    end& U, }5 v! v2 S9 @% g  V! M
end
  k: V, \% x1 ^/ e8 y/ H4 B/ Z3 w
begin P_induction arriving
/ ]" \7 \& q+ x    if A_induct=1 then clone 1 load to P_pick1
: K' F% F2 C+ m; N    else if A_induct=2 then clone 1 load to P_pick2- u& ]/ `; N9 \8 M5 y1 E) l* I- Y5 f
        else clone 1 load to P_pick3
- s& y/ ]& E' o" d8 iend
4 b8 q9 g8 F3 O* p+ s1 `4 U; p' D4 ]6 M- \5 g
begin P_pick1 arriving
1 c; ]7 O/ ~% r$ i  j    set A_i to 1) a+ V0 y, k6 U. j; @- L
    move into Q_induct1) h& G1 r: V9 k/ x; w. ^
    move into pickaisle.induct1' {# {- w% a; g4 B' x6 v& K2 s
    while A_i<=30 do begin( G- X7 R& F1 F' W  L) Q
        travel to pickaisle.con(A_i)+ H- r- [: _# c6 I$ _/ r3 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 {+ z* Z& h* T) [* a( r( g+ x8 S        else wait for 10 sec4 S, U4 E# V0 B" x, u  f. S( R- P
        if A_i=A_leave then send to die: C; @1 }2 c# t0 U
        else inc A_i by 1
% C- Q) r* ]; f) x    end7 L$ k) t% o+ C: r0 ^- m
end1 h" y8 d' h% h8 G: @
- d# p" s4 x" I$ b& k: U) o( C
begin P_pick2 arriving
, x2 N* ^, _3 a* t, \# H# ~    set A_i to 116 N/ s/ c2 S9 K+ x
    move into Q_induct2& W1 E: U1 Q9 X; F. y" W
    move into pickaisle.induct2
% w2 G# l: `% U* h. E    while A_i<=30 do begin* U. b7 ]5 `( s
        travel to pickaisle.con(A_i)! U& d3 V5 J' r. ]& @5 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) q4 m! C( v4 U6 t1 J
        else wait for 10 sec
# W8 s6 j! B5 U% I) P5 x        if A_i=A_leave then send to die
3 S  k# Z* w- ^( j% e1 j: s        else inc A_i by 1! W3 O5 c% Y. z6 E% u2 m
    end$ M% d3 m& u6 \4 X
end/ Q2 @  J3 o' E3 F# J" w+ s$ |

% ~' _4 e9 R' R# w1 c5 K9 ybegin P_pick3 arriving3 Q& E7 B0 ^7 i$ Q+ k- T3 S7 L* N
    set A_i to 21
  i: Z* {4 p1 T9 j* i    move into Q_induct3- _0 H& @; P6 E6 W! D/ d& C
    move into pickaisle.induct3! M  E% t) }: p4 ^8 `+ x# y& q
    while A_i<=30 do begin
5 O, Y. K0 T! d        travel to pickaisle.con(A_i)
5 [0 U! w) N7 S" Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) b7 k8 K3 w. X, o2 S0 y. i
        else wait for 10 sec
( ^3 I2 f) z- s  E4 ^+ w& _! G1 r        if A_i=A_leave then send to die1 h* M3 W1 L. W! d- b: l0 d% Y
        else inc A_i by 1
* v8 i/ X9 H' U5 R6 Y    end2 ^0 {: I3 W& u1 `8 i
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是个什么东东?
. x; g8 N& l, W# R% e* vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 D3 R5 D! w( @& r. U. K+ A/ w0 B
& ~8 I9 f! A% M; n' B! F( m0 LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 Q9 |3 ^/ E: r4 w7 k% o
. G3 x3 v7 ^, K; m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 d. R8 n' q$ G3 I/ C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% G# \' [6 ?( w! g. n1 n3 J+ D# x1 P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, Z. H9 Z; Z- g% I7 v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% I' L/ E8 b3 s
begin P_induction arriving
4 j5 |$ v; K2 N) |    clone 1 load to P_pick(A_induct)
9 q! I' D5 w1 P  a$ r3 c5 Pend最大的系' _  e1 q+ S/ ^- _0 c
) ?, }. R6 ~) p, y# s& ]1 F  t9 j% ^
begin P_pick arriving) v1 H2 L% ~$ f# Z3 j! M
    set A_i to procindex * 10 + 18 z, Z* M; P) U/ T/ L
    move into Q_induct(procindex)
2 \0 X, r- K# z" k6 j    move into pickaisle.induct(procindex)8 X. ~# w4 L& X. C% i" A3 ^
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 n1 E$ D, y& x: y- F1 w6 Y- c# E3 y1 [0 s7 P+ p5 m
    while A_i<=30 do begin% u% K9 T+ N/ s
        travel to pickaisle.con(A_i); ~# a( a' ^) R1 `( `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 A7 J3 K1 k" y' s        else wait for 10 sec0 x8 b/ C5 W( H# W7 w
        if A_i=A_leave then send to die
; {" P" ~5 e8 w. L1 q2 Q& r        else inc A_i by 1
$ J/ B: j9 B+ \- `# A+ n    end
& @4 c. `# i5 i9 v9 I* y1 Z0 i. Aend- m5 `$ c- p0 R. N

5 Q: b, B0 g5 v. A$ w1 K) ~8 h其中的procindex为整形,代表当前process的序号。
' l' v4 A2 n: |& X. t& j  gstation和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-22 02:52 , Processed in 0.023199 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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