设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13540|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 s* [% x0 f+ }) j1 U" K
; k( {' w% i5 ^1 O, T& u$ o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 v% P6 M! o8 J+ Q) K( T  d  r, m2 Z0 I7 p* ]
begin P_read arriving  N3 q) j' d0 n
    while 1=1 do begin
4 }4 P  G7 S% Y: \+ [        read A_tote from "data.txt" with delimiter "\n"
$ z5 ?* l8 `( J        read A_time from "data.txt" with delimiter "\n"
5 f) @: H; f( F" z, I" n        read A_leave from "data.txt" with delimiter "\n"
; v  I5 K5 k- c; y, Y( I9 H        read A_picks from "data.txt" with delimiter "\n"! M# C0 ?& P- o; _& T, g& h1 y7 U* X
        set load type to A_tote+ h) s: `" s! u* u
        if A_tote="tote 1" then set A_induct to 1
  K) I( h" @/ n- {4 `        else if A_tote="tote 2" then set A_induct to 2% \0 g! i( b7 A; h% M$ m
            else set A_induct to 3    ( K( `9 h7 e! B3 i: z3 L
        set A_i to 0
' d) P3 Q5 V% X        clone 1 load to P_induction
+ U. }7 @* ~. V' k8 M% }        wait for A_time sec
5 r! G* ~5 j% g. \, o    end& H4 h! b& B" ^# I
end9 m- b  p; P- {5 ]& E

' |  Y/ g! ~2 c1 d, ^; zbegin P_induction arriving
6 |& U- t- |1 L    if A_induct=1 then clone 1 load to P_pick1
% @& L+ C+ k0 R7 P) K. j3 Y    else if A_induct=2 then clone 1 load to P_pick24 J, D3 d" ?7 ]5 [' {# W# `
        else clone 1 load to P_pick3
) ~6 o) D8 j# S: \7 Eend: T" N2 D- _5 s7 x

) Q4 s" d: ~9 g0 u3 V( Dbegin P_pick1 arriving8 }8 j1 Z. p; @3 H
    set A_i to 14 }. |1 W3 h" r+ l: C7 n
    move into Q_induct1
) _1 W' u: `3 B+ z, X$ i6 e. O    move into pickaisle.induct16 I& H! s9 O! d
    while A_i<=30 do begin
% }: \$ R8 d4 C% J        travel to pickaisle.con(A_i)
; F: D# {- ]$ u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 o: |6 \1 u+ u: N( R; T        else wait for 10 sec* h. y. c+ [2 c( p& M$ M
        if A_i=A_leave then send to die
& m; t$ \5 j0 F& }% \# r4 u1 ~# a        else inc A_i by 1
, c# u9 Z+ L# @4 L& L, o    end# j2 A) Q, ~% u7 ^. R$ n
end
! }  f. |( v; H4 o; S' M& s1 r! ~8 [( r; T0 S' e
begin P_pick2 arriving
- Z( P! T8 k7 J    set A_i to 11
2 M# K. N3 q' k) a    move into Q_induct2
% T+ G) l1 n* Q7 v    move into pickaisle.induct2
/ D) v  u# Y- q    while A_i<=30 do begin
: q* T" U) O1 Y3 J" v* A. s3 x        travel to pickaisle.con(A_i)
9 S; k9 t5 H( n$ H- ], I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ?* c, |8 h, Z$ p1 ?5 _2 ?
        else wait for 10 sec
( j, k  S, _* e        if A_i=A_leave then send to die
9 N0 m; V+ T0 D( e7 G        else inc A_i by 1
+ v* ?+ x% K& _- v    end
. i: S: e+ n1 v: [9 u  z3 {3 xend
4 _0 h3 j3 m& C( ?
- Z8 d, |1 A0 c5 t8 i. O4 F, sbegin P_pick3 arriving
  T" p' w% I+ Y% N$ P- d3 p1 O2 `, g  M    set A_i to 21
2 }, G# N% B) Z( W    move into Q_induct3
/ l9 A- {$ H% \1 c    move into pickaisle.induct3
+ q' H+ e9 g9 d+ G; i    while A_i<=30 do begin
$ V6 j& o0 [3 O% m# U* Z        travel to pickaisle.con(A_i)
( ?' A8 Q" B4 H) A+ T; u& J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 _6 k5 m* W% A2 v. Q- P( Y# x9 ^- M
        else wait for 10 sec% l3 V* H9 E8 N2 h6 d$ D3 v, i  g
        if A_i=A_leave then send to die
9 i% I' u1 p1 n        else inc A_i by 1
8 r5 L1 f6 m1 `0 y4 g+ R# U    end& P# p; X& Q8 z  r
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是个什么东东?4 W4 ]( N3 _5 }: P9 Q3 }; k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 J0 y6 a5 D% D. \+ k
# J+ O. ^7 p( c$ k, @/ G( X: c
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 w! D: v- W4 _
1 y4 O9 i% p0 O) y/ m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 Z) m$ k& d) h0 J& Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# y- j1 _7 i; F8 w$ u, m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 T- j: X4 ~9 t5 v) D4 q3 @0 Q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 p8 N  [/ @8 P' N! N. v& A2 l
begin P_induction arriving+ c6 i7 b5 Y% [, p# {$ h
    clone 1 load to P_pick(A_induct)8 j6 o9 E+ i. L7 P
end最大的系
0 r' \6 S! O7 C% F' ~8 N  o. {/ x
begin P_pick arriving" v  Z1 o& K: j2 f% ~# N
    set A_i to procindex * 10 + 1) u, _3 L7 A* O  V, ^/ K/ k; ^
    move into Q_induct(procindex)5 \" W" Y" I/ o  B
    move into pickaisle.induct(procindex)
9 I( u* u* _; K) E; G9 b    /*check the type of pickaisle.induct(i), for your last problem.*/
9 P+ D: ?" b+ ?+ Y  I/ Z  q; }
+ F" P/ b  t7 k$ V1 v. E  A    while A_i<=30 do begin  h/ m2 H) H* V! l$ D; g2 e
        travel to pickaisle.con(A_i)
( D- ]3 w; X1 C6 Z% B/ {: e, I3 `4 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, Q% [1 R$ j& H" M        else wait for 10 sec: _( Q, R+ f& x  u* p
        if A_i=A_leave then send to die1 \, Q$ w' b+ i( D" H5 `
        else inc A_i by 13 P) E3 C; H6 b
    end
1 o% Q$ F2 k" C! I8 w/ D3 K9 ]end1 W  D' G/ o; ^$ e9 d

: Y, _" B, r+ I: i; P3 L  ?其中的procindex为整形,代表当前process的序号。
0 c, Q7 ?* ]4 h$ zstation和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-4-20 14:05 , Processed in 0.018003 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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