设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13635|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ ~- V- i" L' w' \2 _. u  \8 D  Q5 l) t) d0 c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- q" \* p$ s) z- e3 j  W: K
0 W/ q! l, k& r4 J4 u
begin P_read arriving
$ L, P; ^+ K( O    while 1=1 do begin/ ~$ e7 n% T8 ^: {
        read A_tote from "data.txt" with delimiter "\n"
/ Y- n, _  p" l! ?. P) M        read A_time from "data.txt" with delimiter "\n"
* E  u5 s, s  S2 a6 v. I        read A_leave from "data.txt" with delimiter "\n"
: X  _9 b" |* N% E        read A_picks from "data.txt" with delimiter "\n", K4 d, z6 q7 M3 q2 W; h
        set load type to A_tote
. W- c) b0 o  i, N8 v        if A_tote="tote 1" then set A_induct to 1& q) O  `/ s+ g& Q5 A* t9 T3 g
        else if A_tote="tote 2" then set A_induct to 2. `- S1 ^+ _, m; Z
            else set A_induct to 3   
- w# e2 o; F5 j3 G- s        set A_i to 0
9 f5 T4 U& U8 {3 ?" }+ b3 y4 p        clone 1 load to P_induction
5 K7 G/ M0 O- k, e        wait for A_time sec( ?( ]% D5 j5 {4 q8 w! }, S
    end
  m( f* [0 d+ ?: _+ s- i1 send
3 _4 K* g6 c! v" \
  \# R  _6 G/ P. |; Bbegin P_induction arriving7 y2 Z* ?; ~. }2 u; J) N
    if A_induct=1 then clone 1 load to P_pick17 H# g5 j  y7 ]; a/ g# b4 o3 ?
    else if A_induct=2 then clone 1 load to P_pick23 H) U% [6 L. q$ P# d7 a
        else clone 1 load to P_pick37 v: l, [/ I# d, F( d9 ~; T9 U) _! ]
end" s- h6 Q+ b6 w& ^) M
( Q+ c' ~8 I' {  s. w% Q
begin P_pick1 arriving7 [) L: ?' U1 Y
    set A_i to 1; j6 c% W9 D! R5 O
    move into Q_induct1. v- g( m5 @$ {- W" p+ ?
    move into pickaisle.induct1( D8 n: i" U( W, [3 J- H4 {
    while A_i<=30 do begin1 N. O8 W; [, N6 q) {
        travel to pickaisle.con(A_i)# L& Y8 q7 S+ V; N: y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 a# m/ u) P0 H. M        else wait for 10 sec  t/ M& `* Y; e4 |3 d* `, B/ T. f5 o
        if A_i=A_leave then send to die! }8 p, i: R1 w! j. T7 u% X
        else inc A_i by 1* q1 F) p/ r& q) s# t
    end- y' E5 Y, a! `  C6 q+ U' p7 ?: c3 L
end8 h' @1 W) _' ]9 o
% `" Y4 {# v  b8 r4 N
begin P_pick2 arriving
2 g; m$ F! f. T& y4 w    set A_i to 11
- H. M  @: ~3 G9 u& c! b    move into Q_induct2
% e, ~2 T) a) O8 v1 m    move into pickaisle.induct2& F! |4 Q# `1 @  b3 K
    while A_i<=30 do begin+ @2 E2 B* c/ e) E; z
        travel to pickaisle.con(A_i)
, u; W6 {* o1 V- T' B% ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( H9 M; h: }' x        else wait for 10 sec+ w6 \, k9 n# A6 @8 Y
        if A_i=A_leave then send to die* j9 m8 j( f5 |
        else inc A_i by 1
" W6 g/ C+ u' F8 z    end% ^) _# X( z/ C4 X+ u
end8 Q8 a  ^7 L9 }1 O, T
8 ?% {, Q) a1 \' o. C. R4 o7 K
begin P_pick3 arriving
0 u) f! ~& Q/ s2 n( Q; x, {    set A_i to 21
5 O7 O# d1 v2 G+ d5 P    move into Q_induct3
  s+ O' P4 \% I9 N( M    move into pickaisle.induct3
1 u$ B" j$ J2 }% T' ]' V% g6 ?    while A_i<=30 do begin  u' M( @8 j7 A& n  |
        travel to pickaisle.con(A_i)
" ?5 k) H# ^$ E) w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 S6 F4 O, l+ j) E! B$ n: i
        else wait for 10 sec8 U6 Q/ c. J( |8 ~# z3 E+ {/ C! @
        if A_i=A_leave then send to die7 h5 U0 I+ c- L% Z
        else inc A_i by 1
: d( i+ h( N( p    end
6 q+ D( P- t+ O8 Y$ u& Gend

最佳答案

查看完整内容

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 {' k' Y, |0 l/ s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! ^) A3 F; o9 t6 C+ R0 G5 T
9 z  T  [& {/ z' e( K: `, d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( d/ h2 p8 O9 R
, O+ N! x5 u  E5 Y% }) n) s
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 Z* H0 E; ^4 W; r1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% V2 C! @$ S) A9 x! S2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; E: a& m' h- b# O% a& j$ V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! G! t% T, g  u, ]8 H6 g9 vbegin P_induction arriving9 Z0 `  m+ r' P7 [2 H) r+ m& A
    clone 1 load to P_pick(A_induct)
4 t/ D* e; `$ Y7 x7 X  H% f7 Zend最大的系9 G3 u  ?7 Q# m- J! W9 {

2 D2 r+ L# y( I0 z3 {4 c- ~( jbegin P_pick arriving! p: R7 \7 m+ O8 [# L0 ]
    set A_i to procindex * 10 + 1  A& j( Z  t) j1 k. d
    move into Q_induct(procindex)9 i0 W; D, @( p( L. h5 W
    move into pickaisle.induct(procindex)
! v( E  o7 e+ ~) J5 E, D! a! [1 G' M    /*check the type of pickaisle.induct(i), for your last problem.*/
8 \9 T( j, U/ `. f# Z, K3 N5 J1 n0 w! Y+ [: A5 ^% d8 L' A5 k. N
    while A_i<=30 do begin5 D! |+ u& y/ N% ]
        travel to pickaisle.con(A_i)
8 p1 G% c% f) w( i: y: @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, K2 R" Q! f0 y6 U; Z        else wait for 10 sec
" T$ f2 q; |3 ^, m5 L# Q        if A_i=A_leave then send to die& P( w5 y- `  b' z4 J; A
        else inc A_i by 17 Y, u$ _8 M  j( r9 U8 n4 l6 H
    end/ i0 h0 X; K4 S1 B
end
4 w  f% L& ]. J- V0 E/ P
4 `$ q  L* I9 s2 j其中的procindex为整形,代表当前process的序号。
3 n6 P3 y  O9 \) qstation和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-25 12:53 , Processed in 0.021044 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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