设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14674|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) s. m: O& k7 c! h& H$ ^4 n3 P3 c" l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 A% R2 E2 E% m& x3 R8 D
6 W: b. B6 f& k  r" B9 M' G+ V- u
begin P_read arriving8 z) p- O8 A8 ]
    while 1=1 do begin
9 W; j2 V7 j; I! r& Y        read A_tote from "data.txt" with delimiter "\n"
$ c# K/ a3 W) }$ A( W& L        read A_time from "data.txt" with delimiter "\n"
- O7 P  R6 x& k& L( p3 \4 {& h        read A_leave from "data.txt" with delimiter "\n"
" g$ J7 A1 u0 i, s        read A_picks from "data.txt" with delimiter "\n"
& n& f* L2 U  y, D6 g9 T. e* u        set load type to A_tote
5 \! W6 p/ ]* ^5 N        if A_tote="tote 1" then set A_induct to 1+ P; J" m" L+ S+ R0 a' f, A" U
        else if A_tote="tote 2" then set A_induct to 2
4 r! }4 d: K6 `' ]            else set A_induct to 3    3 I1 P+ G0 y: A8 B- S. x7 e4 R
        set A_i to 0
7 w# g' E9 i5 R        clone 1 load to P_induction
4 Y! a7 a% x" d& E4 W, q        wait for A_time sec
4 |. z6 P- e6 X+ w1 H. Z" H    end
; U+ M1 K8 `% k' \3 I9 vend
( Z" X/ d) V2 \0 n0 M" \* v5 E8 f. M) O2 E  A& y8 K8 I. N( z+ e
begin P_induction arriving
# C- \: ?; o8 Q    if A_induct=1 then clone 1 load to P_pick1
" w( x3 }5 P! Y% K, P- d    else if A_induct=2 then clone 1 load to P_pick2+ ?+ ?5 ^# k: B3 t% R- i
        else clone 1 load to P_pick3
: e1 L9 i6 x+ c* R& @end
/ _# G; F* n) q' o
) @9 J9 ~: R! I$ z# R2 ebegin P_pick1 arriving2 U3 I+ _! ~2 r9 L
    set A_i to 1
- S- K, p2 k3 H5 H, u    move into Q_induct1
  W& \. V3 A8 Z( W  w2 e    move into pickaisle.induct16 g0 z2 x% k& c
    while A_i<=30 do begin
4 e7 j4 L" P9 H1 o( f( K; K  I        travel to pickaisle.con(A_i)" ^8 v2 S& y/ J% u( p# I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; j! c% M1 D+ N) G; r7 l) ?8 a+ _4 j        else wait for 10 sec6 E/ I. J2 O3 r: }
        if A_i=A_leave then send to die
, Y- T, K9 v, K! |+ G8 m: A        else inc A_i by 1
* c( d7 f. a! {- e/ \6 X    end
% x" J  p- T! }9 p/ s" @: X2 Z% hend/ l! n% f" T8 n1 D

3 w' X. u# a$ u9 N8 v4 bbegin P_pick2 arriving  ]* z1 X" P% f; `6 b
    set A_i to 11/ Y! @* L' g# W( @; `% X8 f7 k
    move into Q_induct2
, v6 S, E/ x% o# [2 B) u    move into pickaisle.induct2
# B, J. @4 A; L    while A_i<=30 do begin7 y" k9 `! Z  H2 ~# [
        travel to pickaisle.con(A_i)4 e9 A8 B# |5 b& d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  Z8 F! }" x  s" S% W: V        else wait for 10 sec* z3 ~2 r2 W2 \" [' V% ^
        if A_i=A_leave then send to die  R% X5 G- `+ k* ^; k* B. n
        else inc A_i by 14 |/ t0 K6 `/ }+ z5 ~
    end9 I! P0 z) q% u. t* n
end0 c: f: T1 K# j; w2 P, f3 D

2 |, _- }8 |2 xbegin P_pick3 arriving
( V. v5 T6 ?& C- p* t4 x) l  _    set A_i to 21& I3 E# \2 B  @3 {# J* x- |5 q, t! ?
    move into Q_induct3, H. \, n) n" b! o% b
    move into pickaisle.induct3
4 _0 T% d  h+ Q" J7 H% J8 S    while A_i<=30 do begin
. f7 r5 B- G" W4 s        travel to pickaisle.con(A_i)' m5 N. n/ E: t) P9 \3 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 V( H9 h8 n5 p, E8 R        else wait for 10 sec6 O% r9 P- o# R( }, @' [
        if A_i=A_leave then send to die
- ^1 I/ {' w% b  t        else inc A_i by 1
' m& Y8 G; d  e7 W. ?    end* s, o- H* H0 f: i& a
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是个什么东东?
3 n0 W1 b: ^  C% \3 q. z( c( x$ `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, j- v* a' n4 e+ Z$ w

2 I" H: \7 H+ e7 GAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ {7 N5 e9 O1 P, P/ F
) u$ N' E& O! C8 y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 q, d2 b; q* e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; N% N& [0 ~- Z; M3 b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 h1 v1 Z; H- e/ {  i
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  ^$ m' T- b2 F, ~" s7 G* p
begin P_induction arriving* a8 g' N/ G7 z! X9 `- d6 L  J3 }
    clone 1 load to P_pick(A_induct)
# a' y7 o& ^& s, Y; Nend最大的系
! N3 g- B& _$ n
3 d/ ?- d& O& H  E2 U7 D2 Pbegin P_pick arriving
! Q4 r" H2 p; L# p    set A_i to procindex * 10 + 1
6 F" A0 q1 _9 f' C1 C+ v( {    move into Q_induct(procindex). _& Y) n7 ]) o- V" S8 E! C
    move into pickaisle.induct(procindex)9 T/ H  i2 x) H2 V2 b: Y
    /*check the type of pickaisle.induct(i), for your last problem.*/
# `+ Q/ h: |1 t& V! Y. z! J( U
. d7 D  k: U7 H2 b: D* ?    while A_i<=30 do begin* r% N. m# I' f0 `( X) k
        travel to pickaisle.con(A_i)
+ F. F6 _' L& m, ~. c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 E4 {: \! y: A1 l! b% N! i8 t/ E
        else wait for 10 sec
. O& |& L$ R  A6 e" h" ^7 E        if A_i=A_leave then send to die/ _4 l* n* Q% j7 P% a% |
        else inc A_i by 1
6 G( g3 L5 ?$ B! j9 u, }+ q    end
% I: @3 t- F( O& @1 a- f6 z/ eend8 C7 S! c2 x+ X
$ V" w$ K  W, f9 y1 ?
其中的procindex为整形,代表当前process的序号。
0 I0 y- L' E4 ^7 z& I4 _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-7-20 15:18 , Processed in 0.014490 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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