设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15666|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ v4 n! ^7 j6 I
: S: y8 ]: A9 w我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ C; q- I. j/ c$ }5 \" }
! U8 F: _) ?! z. X
begin P_read arriving
! ]- E0 u0 L5 E+ n- C    while 1=1 do begin; A+ s- g4 N& x2 E9 R2 T& u
        read A_tote from "data.txt" with delimiter "\n"
% t+ ]7 c0 y1 P! q        read A_time from "data.txt" with delimiter "\n"& B2 G4 i; _6 y# f8 m6 N8 q
        read A_leave from "data.txt" with delimiter "\n"
5 x. O5 _$ V0 R% K        read A_picks from "data.txt" with delimiter "\n"7 O& ^) \, t  O. _9 {" j
        set load type to A_tote1 \- x9 w0 g0 l9 t
        if A_tote="tote 1" then set A_induct to 1. f' a& n, I9 G8 Y/ g# _% G
        else if A_tote="tote 2" then set A_induct to 24 V/ r/ ^( W1 U& K! A$ ^4 u7 \
            else set A_induct to 3   
& `1 o( _! }0 ^* t! r* y  d        set A_i to 0
, S8 b  Z) f) y! }        clone 1 load to P_induction3 ]5 f4 P, M6 D# j$ ]
        wait for A_time sec4 Q8 I3 n- ~: P+ m
    end
3 q' ^( m3 \& D; }end. [5 c8 C7 N  X' Y) ~

, z7 A2 z0 c) ~" a. ybegin P_induction arriving% e- K9 u* ~2 [
    if A_induct=1 then clone 1 load to P_pick1! t  s* O- U' E" B6 P& p9 u
    else if A_induct=2 then clone 1 load to P_pick2! E( Z6 ?) E7 x. Y9 E
        else clone 1 load to P_pick3
8 I3 B( F; F3 ?  Y. o: p, t  lend1 e0 _; K3 F, F
' U) C1 F' T7 U# a% W# h
begin P_pick1 arriving
! N1 G0 f; j' r3 v- H6 e    set A_i to 1/ m8 q, H: h; q5 X! R1 J  P
    move into Q_induct1" Y# G4 f0 b7 f& j' _0 [; ]5 M! }/ q
    move into pickaisle.induct1
, z, G' b6 i( s3 C$ G) f    while A_i<=30 do begin( W) S+ H  P1 |6 p4 |9 l0 b8 O
        travel to pickaisle.con(A_i)
- E, P3 K. L' f5 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( C' f2 ]  ^" U- O+ q; Z
        else wait for 10 sec
2 b1 y5 x9 O; y% Q" ^/ j        if A_i=A_leave then send to die( _: f; y1 L+ l0 h" R  l
        else inc A_i by 1! `9 H' d) I# k: |7 H% o8 J" h$ q
    end
4 _5 p/ s& f' K, e: R- b4 \end
; Q3 z8 p- Q$ g3 p/ |0 Y* r+ `' v7 {+ E3 n6 ?, x2 Z: b5 j
begin P_pick2 arriving& N: t( R7 t! @" P, j2 [2 j2 s
    set A_i to 11
* l6 H/ a( o! t& y/ b* e    move into Q_induct20 i8 {7 a6 `- H! Y, r
    move into pickaisle.induct23 j- B' N9 l. ]
    while A_i<=30 do begin
5 E* m5 _% D  g- `" v, Z$ y        travel to pickaisle.con(A_i)
7 ]0 t+ ~+ I9 _" E$ y/ e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& {  x0 D+ ~" e0 U- w( ?8 e        else wait for 10 sec
& O2 H& s3 X- C0 y; d6 Y! T( A        if A_i=A_leave then send to die/ Q+ o4 \7 U" i1 l* ]7 t
        else inc A_i by 1! Q. X0 j- }% q( }2 I
    end
# q- p' |2 x  [& G$ N$ Y. \* x& eend1 {! E5 ]' G' N) m8 T  M) Q7 J
5 [( f9 g; |: ?; M( n9 J+ e3 o% l& I; r
begin P_pick3 arriving
5 S6 H* h* Y: E3 s6 C$ j& r    set A_i to 216 u. ~4 V8 |# _4 b
    move into Q_induct3# k5 L* S2 U( _/ w
    move into pickaisle.induct38 X$ I" H+ [1 U6 r9 k
    while A_i<=30 do begin" e' O" ?# a# ]" E
        travel to pickaisle.con(A_i)
4 v& |/ @0 _( k( b9 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& J, ^# I( c. g: ?# m% O        else wait for 10 sec
% j5 R1 q* l8 z        if A_i=A_leave then send to die+ j, M0 z+ u' Y! }; l" k
        else inc A_i by 1
  M6 t! r8 Z* ^' ~7 w    end
, Z. P! f. l1 Uend

最佳答案

查看完整内容

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是个什么东东?
+ E% C+ f! T2 |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ d; g7 j/ O$ t* l# S

- q0 g# u! ^( Y0 u$ A) d5 A0 AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ X7 D$ d1 q+ A9 A- }

  Z1 d& c! U7 i8 f& f! Y2 [# B+ i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; {/ B5 E0 m, g; B) @+ B! v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 _  B7 n  Z1 a* i3 q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& X- o0 A/ ?2 O" C" L3 z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; }! Z. i# o7 z0 c* Z1 q: z( kbegin P_induction arriving+ X, [$ r- D9 T9 l2 a
    clone 1 load to P_pick(A_induct)
5 e' y. e. b; K2 z$ Y" H1 N# d/ Vend最大的系
; Z/ E. Q2 s! K) L6 Y; r
( T4 o) y% O* }  V( x/ ^begin P_pick arriving) {% x, f9 w6 E" f$ E. a
    set A_i to procindex * 10 + 1
( I( |' j6 E" i$ R7 i6 T) D( Y0 n' e0 m    move into Q_induct(procindex)
; M% @1 m! E3 I- v- D. y- U$ k6 L    move into pickaisle.induct(procindex)) L, W' I5 Z% O- z
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 y1 g) [( S2 W0 x! q1 E8 B7 I
' Q9 ~+ p, ?& Y- G; D    while A_i<=30 do begin* w2 }; F0 \6 }! F2 N, ^
        travel to pickaisle.con(A_i)
/ h9 n5 x9 J2 K6 x  Z8 ^1 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& L7 H& ^* s3 w
        else wait for 10 sec. Y" g$ F3 F) r* ~( A& `6 O
        if A_i=A_leave then send to die; A9 ]5 N' s; g, N
        else inc A_i by 1
% ?) w& f4 k6 L# N' G    end
3 l+ D, |+ L4 g: N. x: z, w$ x$ Tend2 J; C- @4 Y1 O5 Y9 ^" }; u* ~* X

9 X; ]: d1 i2 Q1 J/ o其中的procindex为整形,代表当前process的序号。
) @3 F% P0 o; w- e  d  b3 ?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-9-26 03:34 , Processed in 0.019228 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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