设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14366|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ f7 m3 R  E9 i+ r/ @8 O) r" H

, h" o6 m9 C6 A) K( Y5 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。* k& G  _) ]: n- \. Z" Y2 e
! @0 ?' p3 [( [4 Z  ^1 i1 U1 Q
begin P_read arriving
& Y# r$ ]! E8 O) P5 B7 d$ ~$ b( D' s. j    while 1=1 do begin
3 \- U9 b6 V0 J9 h: S; O        read A_tote from "data.txt" with delimiter "\n"
5 A5 C. k; `- X3 u5 [; j        read A_time from "data.txt" with delimiter "\n"+ d# U) y* `" Y: Q
        read A_leave from "data.txt" with delimiter "\n". ^* D# }) e- p# N! W! y
        read A_picks from "data.txt" with delimiter "\n"
; ~( ?( Z8 h2 Y" j* A7 q        set load type to A_tote
8 m7 p5 N; ~) h' ]( S& t9 @& }. S        if A_tote="tote 1" then set A_induct to 18 b5 I, _) b1 b( Q, h! b6 h& X
        else if A_tote="tote 2" then set A_induct to 21 G# e. Y0 p( `3 u/ V; ]# k- C3 e
            else set A_induct to 3    1 R9 z- |# I4 H: |2 i9 m: c
        set A_i to 0
5 t/ F! F3 r" M) w5 x" F3 X        clone 1 load to P_induction
# \" B/ D: c  ]3 X) H        wait for A_time sec
2 b" n! P! m% b# l( i$ ]$ W: p3 G    end
5 f7 g% C3 P! y  H' U8 Jend
. L2 {0 U4 l+ z0 O; W9 q* j
! F4 r; F2 X4 X4 a) V! ibegin P_induction arriving; B. U4 C" ], J7 Q+ Z
    if A_induct=1 then clone 1 load to P_pick1
3 d5 O! Y) [: i9 k& N! S& R    else if A_induct=2 then clone 1 load to P_pick2
3 T4 m) u5 ?3 n( k. d$ T* Q        else clone 1 load to P_pick3
5 d+ d% v- d1 Send+ B8 P5 z. t+ v; \/ h" i

, v% K0 N* l+ d$ r( }- \. f- u2 Sbegin P_pick1 arriving
- v" l% H2 _$ b- @" h    set A_i to 1( `$ f5 R+ @& b) r( K  G3 T. v
    move into Q_induct11 x* E& [% D/ M9 v  r/ d4 }/ S: S
    move into pickaisle.induct1# c# \  S" [2 G0 f) e
    while A_i<=30 do begin& W$ v- e& L9 B7 |4 ^$ d0 H9 M
        travel to pickaisle.con(A_i)
1 c+ w0 t+ X8 K) O! l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 T* A2 f6 z+ r        else wait for 10 sec
7 C$ N5 r4 ]3 g# R0 a+ ?1 A9 z        if A_i=A_leave then send to die' u, F7 e& w6 B( x
        else inc A_i by 1
+ g1 A+ Z' a4 V/ ~  _    end
: M0 |7 r: p  {3 B: f& X4 gend
1 D5 N, w( ?, ~! A) q2 B2 o6 U
5 T1 v, c% C2 P1 V- Z) G* \" ~begin P_pick2 arriving
1 [7 \/ x( M3 u2 Z3 i    set A_i to 11
$ N8 M$ e2 C! o( G9 }* j0 h9 ?' v    move into Q_induct2
. j" d6 ^# o4 U" Z( [7 I# I/ z    move into pickaisle.induct2& L4 G, ]" B9 J5 z
    while A_i<=30 do begin- _3 k& w6 u  Z" G# x2 {4 i- C
        travel to pickaisle.con(A_i)3 ^* E; u1 n6 o' C% ]6 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' X3 F! ]3 Z( i: u' ^& l6 L
        else wait for 10 sec
9 w4 X0 C& f5 u( Y) g5 I4 i        if A_i=A_leave then send to die* G- d/ [0 u( S  Z; O8 i+ G8 r
        else inc A_i by 16 {6 k' n, ~; T( O. x5 A
    end! `! ]) ]3 P  s; @2 Q
end, q$ s% p6 f! L) r
& V. r: p2 J' y7 B) r( m
begin P_pick3 arriving
8 }/ y* }* z9 c    set A_i to 213 T* b* X7 @  P1 H% d2 Z
    move into Q_induct36 p' U  w. b0 X  `9 |+ s3 y+ c
    move into pickaisle.induct3* \& K2 d& T" M+ x. h8 _! k
    while A_i<=30 do begin: E) z7 p+ H4 k4 B5 h0 U
        travel to pickaisle.con(A_i)
- l" o1 x) l# a% [2 R/ r  l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 O! Z; y! M0 x! q
        else wait for 10 sec" W- z8 C- M8 O5 F  g. Y, h# \" I
        if A_i=A_leave then send to die) A( C+ K0 Q. _& {7 i+ x8 `, Z% E
        else inc A_i by 1
* H8 `; S5 p% ~$ i    end0 ^* c8 i1 \% x( O
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 u4 ^2 q5 u6 P6 m0 D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 ~! w) }# h5 ~5 f$ a7 j

6 `2 C6 K, w2 z6 R9 d+ k) NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ ]( S. g7 p5 O! v- x: s
1 J$ X5 z( B$ |( u1 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 X+ M) r6 A: S. E% d1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! U  I1 X2 e8 c! Z. w' V5 P8 q& p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 v4 ]' v; [7 V2 s( e3 j2 ?0 r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' w7 C5 b5 v; f" M, c
begin P_induction arriving5 P3 Y- Z: v, ~+ C0 ]
    clone 1 load to P_pick(A_induct)' A' d/ O* l1 k# c, u
end最大的系- @9 d( d; ^& u0 [$ X6 S! \) a4 U1 X

3 p. M7 M* v! |# O; {' xbegin P_pick arriving; p* C$ a: O% g0 W
    set A_i to procindex * 10 + 1
! `. E' r0 J# x- n" R    move into Q_induct(procindex)7 C0 y. r6 e% T  {2 b) M: J+ V- ^
    move into pickaisle.induct(procindex)
, `2 |, L( B: f% Y) Q9 p" ?    /*check the type of pickaisle.induct(i), for your last problem.*/9 W6 H+ p  R) c6 H6 Z3 ]
5 J! y0 z: `2 W2 C( d9 P/ Y. O( \! ?" A
    while A_i<=30 do begin% q+ o  U/ R/ o% |, q% z' \# \: E1 h8 z
        travel to pickaisle.con(A_i)
! M, L7 I$ A, S( ?" q4 W  C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, l& S0 }  W; X' o6 x# c. v% n        else wait for 10 sec- r4 e8 ^' W+ D
        if A_i=A_leave then send to die
" [& m: @( d. d) |" Y# T: _        else inc A_i by 1
+ D& H& D' @# x* k( m- q/ n    end
9 _. p8 }- T. a; B% \1 ^. r. Wend9 v5 {! D* {. T& g: E: I, _4 p8 _

2 s* R% O) Y- r# ?* q7 z4 t; G+ W其中的procindex为整形,代表当前process的序号。' p! s' F$ j9 j1 Y; h1 f$ {% [
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-6 22:03 , Processed in 0.013316 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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