设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15156|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 o7 h: p% @* \5 p
" Q( v( q  ^/ s5 b! e; C' c# e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! t, w$ ], T+ b! l6 N8 B/ a! f8 p3 e: m1 w1 Y5 e
begin P_read arriving: ^1 j" n! P5 ~% ]( x* |% D
    while 1=1 do begin
9 z- f* F0 s* a7 u" }) }        read A_tote from "data.txt" with delimiter "\n"" L9 L/ Y% i9 h4 X6 a0 F" }* l# X
        read A_time from "data.txt" with delimiter "\n"3 O. v6 H; N, @# V- c5 Y
        read A_leave from "data.txt" with delimiter "\n"
4 u1 b) \; x( N$ M. h; z        read A_picks from "data.txt" with delimiter "\n"
, u/ D! N+ X) |: I" v# E6 h        set load type to A_tote
7 z9 x! Q4 M+ i* f        if A_tote="tote 1" then set A_induct to 1
4 Z) P/ Z! D. k* f' v( P# B- `        else if A_tote="tote 2" then set A_induct to 2
7 ?2 e9 L( V) B7 b+ n; j/ }            else set A_induct to 3      e+ {  f- b7 l) w
        set A_i to 0
% @2 G1 r( u2 ^0 L( m$ w  J        clone 1 load to P_induction3 M) f3 P! c$ e/ v2 s
        wait for A_time sec- i3 [3 u) y% m( ?4 \8 t
    end& O6 |# a# A' ]: o" @; S+ y
end4 E  l, k2 b9 u; S; m, G+ J& V
7 \  a# s+ H1 y* M; X( o
begin P_induction arriving4 l3 o. c1 Y: h* {
    if A_induct=1 then clone 1 load to P_pick1  [4 w# \9 z* O- y* K- U8 }
    else if A_induct=2 then clone 1 load to P_pick2
( g8 Y7 q% o  r/ l6 G7 c# ^        else clone 1 load to P_pick3) r$ B, n% _- C+ e6 l" ?9 \
end
, V4 o$ ]1 o" R3 C0 y* ~0 l. w+ \! C0 p7 y: d6 N8 O
begin P_pick1 arriving# e+ a, k1 x1 ~
    set A_i to 1& W4 w8 v$ W8 M5 v1 c3 F+ |
    move into Q_induct1* _! U! ^1 ^# I% I2 E" a" W& w! A
    move into pickaisle.induct1
5 [( b4 ^- `: C2 X$ t    while A_i<=30 do begin) m) v& h" v1 W
        travel to pickaisle.con(A_i)% C4 O6 O+ H; c( N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 ^$ @$ @2 E6 J- U! o2 E. J- \! s        else wait for 10 sec
# Y5 j2 p# W' E        if A_i=A_leave then send to die' D  D- V4 ]3 q1 h) v
        else inc A_i by 1# {" n* f, t& W* G$ K2 z
    end# T( a7 a7 m1 f- d  Q
end
, M: P) D! B- U7 e7 S  L. }
1 X4 U$ p- o4 D. d/ [5 h+ |  E. Jbegin P_pick2 arriving
4 h- E0 M0 p: P  w3 {    set A_i to 11
( ~. G$ Z/ X: d  f3 D8 f+ L& o& u! a9 u    move into Q_induct2
3 d9 l+ v- n/ d, i    move into pickaisle.induct2& m7 D- k4 O9 \
    while A_i<=30 do begin3 V3 B& g% W( h
        travel to pickaisle.con(A_i)
/ a9 A8 G: J1 r, P9 |* F( X$ E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# `5 u9 {6 s3 `/ k- d        else wait for 10 sec1 ?/ M- S/ Q9 s
        if A_i=A_leave then send to die- v. g1 ^0 Y: _: Z- q$ u  P
        else inc A_i by 1
! ?3 M+ Q& b1 r- R  }; G8 x    end
# R2 o( m4 Y6 s$ H# Z8 ?end
: C. l& R  E6 C/ F0 p* c4 g# ~% h* F5 w5 p# ]
begin P_pick3 arriving; E) Y1 k" B1 B' Q' M) `( J2 E
    set A_i to 216 V9 U) E4 I$ z5 ?  K. T% M
    move into Q_induct3
" Z/ z/ t/ W% g3 J' P9 l    move into pickaisle.induct3
6 S& M, `4 S9 M" n    while A_i<=30 do begin' P; ^7 a0 P9 [: j# g& P
        travel to pickaisle.con(A_i)
/ l/ X$ w9 }' I# Q4 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! I" |$ S+ D( M6 s# A5 K* C
        else wait for 10 sec
$ K( u# L  P# r# L5 |9 R        if A_i=A_leave then send to die
* V# q# R7 V7 F' ]/ G/ u) [        else inc A_i by 13 g2 i7 X' g- o! ?" I: |! n
    end
7 _4 |8 P( N* I' J& x$ z) [9 O9 t  {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是个什么东东?
$ C4 q# w5 S7 U. L5 A- v8 \6 T% zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. L+ J* G( ~1 w

) b) t+ A# @. {AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; v) m: s% z) b; J& T
1 I$ `4 z( O, ^, m+ r- D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 d& v$ g% g3 j' [1 ]4 `) M$ Z' I
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; {  ~  z* k5 _4 I8 a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. O  o: c0 E/ s# `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- }4 ?7 D0 ^2 Z0 Q8 t5 [
begin P_induction arriving
# R6 J# a9 ]: }( D7 R    clone 1 load to P_pick(A_induct)
5 Z" k  R4 N! d: B% Y* @end最大的系
) e5 Q' g/ J+ D! ]* R0 @/ f1 O7 B) \" V' ~
begin P_pick arriving
1 Z) W, R9 r; V5 Y0 O0 r    set A_i to procindex * 10 + 1
* X& |+ Q% W- x: T, [/ U1 k    move into Q_induct(procindex)
; c! z+ c7 o5 Q2 Y6 j    move into pickaisle.induct(procindex)
2 I$ _2 a6 Z& R, p) L+ M3 j5 B    /*check the type of pickaisle.induct(i), for your last problem.*/
3 Q) c$ |7 `" e4 `% d0 }9 j0 D6 R1 j$ {' h
    while A_i<=30 do begin; `! V4 P3 Y. x
        travel to pickaisle.con(A_i)
2 @7 _$ }" o! x1 Q) X& ?+ h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ \; n( y, X( f4 |8 V9 ?) i1 L        else wait for 10 sec
3 Y8 b! @6 W# j+ m- r  Y        if A_i=A_leave then send to die
* J1 p5 E3 K5 n4 Y& M& l1 [        else inc A_i by 1
1 u5 A5 X8 y0 Q    end
! ~" |8 j, r0 @: F. R3 {  Lend/ a& N7 I: p! C* v& D! v# v
& Y4 l: T! I4 h1 S  N4 K. n. `3 x
其中的procindex为整形,代表当前process的序号。8 F: J: V6 E+ w! U
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-8-16 19:52 , Processed in 0.023069 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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