设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14400|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 H+ W- |+ N! E# S0 G; S. Y

/ e0 d8 ~' ?2 w0 f) `我的问题是,在每个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 m6 r1 ?2 R2 I

+ U; X  D5 @2 @# L$ Abegin P_read arriving
, i' Z/ r/ }' N- H1 i: K# k    while 1=1 do begin
& X( ~7 D; s* `) v! |! C& i& [        read A_tote from "data.txt" with delimiter "\n"
+ p( Z3 C6 H6 D0 h7 Z" R4 L        read A_time from "data.txt" with delimiter "\n": g  Y; ]3 i0 D$ i- \( f
        read A_leave from "data.txt" with delimiter "\n"" F, S: t% p1 Z# i% Z
        read A_picks from "data.txt" with delimiter "\n"" ?7 ?# _5 b3 F9 ?
        set load type to A_tote
6 r% a' A( g& R) \) x6 h        if A_tote="tote 1" then set A_induct to 1) @1 |/ N6 f+ }4 z5 l  q
        else if A_tote="tote 2" then set A_induct to 2
$ x9 }# m* i- v4 y; o+ a: b8 v( r% P  i            else set A_induct to 3    ( D0 V% {/ a2 `* b  \8 l
        set A_i to 0
" |# K  R  o+ y% F7 y( \& j        clone 1 load to P_induction
" Y( {2 Z, J! K" ^. R/ l2 _* M        wait for A_time sec
- J$ ?# o* I$ J# P& q% v    end$ i2 t! [7 c8 n( e+ g
end& W' d; k* S" n7 N" v! P
$ J; C' E6 n. O1 O8 [4 Q. k
begin P_induction arriving
, G2 T- D' Y+ ]& _& p& `0 i    if A_induct=1 then clone 1 load to P_pick1% t% H0 A3 L8 ^' R% D8 B: j4 B
    else if A_induct=2 then clone 1 load to P_pick24 h7 a7 N2 k0 J0 T/ A& L1 o
        else clone 1 load to P_pick3
+ t  k- |8 v, b5 R& Lend- {% D* C5 L3 l; y: S
& J9 I2 p. |/ |* O0 a0 H; W- X0 G. p
begin P_pick1 arriving9 |( S0 d1 A( z4 p6 f8 o* f2 h
    set A_i to 1
+ h/ s# T0 j4 G: {( p5 J3 F/ o    move into Q_induct1
4 V" m# ~1 M6 L0 T) c    move into pickaisle.induct1
; ~0 j; m9 N( D" J; A    while A_i<=30 do begin& a2 Z: N) Q/ ~1 _
        travel to pickaisle.con(A_i)
' e7 ?% o: J7 p. h  H7 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 O( j3 Y- i- y5 h
        else wait for 10 sec
; p  h! d$ V& T+ b* G9 k2 U! K        if A_i=A_leave then send to die) l, |4 g; v) Z  g% x' j9 @
        else inc A_i by 1
6 C) Z7 R; U% |: h& [1 O0 h, S    end
+ C. H' A! C7 u. a9 G) ]; Mend3 b" N5 H1 h: f( r4 c4 X
5 v% x3 o% L- ~( Z2 N; z2 k
begin P_pick2 arriving" z2 t# c4 w1 K- G  k0 i9 o9 e7 Q
    set A_i to 11
3 }! M% [1 f+ x; |  \3 B/ E. R    move into Q_induct2
. l3 {3 f4 g8 ?) Y. N    move into pickaisle.induct26 `5 [: e0 S; K$ T7 z! J- V
    while A_i<=30 do begin
" H% X4 Y+ L8 E" N6 }4 b7 `6 l        travel to pickaisle.con(A_i)* e9 d' f" U7 G. {) u+ E* b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: V1 `' U' y. R( @8 b* y& c        else wait for 10 sec# k7 U# e% S, z& U6 M9 v
        if A_i=A_leave then send to die+ g7 ~! V9 D9 F. p2 ?0 c* _
        else inc A_i by 1
7 R% q' F' ^9 {    end4 L' I0 z( m, V2 c& ]
end
# M3 }- F9 ~8 B9 T. ~/ y
# ?* M$ A" r6 ~+ obegin P_pick3 arriving* `7 G# D/ Z0 O; a* E
    set A_i to 21
1 m6 k2 `5 z/ D* u( t5 a5 ?    move into Q_induct3
: |8 e2 D" ^0 C9 e* _! k6 c    move into pickaisle.induct3# T% I% r1 ?- O- Z6 c- y
    while A_i<=30 do begin& k; n7 @* f" ~+ y/ i4 p3 k
        travel to pickaisle.con(A_i)
  c7 Y7 S6 P" U: j% P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ~1 |+ A: \: R3 W
        else wait for 10 sec
. }/ Y0 Y( x3 f; m7 r8 p! S* t        if A_i=A_leave then send to die
. D- H9 ]6 {5 h; d" o; W        else inc A_i by 1
" ]( |1 N0 v+ T; [/ x2 x    end9 Y! _7 |$ |2 e0 b! u
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是个什么东东?
1 l) ^9 u5 f7 T$ ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ }% F9 q5 j  [# f: u6 `2 U
2 B" y! f7 V% ^5 T7 E/ ~& e: r
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" m* s# D$ h, N
5 y6 C0 v& ?; R6 G  ?$ l) i& C% D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 v8 {0 v* b8 Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 e4 h/ [3 B* e- T+ {$ S- i2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 t& H6 \. d& G4 k% R" Z$ j7 R! p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 g( E% X. A1 H
begin P_induction arriving
. a+ p& q2 Y" t; t6 h8 S! V    clone 1 load to P_pick(A_induct)' p8 _. ?, J+ Z2 F4 k) E* v/ f
end最大的系! p% G# s) f7 R
) T9 R5 w5 `2 v, V. O! c; f
begin P_pick arriving8 B/ ~% ]1 V4 ?
    set A_i to procindex * 10 + 1
; s$ n2 [6 k" b4 J; |, P- A    move into Q_induct(procindex)
6 D! C# h7 U: {0 X+ |- B+ k; W' e    move into pickaisle.induct(procindex)8 `$ j, W1 }. `; N& t
    /*check the type of pickaisle.induct(i), for your last problem.*/
! ]' d) ~8 g" \  E" q! M4 J5 }% V$ u- }; B2 H4 ?3 z
    while A_i<=30 do begin
' l4 P# j& }" T) T7 [- A5 k        travel to pickaisle.con(A_i)
9 ]- s/ A; x. w; S! V. i; p8 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% t" g/ _' Z- @
        else wait for 10 sec
( o0 @: r4 c( N        if A_i=A_leave then send to die4 r3 l) F& Z7 `3 M0 O4 k: Y+ S, T
        else inc A_i by 1
3 y8 q& I6 M+ U: f" D) E    end
: ]* J, T* G. p" [0 Wend
+ h  o* r8 _  w$ E3 c- Z
5 ~; ?/ [* [5 n8 c: G其中的procindex为整形,代表当前process的序号。$ ^# l8 n" V' u8 [: c1 h( C
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-10 01:56 , Processed in 0.016640 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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