设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11653|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  G/ C" e  {- u) b% h, l( V* U- M
# [: L6 ]. f9 R) J我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  p) ^; U4 H* U! R* B1 g- B/ [- J8 ]
begin P_read arriving
- g( O" \* F& V/ [7 O    while 1=1 do begin5 ?) i1 J. \; B$ l7 Z8 O% M- A. y( ?
        read A_tote from "data.txt" with delimiter "\n"0 h! g) P* d1 m! P' _
        read A_time from "data.txt" with delimiter "\n"
9 G5 i9 E; g$ s  ^7 g$ n( n        read A_leave from "data.txt" with delimiter "\n"
" j; d4 n: P& ?# K7 f2 {+ s, |        read A_picks from "data.txt" with delimiter "\n"% r0 L/ I! ?) ]- D7 N. n
        set load type to A_tote
! {5 @, s, E) o: g" V        if A_tote="tote 1" then set A_induct to 1, ?3 c- R; E4 @+ Q8 n* r
        else if A_tote="tote 2" then set A_induct to 24 f) o4 Y$ {3 m6 }
            else set A_induct to 3   
; u( ~& y2 q4 q  z( \        set A_i to 0
9 u  B$ G7 v- {, q$ w- t1 D- |6 w1 w        clone 1 load to P_induction
7 F8 C5 S! F/ Y# W% e7 ]3 I% p        wait for A_time sec
0 e' a9 G6 _# \% ?2 o; I5 m' X# p) A    end
/ m/ W# R) P5 S" Uend
) G, p8 L: u9 H+ l( `) I9 N
6 @, e" z, s$ N. ^" d& T. I( W, Nbegin P_induction arriving/ X% f+ Q+ S4 a, @. R3 H: [& d
    if A_induct=1 then clone 1 load to P_pick1
4 V8 y9 U9 `" }9 p& d% y2 W$ L9 c& O    else if A_induct=2 then clone 1 load to P_pick2
+ }) _- r5 n7 H! ]" r. C        else clone 1 load to P_pick3
' Q) c, j. `" |* Q& |# Dend# M/ o1 M/ N) b

* V' z+ ~9 ^3 P$ E6 c3 Nbegin P_pick1 arriving1 b6 m! b4 n/ x9 I; R" V5 E% D
    set A_i to 1* r1 p; O0 c' `7 C! ]. }- l
    move into Q_induct1
: q7 U  ~( m/ c. l7 {    move into pickaisle.induct1; s/ l, X9 t' s" U$ n
    while A_i<=30 do begin. f" r0 }4 l* W/ v" U2 s: O" k0 e0 Y
        travel to pickaisle.con(A_i). \7 r/ U5 t% i# c5 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  B0 o( N* `* r. Z$ g5 G3 v
        else wait for 10 sec
0 Q3 u, O2 P1 \& r* |        if A_i=A_leave then send to die+ d$ O# p; B) p1 w4 k
        else inc A_i by 1) F) I* a$ ]  t3 Z/ t: k( l1 K
    end
6 i. {6 Q/ M# d4 [3 e2 Aend" I2 J* S, V. o( N6 ]( V4 Z. m! `4 i( M

. Z$ d) s! K1 {begin P_pick2 arriving; f8 s( m. v6 B1 e3 z0 \
    set A_i to 11
# E4 S; Y; g  k8 W    move into Q_induct2
. v" x% g! q. F" @! c    move into pickaisle.induct2' d9 _% {. P2 ~
    while A_i<=30 do begin' C7 B( i2 ?4 i& P/ T' {4 Z
        travel to pickaisle.con(A_i)5 T7 c6 H3 m4 @" E4 B+ l- P% o8 [( J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 F, V7 Y! d2 S2 C. X        else wait for 10 sec
+ w6 e0 _/ F4 z7 z& B( C        if A_i=A_leave then send to die
  ?9 y+ f! ^+ j- V! {1 Z' _9 y' @% e        else inc A_i by 1
0 U7 X2 D; e2 {( t$ `9 I% n    end
8 K6 }" Q. {0 B: W7 _end' N3 o; K, S; R* U
" C5 T' `' Z% B4 r! a: n. _
begin P_pick3 arriving. }- O: y! X3 `  E
    set A_i to 21
9 L6 \  Z0 E+ s6 E    move into Q_induct3& O2 h. R0 F- V' V4 B
    move into pickaisle.induct3- n4 C" U, Z& ?. x4 r8 Y
    while A_i<=30 do begin  K. ]& F7 z( ?) F
        travel to pickaisle.con(A_i)
0 h6 @0 p1 A3 Z) ~3 Q0 m. E  j9 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* M+ e4 W8 A, _) B        else wait for 10 sec
6 y- q) @0 T+ j0 A: r2 {$ V        if A_i=A_leave then send to die
% b5 F/ `! A' w* O        else inc A_i by 11 X; k, P8 D+ M$ @5 }; A
    end4 T% x' ]. \. x/ [
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是个什么东东?
0 f2 a* U7 T8 f: Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 V: G& V9 u3 l# s8 L$ N. Y" v2 B/ \9 |# Q  u1 f) i7 z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 }. [9 O+ o% ~4 q$ p" e$ s9 `/ I% v3 h! v: ?6 H7 @! r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: N  Q. F7 o. L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. n- V% y- Q+ n2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' y3 ]0 t3 ^5 N( N7 O4 X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 t$ t$ c: h9 J) {8 Pbegin P_induction arriving* ]- O" M, _0 `* V4 `' e
    clone 1 load to P_pick(A_induct)
* l4 ?4 x2 i9 F0 eend最大的系0 B3 }( @5 [0 A' X/ A, n

1 H: Q8 P# f7 ~  w7 c8 xbegin P_pick arriving
2 s6 ]4 K  D$ D9 ~! L    set A_i to procindex * 10 + 1
9 f0 w! Z5 h! ^) @0 z    move into Q_induct(procindex)
8 o+ w- X1 \+ h5 h    move into pickaisle.induct(procindex)& t4 s& r- S! _
    /*check the type of pickaisle.induct(i), for your last problem.*/+ V, U4 z4 G0 X3 E

* U. z* R3 i2 B$ H+ `% A    while A_i<=30 do begin
7 r  a. o8 t, ^: }  j        travel to pickaisle.con(A_i)- F3 X6 y* n+ Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# q! k$ J8 F" }9 z3 n4 F! u
        else wait for 10 sec+ U( E" Y2 Z) _) I8 K
        if A_i=A_leave then send to die+ K/ Z( G6 K+ n2 E* V0 g) e
        else inc A_i by 1
( s4 y) E; E" q* P. {    end: I! b  H( Q0 D4 E9 O' X3 N6 _
end8 w6 G) y0 r0 f* q
" z# A" z4 a4 S, R$ [2 g; ]
其中的procindex为整形,代表当前process的序号。9 n* n4 z1 N) o, {+ Y8 R$ O
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, 2025-11-25 22:56 , Processed in 0.018008 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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