设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12632|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, `6 a! z- p  a2 {

% q9 a. K# |: c3 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中的数值,不知道会不会有什么不妥。/ @" Y- u4 C' Y! _

) J/ g3 v; M+ z/ \begin P_read arriving
$ m$ z6 G# v7 C# g7 y6 ?8 e3 l    while 1=1 do begin% k! T3 ]  ^* R9 i
        read A_tote from "data.txt" with delimiter "\n"& }: W! l  B& p
        read A_time from "data.txt" with delimiter "\n"
5 y' b6 Z- |7 K, F$ w4 x3 b9 {        read A_leave from "data.txt" with delimiter "\n"
9 f9 m! E, S( g4 ~) W2 ~  U  M, O$ @        read A_picks from "data.txt" with delimiter "\n"
" a4 {) W7 |/ I' K6 p+ N        set load type to A_tote
1 q5 ^3 A1 ~: Y) ]# J        if A_tote="tote 1" then set A_induct to 1# `5 l5 u7 A7 X! M: g. Q; @0 ^3 U- L
        else if A_tote="tote 2" then set A_induct to 2  V9 A+ o# a" |
            else set A_induct to 3   
. B! v) N+ Z9 D' W( U1 Q/ l        set A_i to 0
$ }1 w7 ~+ Q5 a. ?$ p4 w* l6 x        clone 1 load to P_induction
/ L$ M1 _. Z7 R+ b        wait for A_time sec2 {6 L6 P4 W! H) f9 M$ f9 ~' T& E/ n2 |
    end2 ?6 ~' y2 s7 [5 W6 d
end6 F& j+ A3 v- }

9 k0 O/ b0 f$ x0 W0 {begin P_induction arriving
! `. r7 R2 Q5 W) k0 y- ]( r    if A_induct=1 then clone 1 load to P_pick1
, g( I9 ~, w9 |6 l1 m    else if A_induct=2 then clone 1 load to P_pick2" Z8 y, i( V& n; a0 m' D0 L
        else clone 1 load to P_pick39 |& ^, A  q* g4 T
end  {2 k- n  b  q  r# M$ p0 `
2 g5 N6 I( s& s0 }* i; Q
begin P_pick1 arriving' F8 F' k6 y& d0 \/ _. E. m% b
    set A_i to 17 p- Z* b% c) c- A3 k
    move into Q_induct1
+ @* e  R- y2 z: q6 c( ^# A' y    move into pickaisle.induct1  M) _; r0 |( k2 L# o
    while A_i<=30 do begin
  s9 V- l! x8 P$ h% p. t8 t        travel to pickaisle.con(A_i)! W7 F  E6 B* n8 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 W5 F! S- `* N# A" N( l
        else wait for 10 sec
: q5 M7 t( H" E) v6 r% I  J4 I; s        if A_i=A_leave then send to die; W. r! E  x: R
        else inc A_i by 1
& c6 `2 a# N3 V1 @% S! g    end
( c8 X, r4 N" \, Mend
# b! L) n! U$ T- p; u& ~& ^9 J: w/ O7 ?8 l6 r" z, ^" T* \- B, z
begin P_pick2 arriving: [' |: T  x1 e, ?; C
    set A_i to 11
! [- M0 _, o3 D: k6 c1 R- B( X    move into Q_induct21 O! M: l7 p/ s, f: l0 {1 E
    move into pickaisle.induct2
( S; B5 i+ C3 Y0 h3 `3 o    while A_i<=30 do begin
1 g/ f1 ~8 j& }+ j0 G, k5 d        travel to pickaisle.con(A_i)# `* S7 R% d% S7 K, R) R0 w* J, q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" O% J" Q' M, r" U! O        else wait for 10 sec" u" E& Y/ C0 `8 d( \) q; Y8 g
        if A_i=A_leave then send to die
! _2 e* S0 m: T1 l" q$ t        else inc A_i by 1
  G: s- x" a- [4 ?5 y: Z% U    end
; R2 ~; z  a, `: V- {4 t( bend) \8 ^8 v) A) S3 r3 ^
& z8 w6 S9 I- X' V& P
begin P_pick3 arriving# {  p6 e- t: J+ e; L0 P- r
    set A_i to 21
. \* ~  ?- X% I! k    move into Q_induct3. Z6 n. z5 j/ z/ Q; p7 T9 f
    move into pickaisle.induct3
# j4 f  T5 y$ c4 U) U) M1 Q9 d- f    while A_i<=30 do begin0 W& k$ a% x+ C. [7 u& w( M3 f
        travel to pickaisle.con(A_i)
: L; [1 ]4 l3 n- r& b: l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 L( ]0 x7 g0 g& t4 @: ~
        else wait for 10 sec
9 L  b# n; d" ?% L+ S+ ?4 a- B        if A_i=A_leave then send to die
6 W, m* o' {0 G  @        else inc A_i by 1/ I( z. e# w( g. e7 v3 N( [# e
    end
0 n% p# u% v) r& [1 Z6 `+ ~6 ]$ 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是个什么东东?* y4 q: e" E0 W( i2 R# Q% p0 e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  V( f! o1 ?5 n

0 F& q2 ]& H& G; S, hAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. n1 H, ]( f: |* N7 @4 q2 z5 ]( _

# \7 u1 z0 v9 a6 t8 B, ]0 Q2 |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' V) U, V7 {$ {- R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; @% D' \. r: V6 Z6 A6 J9 {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" l0 @+ w* Y) H0 f3 p' R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 O' ~7 f. B4 g: K& W( Gbegin P_induction arriving
+ O, E- }. A' I    clone 1 load to P_pick(A_induct)
! O: H5 H  {% v( _$ Vend最大的系
! M/ h9 Z, q# }3 u9 C0 B( N# `3 o5 P
0 |) N# u0 T9 g; _8 G# `begin P_pick arriving# F7 `, H8 u/ J+ {
    set A_i to procindex * 10 + 1  X7 n) {# [# M2 H- _
    move into Q_induct(procindex)
# g. a8 b+ A. j+ B5 k2 e$ C    move into pickaisle.induct(procindex). p3 F! @8 y. G
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 p5 j( D' w0 S# k" _3 ?2 b1 e& a/ W
    while A_i<=30 do begin7 K" A, j+ x+ H4 \6 x
        travel to pickaisle.con(A_i)
- n) w& V7 m2 m( y; L, i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, C% K; }+ x% ?. K; p
        else wait for 10 sec
, r8 s, w$ H; k& a6 \7 r* I5 l        if A_i=A_leave then send to die% b, r- _7 @$ N+ d8 E
        else inc A_i by 1+ ~' G0 x) Q, L
    end3 P; G6 A/ t7 G
end
# c$ b- I& |6 p, `3 q
9 d* B% p, c6 v. H+ ^! w' |其中的procindex为整形,代表当前process的序号。& z( {  e5 F! T1 Y0 e5 m
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-2-6 06:02 , Processed in 0.017487 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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