设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13166|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( v, {# h9 \% M4 |" Q( V0 B" h4 ^
) }& ~  \8 _; u7 L我的问题是,在每个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中的数值,不知道会不会有什么不妥。! {# r' t" i; ^# c  U7 F$ Y
3 m: ]% j# i$ F2 v# t
begin P_read arriving
# a  m. t5 f9 K; k0 Y3 |    while 1=1 do begin# R$ o& D1 b4 k( f2 V8 j
        read A_tote from "data.txt" with delimiter "\n"+ @! r8 e3 q& k) Q5 L& U) J
        read A_time from "data.txt" with delimiter "\n"
& a5 C" ^) S: \  P7 ^+ S1 s( W' h5 O        read A_leave from "data.txt" with delimiter "\n"8 _# T8 j$ H) @1 X( R; P- e
        read A_picks from "data.txt" with delimiter "\n"/ c, r& N9 Q. z! Y/ C; `. p
        set load type to A_tote& o" h/ ]: G' p* F' |- W& M+ K
        if A_tote="tote 1" then set A_induct to 1- ?7 J: k& i8 m/ Q
        else if A_tote="tote 2" then set A_induct to 2
$ ~- w0 n! U& \) U+ d; H5 v            else set A_induct to 3    5 I% ~. L9 l* b. t  ~
        set A_i to 0, _0 `0 @* j* {$ l3 S3 s
        clone 1 load to P_induction* _9 H# C) M9 f( E5 l- n6 m
        wait for A_time sec6 c  n. H" D. i. o4 p* R! g. n
    end
; \- Y, y+ O& w  g  M5 Uend
& R5 x' }, F9 G- o' a0 V
& T) T  M4 r/ R4 A/ }, ibegin P_induction arriving) h, L9 d" L8 [
    if A_induct=1 then clone 1 load to P_pick16 O. r, _7 w% p$ E4 S3 b
    else if A_induct=2 then clone 1 load to P_pick2
7 p, q! h/ v) a/ ^& p. U        else clone 1 load to P_pick37 E% e) s  G0 K
end
6 y: C$ f6 p/ l
# E& e: {9 K4 Gbegin P_pick1 arriving' @. C! T& z# ]2 a+ f; S7 q
    set A_i to 1% m' M! V4 A9 h8 k3 {
    move into Q_induct1
: Y) t& w6 N2 o1 V, A9 H  ?    move into pickaisle.induct1
' N6 C$ e, x# i& b+ y7 K    while A_i<=30 do begin, F- I( I1 c  Y2 u  o1 @8 x. d
        travel to pickaisle.con(A_i)' n6 ^# q+ ~; u# |$ P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" ^6 a! d! l' Y; R        else wait for 10 sec
$ Q7 [( y1 w5 \$ ?5 K, _/ y' C        if A_i=A_leave then send to die4 e2 m; X( Q: l) {1 C: {3 z
        else inc A_i by 1
8 ^5 b6 ^0 z5 e$ w* d3 ^, V    end  L+ W* {8 C/ z& K6 ?! ]
end
! O- r  f  i0 W7 f" [1 z
$ m8 S7 \8 d1 ~* c, A5 y6 fbegin P_pick2 arriving
7 F' @  ~, Z" B5 J0 H5 o+ B    set A_i to 11
4 r  |$ ]0 H5 f: H7 b$ @, g3 {    move into Q_induct2' R. |! d" N' U$ F7 d8 j. d
    move into pickaisle.induct2* D2 D, G  J: f4 o" |6 O7 _
    while A_i<=30 do begin
8 }- s5 D3 Z+ T        travel to pickaisle.con(A_i)
+ x, D8 ]6 U" y' R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ D; A4 {2 Z/ E# E        else wait for 10 sec
! A& ~  D0 H' V, E0 H: m, o        if A_i=A_leave then send to die1 o0 f2 E7 |8 S7 @
        else inc A_i by 1+ Y( E3 Q5 {; S
    end: ?5 N9 r6 W* G5 `% u( Z
end
' F: J7 ]6 |' w- }! y6 k: e) V* w3 [1 B" B  C# R
begin P_pick3 arriving0 N8 S* {! a4 _  W" |
    set A_i to 21) L9 r2 A9 J7 t! Q" x
    move into Q_induct3
2 q. B) i" x+ e. J) q* J2 W$ p    move into pickaisle.induct3
* C! z9 ~, k3 e2 `0 Z! d* i! y    while A_i<=30 do begin+ ?! Y+ i8 d3 \8 p" G" [( h
        travel to pickaisle.con(A_i)7 E5 W. d9 t2 ^0 S- D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) [3 p5 \0 R. h0 Y' Q$ j1 ?
        else wait for 10 sec
- Q* {6 s. j+ c        if A_i=A_leave then send to die
9 ?" b- M. p5 v0 z# g        else inc A_i by 18 p. B4 U( [. {$ b- t
    end
- z) H+ N6 N/ [0 W6 n9 e" ]% K/ s$ ?7 O$ ~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是个什么东东?
4 V) v8 V( n+ n+ g  lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 D9 ?9 I# b7 v0 y

  ~; O6 E  g- N- {AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! r" d% q7 m- C1 d- v

' [( ]( A" K3 ~# J1 f, P6 J另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; b! j; A7 ?" u9 J' i  z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" F9 v: P: A- Y6 P2 A# H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% d4 c+ w2 n8 E9 o6 ~, B
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ f0 e% r" i9 Z2 |) U+ }) y+ }$ `
begin P_induction arriving5 D& U$ H! d3 v4 C  y' `$ O
    clone 1 load to P_pick(A_induct)
6 J6 Z7 ?% d8 s  Z. {5 |/ ]" dend最大的系
, i9 X  c  B5 V4 i* q: m9 R) l
" E! P0 X) ?3 G* Y- ^  }begin P_pick arriving
0 o/ }/ l2 g) C    set A_i to procindex * 10 + 1
2 I  n' X1 i. i9 B( S3 _2 |) [2 [    move into Q_induct(procindex)4 D" F9 }  q( c3 [# G" f
    move into pickaisle.induct(procindex)  j) E1 ?3 G+ X
    /*check the type of pickaisle.induct(i), for your last problem.*/6 P; q  F1 c  J2 m% a  h1 W' D* ~
3 C) K4 J- b4 m! g! o
    while A_i<=30 do begin
( t6 f; n( t" i3 A0 }1 R9 V2 y        travel to pickaisle.con(A_i)
7 o: G; ^2 ^. h2 J9 R+ X0 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: D. a" H: w1 H8 D- k- P2 J# q" ]! g        else wait for 10 sec+ T" k4 T! t" ?8 X( P
        if A_i=A_leave then send to die
* j# V! c2 [$ h6 e" a        else inc A_i by 1. O1 t* y! {6 p( |& W$ _
    end
5 U. ?7 n. G$ Q7 B: lend0 Q9 v* w/ k: g: w
; n' h# p8 K& _1 f  L$ r" `4 K, E
其中的procindex为整形,代表当前process的序号。
  Q1 N7 O0 G1 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-3-23 13:53 , Processed in 0.017769 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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