设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14254|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 |* m4 U* _- p/ n8 R1 ?8 u
' E  k8 R8 l) @1 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中的数值,不知道会不会有什么不妥。3 N& C6 f, S& z2 g& `

# k) m, T9 z- _. E  l) d' h: H* `begin P_read arriving9 D; C' C% L  i9 ?9 S6 G) f
    while 1=1 do begin
' u+ [' D) l4 P        read A_tote from "data.txt" with delimiter "\n"8 u+ C. S. J8 J: R- o  n$ s6 E
        read A_time from "data.txt" with delimiter "\n"
/ `  n; ^. `, h% `: }        read A_leave from "data.txt" with delimiter "\n"
* w/ m" }5 g  a) |1 C/ g, v        read A_picks from "data.txt" with delimiter "\n", X% F8 `7 [* j0 N) K
        set load type to A_tote% w" J- I# \1 J9 B
        if A_tote="tote 1" then set A_induct to 17 ?" N7 z6 M% h; h5 P. b% S, v) b- k
        else if A_tote="tote 2" then set A_induct to 2
/ F/ |* W* Q$ Q0 U" i5 d9 s8 I( t4 P            else set A_induct to 3   
7 }0 w! i/ u% x( S* o8 [) L        set A_i to 06 E* B: u& O" a8 U* r# B/ S, }! t
        clone 1 load to P_induction: E/ ?! Y& A( ?) y
        wait for A_time sec
* j8 |, \' H7 t9 U& M, q    end
- @7 h0 S, Y0 Q1 S2 `: j' U2 H- tend
7 o6 o, o# a; r; w3 D* ]2 I/ N( Z1 N3 o" d# d
begin P_induction arriving
7 e. d! F0 m/ s2 ~    if A_induct=1 then clone 1 load to P_pick14 p1 l0 l! o: e! q4 r+ R
    else if A_induct=2 then clone 1 load to P_pick2
' B0 K$ t+ G+ n" F" B& I, ^        else clone 1 load to P_pick37 y' A" o8 F( f2 E. Q
end9 C, H7 D( d; B+ u

4 [6 E% m3 m7 t: A2 fbegin P_pick1 arriving/ o. o" `" f+ u- X
    set A_i to 1. n; I* r8 m6 ]
    move into Q_induct1
' P, B7 h; ?/ ~; B% q( F4 q$ ^; J    move into pickaisle.induct19 Y- o( q8 r4 t6 \6 i: z  P8 d
    while A_i<=30 do begin
1 c6 P' H/ [" O+ s7 H( n        travel to pickaisle.con(A_i)& q$ W7 f, H" u: t7 p: w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ q1 m0 W! d% A9 W( C0 c' }        else wait for 10 sec( p: P+ ~% M: c: q# l2 Y
        if A_i=A_leave then send to die
% i: T( U$ w: b1 A$ Y4 O        else inc A_i by 1
9 r. ^0 N/ c0 {* m& `/ j% P    end
! Q( r5 V" x1 M. t, P$ S* Yend  ^  t7 [$ [; K1 C# `' v
9 s4 w7 ]; Y8 v  q7 v
begin P_pick2 arriving
6 w3 @+ B% Q' ^. J- ~3 {0 C    set A_i to 11
) U( \2 \+ k9 e2 Z5 {2 T    move into Q_induct2
" p+ a5 m' T8 N% s2 k* w) ]    move into pickaisle.induct2
& [/ A! p! V+ S0 v. \  }* H2 v    while A_i<=30 do begin, z, Y  g1 F& f8 k$ r& ^% j( b- C
        travel to pickaisle.con(A_i)1 L, S. F. M0 x% }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: k. |1 s- X  D9 o5 r% S        else wait for 10 sec- C# V4 q4 u' }- `$ ?" `; ]
        if A_i=A_leave then send to die
3 s! J6 C! I. z3 K8 D5 D4 w        else inc A_i by 15 a" R# G6 q# s, g6 j& i! `+ Y
    end# [8 Q/ M8 ^! B, {4 f" K1 B# I
end
2 x) k/ `% v7 H: v+ P& l- W; v
2 G# a9 P$ F5 C4 f: d% I% }. Y7 Lbegin P_pick3 arriving
5 v! X" O- N+ a9 t    set A_i to 21
- I4 }$ f- Z, V* l) R0 P    move into Q_induct3+ u; l. y% ?4 Z7 h
    move into pickaisle.induct3
2 O! {" M: C. N+ C9 v    while A_i<=30 do begin
+ ?4 z* F8 a7 d) |        travel to pickaisle.con(A_i)
( i% I) K8 H% q; W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 t& L( F. ?# K4 v
        else wait for 10 sec! ~  p% ^! F/ z6 n9 D' I
        if A_i=A_leave then send to die
8 H# y' V- [, V/ B; W        else inc A_i by 1: P; T; K7 g1 D  |- y0 z
    end- e9 a7 h$ v: p; Y1 e
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是个什么东东?
: e- p" y' [! v, p0 x, p# |; lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( J7 E. R1 p- @! z: J: Z, z
8 ?- ]1 w2 \5 E; ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 G4 v5 Q" ^- {& m
0 x2 h7 l% _& N另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 f( u. R. \' s3 H1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- I0 `; o/ b  a& t5 `! m) k2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) T6 I, \/ n+ i  V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 p) x8 V! g/ t6 N+ J1 P/ K3 P
begin P_induction arriving
% g' g- x8 a, l/ w8 P; {# {0 n* d) m( J    clone 1 load to P_pick(A_induct)
; ~' t2 Q% [/ R# Nend最大的系5 e& Z7 X$ g; e

, U, A" Z' }+ w! Tbegin P_pick arriving6 k' l" r- q3 q4 N
    set A_i to procindex * 10 + 1
- b. A# r  i. z. o1 v    move into Q_induct(procindex)9 Q7 m' O% I/ ?$ f6 \- }
    move into pickaisle.induct(procindex)4 G( e- `3 \( I* S9 B" L9 a
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 G4 o, m( R4 A2 X5 m7 u8 N- A) [( D, g* D: M4 H
    while A_i<=30 do begin
9 Z8 y! n) z# h/ o6 {2 c! D        travel to pickaisle.con(A_i)
- [) j4 N& _& X% L/ A0 \# w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' O6 w1 N1 E: H! F
        else wait for 10 sec
( v9 Y- K* v5 {        if A_i=A_leave then send to die
0 L) Y6 {' M' x4 f1 }3 f: V' W        else inc A_i by 1
( L) x$ ~6 u* E7 z3 L9 }  v    end6 H1 i5 A! a# P- P' i
end
2 p9 U) o" B* a% O# ^% t
( L' U$ a& s3 r) B其中的procindex为整形,代表当前process的序号。
( s/ z, |: S2 dstation和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-6-25 00:56 , Processed in 0.021649 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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