设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14991|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) v! ?* j4 g. |2 j' u' L
) {, o; T8 H4 Y4 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# u$ X8 W+ O+ ]5 }* w9 d6 z8 |. {5 z- v4 ~4 T
begin P_read arriving! N4 |' A$ E6 l
    while 1=1 do begin
+ Z  s$ ?5 L$ ?        read A_tote from "data.txt" with delimiter "\n"
3 f6 B! Y1 A8 c4 m1 K        read A_time from "data.txt" with delimiter "\n"+ H4 w" K. x7 m4 y5 ^& e
        read A_leave from "data.txt" with delimiter "\n"
0 V+ z5 x3 V6 c# ]) s. w        read A_picks from "data.txt" with delimiter "\n"& ?2 Z# u& r  l) s9 k
        set load type to A_tote* T" S; }; V1 q3 R% \# i  B
        if A_tote="tote 1" then set A_induct to 1) t" Z7 j. I; N
        else if A_tote="tote 2" then set A_induct to 2$ x5 o! @" Y5 m  \" c
            else set A_induct to 3   
0 c4 G0 H# O' @: S        set A_i to 0
  T) c) F  k/ X! I: e6 S4 }. }. Q        clone 1 load to P_induction
7 h  @" t3 A8 H3 [) H: Q- Z1 L        wait for A_time sec8 E3 d; p4 R" S  H0 l7 Z
    end+ Z' b: Q3 C8 i+ @$ Z& s
end* a( H, q* b& c6 `- Q

: N6 [2 {4 ?/ }1 i/ Jbegin P_induction arriving, _& A2 O" D' X/ }% G
    if A_induct=1 then clone 1 load to P_pick1" H  d2 @9 R" b, F- T
    else if A_induct=2 then clone 1 load to P_pick22 I) H9 L: L! {4 t0 c$ b9 K
        else clone 1 load to P_pick3
- u1 P' G; Q$ a4 @8 _2 Aend
/ F( d; V0 f8 y8 ]7 Q$ D) k
, Y4 U, ~: |& O3 k4 A: H5 Y3 pbegin P_pick1 arriving( @( Q  D8 m4 w1 z1 u8 c% e+ u
    set A_i to 1
) q* u* s' y$ b' X; n" V9 n' c    move into Q_induct1# F0 X) z6 c, i. t5 o4 N
    move into pickaisle.induct1: t; e& O; L2 l7 l3 D8 b) r
    while A_i<=30 do begin; s, }& B$ z' C( Y  o
        travel to pickaisle.con(A_i)
  L7 n9 |/ R; |* l2 A' b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 p3 \0 a, R. U& A
        else wait for 10 sec
- y+ m; R, G/ `1 O7 p        if A_i=A_leave then send to die
+ B1 g3 i9 @" W  u4 e$ b/ m        else inc A_i by 12 w# c' L( u7 v+ m
    end' A5 x5 ~' N8 J
end5 R( {; X- C5 @
' X& p1 H: C: k& }$ L
begin P_pick2 arriving
) _! V* L' n/ G- s    set A_i to 119 F3 q/ D7 b- I! A9 f/ D# W' n' y
    move into Q_induct2% \) Z. Q% c3 w$ v- i0 ~
    move into pickaisle.induct2
  {7 ]$ {3 Z4 O0 E3 h, p! r( d    while A_i<=30 do begin* l/ l/ y5 S9 o4 ?1 B0 n4 n" J' ]
        travel to pickaisle.con(A_i)3 h- ^! b, [# u4 s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ v5 C& `3 R/ A/ l" ]- J. x
        else wait for 10 sec" {1 q0 Y3 b3 R
        if A_i=A_leave then send to die% K' w$ f! a' a+ Y& o2 s
        else inc A_i by 16 h. F3 c' \2 f. ?  A) X
    end7 ]4 X+ l0 E4 ~* {! h* m8 p
end8 E3 u! k: G, H
% b7 b! T) P: B4 K( A1 {. U
begin P_pick3 arriving
9 A+ j: e/ x3 ]. X: M! ^    set A_i to 21
1 r1 Q" d9 a8 [# q) t    move into Q_induct3, H9 q9 Z: I3 h* G
    move into pickaisle.induct3
, H( c: w7 o! [% N) a2 N    while A_i<=30 do begin0 ^/ n. j' G  A3 G' G: g* V6 `; _
        travel to pickaisle.con(A_i)
) G1 d2 d9 e( q3 M* u" z- X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]5 t1 g4 A+ g' N5 N8 D8 V        else wait for 10 sec  ]  p6 D( A) a0 ~
        if A_i=A_leave then send to die
4 A) R/ ~) h' @3 n. [2 E        else inc A_i by 1
2 D7 Y" F: I7 f  \7 y) N+ ?, y    end
" U* d4 c8 W( m/ M; Y5 R3 Pend

最佳答案

查看完整内容

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是个什么东东?( q0 G4 Y0 C& P2 D7 c) [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" \* o5 D0 b4 Q% |% k8 p
; i* ]3 R+ L, Z) nAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! t6 [8 f8 m" F9 V( ?; F( J" P9 {: B
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 s' g1 ^. T! t1 C- N1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 R9 W' q- ]! N! P; |$ ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, O/ z4 J7 W: ~" t3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 D" a! I, ?0 W+ u
begin P_induction arriving
! q& j1 q: {. x  l. ~2 c    clone 1 load to P_pick(A_induct)
1 ^1 p0 H: i6 @6 K- h1 Zend最大的系6 x% A; h- L! @9 g( \
6 y% Z3 X4 K0 q; {
begin P_pick arriving) t+ b' h" _% D  H8 ?" E5 S* l
    set A_i to procindex * 10 + 1# N% [+ ?/ s" G2 }8 F) X4 w
    move into Q_induct(procindex)
( }& {: v# d- t6 Q    move into pickaisle.induct(procindex)5 f! k" d7 W  C5 x4 `2 M# T1 j$ H9 m
    /*check the type of pickaisle.induct(i), for your last problem.*/& ]+ b  l; f( j8 x
! ^; V* ?: f& {2 a1 x
    while A_i<=30 do begin/ p' h7 c, {+ x5 e# B" @
        travel to pickaisle.con(A_i)# b; F: }: v3 p0 b% U2 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) b# a8 I: C: ?' ~& L
        else wait for 10 sec
; o$ m8 i( h7 B        if A_i=A_leave then send to die
/ z5 w7 }3 P2 p8 \2 J: G5 s# m        else inc A_i by 1
5 F, j4 j' f+ M9 \    end- ?, A4 p' p8 Z
end
, O# I7 ?/ a6 O1 u5 L) b% ~% I$ K
% S) i% O" ?! Z7 z. {其中的procindex为整形,代表当前process的序号。
* i1 E0 y/ J! ^5 \( [; Sstation和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-8-2 09:02 , Processed in 0.016186 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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