设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11200|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 k, G8 ?, `/ ]( y1 d' v8 v0 u# n' M0 M+ u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 W2 F4 O4 @# `& N+ y+ ~
. ]  e( J+ m& T* h
begin P_read arriving7 Z7 D; ]  _8 y' [% ]  f
    while 1=1 do begin$ N6 q! N* \  v7 K8 ]
        read A_tote from "data.txt" with delimiter "\n"0 v( Z; f& x, S0 j& k- @& o
        read A_time from "data.txt" with delimiter "\n"$ ^- s3 \4 v4 d. H5 l# j% C( Q
        read A_leave from "data.txt" with delimiter "\n"3 }$ Z6 U9 ~6 p  \7 _! R
        read A_picks from "data.txt" with delimiter "\n"0 {* H" O" U3 s/ p: z
        set load type to A_tote
; b5 ?9 S* F0 B$ k1 w! |6 R( d0 h        if A_tote="tote 1" then set A_induct to 1
$ S* f4 o) H+ x* Y/ T# T        else if A_tote="tote 2" then set A_induct to 29 A' ?6 E! ~1 _5 |( X  y( Z5 n5 O
            else set A_induct to 3   
0 ?3 ^( o4 P6 T' G& N        set A_i to 0
* G4 l) u" V! L        clone 1 load to P_induction
" L# Z& |5 q6 c, b0 Y) N+ a5 F        wait for A_time sec6 G, o5 \* Z+ N% p! A" H  Z8 F
    end
- T7 f+ k6 r. G) N  ?; h5 {end2 p7 \+ x' R+ m% H7 p# _; Y8 ]
( H+ a/ `1 b: `/ l3 E- y" j+ k
begin P_induction arriving
( S7 J3 E! ]: ?1 {  G" W    if A_induct=1 then clone 1 load to P_pick1
' N( m9 i" \' y6 J- h' X    else if A_induct=2 then clone 1 load to P_pick2* |; s$ `2 G: k6 U1 J
        else clone 1 load to P_pick3! p! H  G- @5 t' G0 Q! F& t1 R
end
; a' s2 T8 A( U7 A  q: D! z9 l+ f) W% v+ y7 N- Q
begin P_pick1 arriving
+ D" S. |' J5 f* m( b4 C1 _! _1 D/ o' T    set A_i to 1
6 V3 K1 y/ Y5 a4 d4 J    move into Q_induct1
, I: k% ^0 [- `" S    move into pickaisle.induct1
+ ]+ V1 c9 S; J6 J/ w( p8 r5 G4 G    while A_i<=30 do begin- M( B3 W% `+ }/ W% W
        travel to pickaisle.con(A_i)
- B) S- N+ U; I+ v/ i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( N: ?) z7 [+ [- Z# ]( {$ y
        else wait for 10 sec) G! `2 _3 s  X+ z6 n5 O$ r% v" N
        if A_i=A_leave then send to die
, X& [& |( L! P& P4 r$ A$ ?        else inc A_i by 17 g5 \& B! d  Y* H) q* [+ P5 V# h; q
    end# t7 v" {* a7 z% |4 Q
end
  h# a$ ]. ?# x1 Q; ~1 K- k
. Y: ^- V& m" Z' O& Sbegin P_pick2 arriving( f. {  `, M$ `+ e! `8 N% a
    set A_i to 11
* D* R3 s" K: {" l    move into Q_induct2  s- h. d4 k% N3 z
    move into pickaisle.induct2
( g5 N: w. N5 `% s/ V& s& b- ^# C    while A_i<=30 do begin
9 J% Q6 [# z1 S. a' ^+ F        travel to pickaisle.con(A_i)" J( [. x5 s0 f# o1 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ p; v/ }( a1 E/ N* ?4 L) O        else wait for 10 sec! V- d" I7 X/ P: F+ m
        if A_i=A_leave then send to die- e. `4 _; N0 k9 Z4 u9 v
        else inc A_i by 1. U7 R) n: @7 U) M& Z3 \
    end- L8 a* l" [; \7 \& [) V
end
1 u& ?6 W' N7 `+ b+ q# G! {' }* n+ D9 a
begin P_pick3 arriving
" q* }* ]# z1 ^: o  v$ K4 j    set A_i to 21- [, U* K# J: E/ k4 r
    move into Q_induct3
% D/ N& p, y" b3 p$ |    move into pickaisle.induct3
( r  w& z& k! z" M3 y4 X    while A_i<=30 do begin
3 H' o6 d. B8 \8 T7 h        travel to pickaisle.con(A_i)
) Y: r8 ^$ D9 y3 o8 s# p) V, k6 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' a9 B8 {! F4 O: l) |
        else wait for 10 sec1 H2 _5 `& Z  P& D
        if A_i=A_leave then send to die* e+ @: a% F* z# M2 r. S
        else inc A_i by 1( n! l+ i( n5 `9 A# q0 P: X
    end
" d$ n* J8 {9 A5 y9 l5 U" _6 N/ hend

最佳答案

查看完整内容

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是个什么东东?7 i* Y5 a9 q% Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ |' B4 L; B+ S
' C+ ~0 W; i- S, d3 p9 zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 N" b. p( K* E3 `8 P

# x3 X' D" t7 F  w; t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ x6 T5 _5 S0 I7 O6 M1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 R& |% n& O0 H4 X! {8 i" V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' |* R: j# @0 a/ f: m+ W9 a$ h
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) P, Y  @; A, F/ v: |- a
begin P_induction arriving
' V; d& K! D) |# D9 S: \7 m    clone 1 load to P_pick(A_induct)
( G2 y3 v$ r1 {. r- O, pend最大的系" c8 p- L8 r: }! o
# M. g. P; i# h6 I2 s, \- Y
begin P_pick arriving) o, j) |, I+ z; s
    set A_i to procindex * 10 + 11 X* z0 [" u9 i% J8 a
    move into Q_induct(procindex)' z- |3 V0 g; X& F) o
    move into pickaisle.induct(procindex)/ ^3 _& u1 p' P" }; E+ _: O$ A; K7 ~
    /*check the type of pickaisle.induct(i), for your last problem.*/7 O7 I/ H9 V- R7 ]
4 `+ _+ r- D0 X0 ~5 b8 q& u. z7 H
    while A_i<=30 do begin
: h1 x+ ?1 h2 k. a5 `+ Y7 I# ]9 Q/ T        travel to pickaisle.con(A_i)7 t8 Q% k, x& w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: h. R+ b/ B: B5 t  Q6 H9 U        else wait for 10 sec8 q& {2 A. ]* z$ }
        if A_i=A_leave then send to die
$ q/ a1 M! I5 b7 m        else inc A_i by 1
& {4 B4 P, P' a  m: l4 g& L% m    end
7 x; Y; m5 r! p2 P. z& c3 Xend+ i4 g5 A  l! g7 y# k

3 s. V* x7 I# t( E其中的procindex为整形,代表当前process的序号。
3 Q7 X  d7 N1 c% b( C+ 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, 2025-10-30 06:50 , Processed in 0.021017 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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