设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13031|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" q# {' Y+ P' _; y! f
# b: A6 h/ J; s, b/ b+ K; m我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 d3 M0 R, o- }) u. @3 M1 v

, ]7 r* W! C6 A' V+ j/ nbegin P_read arriving) p& D: ^4 A- e4 _$ D$ G7 O7 h
    while 1=1 do begin
; U) D6 \8 A' J# x, T0 K        read A_tote from "data.txt" with delimiter "\n"2 H) O, B& l; W0 P* R7 o: v: o
        read A_time from "data.txt" with delimiter "\n"
: a, X& D; g1 _! }- c6 c  z        read A_leave from "data.txt" with delimiter "\n"3 R- w2 d- Q5 K! o8 P* b$ w
        read A_picks from "data.txt" with delimiter "\n"
9 x& O' \4 q! H9 O  M        set load type to A_tote2 \6 J' f: U& U. M! W  q: ]4 H6 t
        if A_tote="tote 1" then set A_induct to 1
6 \6 K3 `$ ^6 v/ a/ g7 S( _* Q        else if A_tote="tote 2" then set A_induct to 2# @0 u: ^9 U; o6 f7 Z
            else set A_induct to 3    3 ?  \7 z5 e/ N  S
        set A_i to 0
& F# f9 p1 W: J2 V        clone 1 load to P_induction# V1 U; `) H% D
        wait for A_time sec4 ]) x( |3 n4 P. k3 e* o) x
    end5 E) r6 i! R8 \5 g2 R( c
end6 H) _# b+ ~8 o, o  H

; y$ r( k1 z3 z2 {: @begin P_induction arriving
: H8 m- _. [1 z6 ^4 u1 ?0 N    if A_induct=1 then clone 1 load to P_pick1
; x1 T4 |4 G  o5 _    else if A_induct=2 then clone 1 load to P_pick2+ ~, {$ S. U8 p3 F; m: s6 X
        else clone 1 load to P_pick3- `' j2 t7 w! H9 `! V( L) v# V) V
end5 i3 k. g6 d+ @4 e# g

1 [4 a) j# \4 L; V) W" vbegin P_pick1 arriving$ U% \) h! P! ?7 W
    set A_i to 1
: x% @" y0 B  P  V* ]% ~; |$ b    move into Q_induct1
. O3 F* L5 x% N    move into pickaisle.induct1, J3 D% b* R2 ]- G0 @( Z
    while A_i<=30 do begin4 M1 f0 v! T" I. V& D2 G
        travel to pickaisle.con(A_i)
8 o! h. o6 U2 [! s$ [" r; L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" R  U2 h7 Y2 J
        else wait for 10 sec3 E' x: M" H3 W& Y. l: j
        if A_i=A_leave then send to die- ^, I# P+ {% H( m* x* d- R- @' I6 l
        else inc A_i by 18 {) V4 Z, _* Q/ l; k" f
    end7 J3 h! ^* e0 f+ z
end3 N  f+ s% D0 E' w! z( ~
# H7 h1 }2 \" N8 l4 J
begin P_pick2 arriving
  m% z- c' d+ F5 W' y  G( d9 I$ \    set A_i to 11
* y( d2 Y3 h4 B1 Y) F/ Q! ^    move into Q_induct2& ?+ x/ J3 {+ g9 t8 V! ?# i$ U2 G
    move into pickaisle.induct2
. n; Y* c  e" w6 T( p# d1 r    while A_i<=30 do begin
7 P+ t. Q% M9 \1 v( d$ m% ?1 I4 L        travel to pickaisle.con(A_i)
( N' `) g2 B* J% s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 S" K5 b, e5 |; @4 l% h( T        else wait for 10 sec1 ?4 ?( }2 ^+ a: x' a. q; q
        if A_i=A_leave then send to die
& f7 K6 P! a, D& P  y        else inc A_i by 1
& ]2 o5 y$ S% r1 K8 G& _    end
" i2 n( U4 i1 [5 c& E; ~end
! R/ ?  l! \" n/ `6 j* z9 ]/ W, [/ |2 W9 H! q
begin P_pick3 arriving
' L. ]7 x$ P6 Q6 P: G    set A_i to 21
( h. S: k% y, m. Z2 i    move into Q_induct3
# I! ~$ \3 S" M1 _+ z    move into pickaisle.induct3
* P/ d+ \2 B# a1 s    while A_i<=30 do begin7 Z7 n5 K6 F, t0 B8 x
        travel to pickaisle.con(A_i)
) P1 c: A: u: n7 e/ s) m4 `$ S/ ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 g# l% ]0 N5 P2 G" J8 X9 C# R
        else wait for 10 sec
/ d% x' x' f4 u0 E/ g) _        if A_i=A_leave then send to die
' t1 `, e3 ^  r$ }        else inc A_i by 1
& i7 {# T$ n9 f* h6 E    end
# v1 l3 r* S- ?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是个什么东东?
1 j- W& p5 E4 f! Umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ _4 c. ~( O4 ^2 ~, {& y

6 ~7 h, a& e. Z- \5 Q" FAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" |( A# E/ f% \9 k7 M; r( y" b

4 w. H6 e8 f! X' j- i  Y& G( x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: _7 Q+ s) a' E" D% D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ W- A2 i! A4 ]2 r* d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ ?1 w: j) R0 K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 \, c. o+ L5 k" m- j# p8 @: x$ B
begin P_induction arriving
  u4 R% T" e5 G4 P5 O) t2 t    clone 1 load to P_pick(A_induct)4 ?- l/ M$ @6 p
end最大的系
# @5 n2 R/ Q5 G; B9 w2 g( D# E5 d5 z" u
begin P_pick arriving6 j" ?& N1 R; I' O  V# p
    set A_i to procindex * 10 + 1( m9 m6 Y* A. I" M* x  Y8 T5 n
    move into Q_induct(procindex)
1 M: G: c$ G  f9 ~& ^$ |- k3 J    move into pickaisle.induct(procindex)
. }& Y, ?- [1 G) V    /*check the type of pickaisle.induct(i), for your last problem.*/( V+ D5 Q5 t: M0 n7 r
. A. N* ~0 U8 ]/ {( o$ }* w
    while A_i<=30 do begin
, E9 k  k" J! f- P        travel to pickaisle.con(A_i)
; B2 v$ y: M9 H5 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) n* a& d) V/ {        else wait for 10 sec7 H/ d0 p7 l; v( ^
        if A_i=A_leave then send to die2 F2 e6 J/ v5 k* q0 u
        else inc A_i by 1
. v7 d  s+ c5 a/ E! j: {    end
0 T# q$ r- N% ^8 Zend
4 \' v' O$ P" j- h! v) K- s, z
& O0 @( {/ i2 w& B其中的procindex为整形,代表当前process的序号。1 z* e" {# d9 J9 _8 G! |$ I6 x
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-12 15:14 , Processed in 0.017148 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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