设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13836|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- [$ L% \: k! I8 F' z0 J0 [( c, Y4 R" `* G3 b
我的问题是,在每个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 o2 E4 \4 o/ l  N2 w2 P. }

, a! `) _) K3 @begin P_read arriving% ~8 v& _8 F4 L* G0 k  a% M% o
    while 1=1 do begin
7 w& V, [0 E/ O8 Z; r* Y        read A_tote from "data.txt" with delimiter "\n"
* X. M) b. d8 d. o7 l9 M  i        read A_time from "data.txt" with delimiter "\n"
  r% p1 j: t: R* ^/ \$ E        read A_leave from "data.txt" with delimiter "\n"  X+ _  M! C! P1 O0 d
        read A_picks from "data.txt" with delimiter "\n"
* s* A  j0 ~+ z# R6 e6 Z8 G        set load type to A_tote
; w8 A7 L0 }7 y  V: L        if A_tote="tote 1" then set A_induct to 1
6 J  g" \' D9 ~$ A        else if A_tote="tote 2" then set A_induct to 2' _/ L- a7 N2 m1 D" M
            else set A_induct to 3    5 {% u' G1 q% @5 M" Y
        set A_i to 0
2 j; j% M4 B& q1 [3 x        clone 1 load to P_induction/ K; S1 j' W* v( j' n0 f
        wait for A_time sec4 T3 H# f3 K# G+ Y: B/ I1 f
    end
& v6 c+ c& o: Eend
  T6 d8 i- n% B- _+ G3 I4 Z; Y# a" D' q4 E
begin P_induction arriving
2 m$ ^$ i& G1 E    if A_induct=1 then clone 1 load to P_pick1
  \+ p: v3 `5 O" h    else if A_induct=2 then clone 1 load to P_pick2/ }* @. j  T* R8 X# N  U
        else clone 1 load to P_pick3
7 P& T" t' @. Eend( B6 o4 P4 ?3 r. a& s

1 l; C3 G' L/ G: ^( @! L2 obegin P_pick1 arriving% h9 B8 y) s, V9 M4 v/ ~
    set A_i to 1# O2 m, }* m9 c9 M* v
    move into Q_induct1
& x- _% q( \9 n4 f    move into pickaisle.induct1
4 c8 e: \7 d: P    while A_i<=30 do begin
9 M2 s. b! L- I4 T        travel to pickaisle.con(A_i)
. M/ L7 `. x  a# q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 Z5 L' a) C  o2 J        else wait for 10 sec
- u& a; K( r1 g/ j0 @        if A_i=A_leave then send to die, j1 L, n, Y. N2 a0 y+ m
        else inc A_i by 1
' _3 v* t+ p  I6 _    end
$ I2 J6 T' i8 eend; J5 V5 P* c# l! \: J3 R

" k% U, V  u7 vbegin P_pick2 arriving. g7 C; a" k1 V' B+ ?) c
    set A_i to 11& Z: i7 }1 ~/ L  O
    move into Q_induct23 A8 d/ W- R3 [" d, B
    move into pickaisle.induct2$ H& k  Q- R) L2 h
    while A_i<=30 do begin0 I. ^* k4 W$ i5 I0 Y# R: ^' R7 W
        travel to pickaisle.con(A_i)
8 x  N) L' ~* I5 r- W- E" v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# I& j9 T$ D! v2 x- l; z/ X5 g* k
        else wait for 10 sec
% l) `, v! R& g* r* d2 |/ C) f        if A_i=A_leave then send to die; j' f1 z  F: C; V6 V- q
        else inc A_i by 1
$ m" ^5 {5 z; m5 C* }+ N% A' a    end% Z  O3 }5 a; z! _  P' y+ q, j3 d' d
end
' h6 F: m8 {5 z  Z! r6 ?7 a8 u# d, |) U8 @( c, ^8 R
begin P_pick3 arriving) Z+ |$ C& ]4 k
    set A_i to 21
% V6 r8 J4 A8 z    move into Q_induct3" n( e; ~5 _  `9 l. N/ N
    move into pickaisle.induct3
. B$ E6 r6 H$ r    while A_i<=30 do begin
2 M+ N: u8 J/ t, d        travel to pickaisle.con(A_i)
) C" S* O5 I! u  g/ }7 l/ G% j$ ?' s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& t5 S- r& x8 `+ Y2 n9 y* M        else wait for 10 sec
# [8 {" {& A! X( H        if A_i=A_leave then send to die
: t& G  G1 Y4 e        else inc A_i by 1
1 p3 ?4 h% R' e" v' j! C    end  F0 j& v* V. t) j4 W- l
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是个什么东东?
# e1 z/ C& W  ~! H- E1 L  q7 V8 omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 y; I& {) H, L' Q. {' {
4 H- L6 ]% a+ ?' pAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) ]) f* ^, X: |) h% f. ^
/ P, y# Y: Q0 b# n8 u9 v% H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 W  B9 ]0 \# ?& u. J0 M! k. V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. k. u1 K* Z) n+ D1 V% d+ p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 p1 S; n: J$ v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: X% Z7 W0 e, a, X1 b! U& r9 Zbegin P_induction arriving% B& p& B" j+ w1 s+ c
    clone 1 load to P_pick(A_induct)
3 @3 K4 l1 z1 m9 J7 ?: N& ~end最大的系
2 S/ q$ E; ^+ O4 R
" v1 o! ]7 S, M. g( wbegin P_pick arriving8 f; O9 B+ `2 Z9 b6 j% A
    set A_i to procindex * 10 + 16 g- [7 p& A9 n' t- ]
    move into Q_induct(procindex)# |) D& Z  k8 S3 V0 _8 L) g
    move into pickaisle.induct(procindex)
+ W9 ~; Z* \* {3 u2 C    /*check the type of pickaisle.induct(i), for your last problem.*/
6 {3 z# Q; z8 u# u$ G4 q
. b% G5 D" N$ H/ I    while A_i<=30 do begin
+ z4 K" U8 i" E# I1 @. K- E        travel to pickaisle.con(A_i)
7 e* o; @, H5 f: r: g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ `% o' d3 S9 u1 t2 M( J        else wait for 10 sec: H! b3 x; X9 j& s: p* i8 h
        if A_i=A_leave then send to die
% U' L; t1 j$ N) O/ i2 Z6 v        else inc A_i by 1( a' B! e) R+ r* |
    end9 \6 S: u! ?, \' s! p* l# _5 d
end
; S( l1 w$ q  V! z8 T. K: Y! U! P9 {* o$ e: i
其中的procindex为整形,代表当前process的序号。3 d* |' w4 G+ ^# I9 D
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-5-10 22:53 , Processed in 1.892436 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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