设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12262|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: a6 G- a/ h0 I" e5 X3 E6 o5 S; Z! j/ u6 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. F+ F( S2 I* p6 v
5 Z/ r1 o5 J+ ?& u9 V& q" K( Lbegin P_read arriving
3 v3 Q$ I; f6 e# }    while 1=1 do begin  P  X0 c# _7 r& F
        read A_tote from "data.txt" with delimiter "\n"
; _" j& M! U- a3 R        read A_time from "data.txt" with delimiter "\n"# Z& X5 t# n% s5 P& l$ ^5 J$ q
        read A_leave from "data.txt" with delimiter "\n"
" s8 M- }: u- h4 s+ G6 u3 H& F        read A_picks from "data.txt" with delimiter "\n"* o2 y( ^0 ~  c9 }  x  {& j( P
        set load type to A_tote
) z1 Z0 b! j' r6 ]  |: B2 [        if A_tote="tote 1" then set A_induct to 1
* C! P8 m. A/ n! ]; ?" h5 `2 k        else if A_tote="tote 2" then set A_induct to 2! \6 ], w* l9 ^" m
            else set A_induct to 3   
, ^& w# a' N6 X+ J        set A_i to 0. ^6 Q& W8 `" R0 s, d
        clone 1 load to P_induction( _( |( @3 g9 T! u+ S
        wait for A_time sec, u/ }# R  }' E
    end
" Y; Z" y8 P7 f2 ]- w' bend
; B3 n! b0 {- ]- ^. g+ m0 c
- @# }" r$ M" o4 ?- v& Gbegin P_induction arriving- I* w9 D2 [* F9 N
    if A_induct=1 then clone 1 load to P_pick1
, |9 }: z0 \/ U( N: D+ R$ _' D7 o    else if A_induct=2 then clone 1 load to P_pick2
6 H1 j# A' v3 G& b# u, j& j        else clone 1 load to P_pick3' p1 \# \- W8 ^: w
end
1 x% n- a4 e, V1 `+ U) d; Y; j* q5 R7 K3 d
begin P_pick1 arriving  r0 J$ \5 Y$ h; Z0 `" b) S% d
    set A_i to 1, }3 {* y0 \; \+ k# T3 F
    move into Q_induct17 S5 T! ~" u5 f4 B6 \. w8 V
    move into pickaisle.induct1! v) U& |9 }1 c' r) u, s* ^
    while A_i<=30 do begin! Z- s9 G6 D; D% Q. m! C7 g* i
        travel to pickaisle.con(A_i)
* ]/ ~8 B1 D! y* T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. `! y# }6 z& E7 B  }7 U        else wait for 10 sec
; ?: V* [; r5 y" E6 i$ {6 M        if A_i=A_leave then send to die
6 i( W- B: z8 M, |/ r2 [8 z7 `* G9 `7 q        else inc A_i by 1
. A: R- i, O2 d# o8 b    end
" M" ~# l. x* [/ `8 yend% ]( a8 c! H) U1 R8 y
; H9 ]7 D5 f! K! [
begin P_pick2 arriving+ z! y7 j+ v, k# k( y% K
    set A_i to 11
& S. H, _2 ~1 M, c3 \* t1 R0 {    move into Q_induct2
8 P1 L& r, R4 U1 ^1 @8 L    move into pickaisle.induct2
( |/ h1 H% Y4 A. W, _$ @    while A_i<=30 do begin, ^0 U" m" v/ A! H; L1 L9 {0 C
        travel to pickaisle.con(A_i)
5 L  w+ ?, n+ d% u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. ^6 X. b0 Y8 {) s" E
        else wait for 10 sec! f6 o+ q: w( E8 K3 m
        if A_i=A_leave then send to die
, Q1 c- ^4 {( d4 b8 Z9 k6 ~        else inc A_i by 1  C) D# E4 A. I: i4 p, f
    end4 N+ k4 k0 F. _1 W
end
2 p& I! h$ j( j' }
' P! |3 H( @+ E( [* A+ b. s5 Hbegin P_pick3 arriving7 p; m# m1 ]3 T3 O. ^! X
    set A_i to 21+ U" y5 R+ c' E$ v! S: ^
    move into Q_induct3
+ M$ }  @2 {+ I4 t/ u' F; t' v+ I. c    move into pickaisle.induct3) o: x$ n9 I5 c
    while A_i<=30 do begin
+ T. f. W9 Z( X$ T. [4 {        travel to pickaisle.con(A_i)' y5 k! d* j1 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ]$ s' i+ [* Z, q- c) R
        else wait for 10 sec) [$ q& w* F4 s7 l, i* S
        if A_i=A_leave then send to die
0 V  t( }+ r1 B1 l8 p" m. A6 v        else inc A_i by 1
6 `- U5 }  R9 G3 B% Z    end
0 `5 r0 S' m! e1 y6 K; N& e8 gend

最佳答案

查看完整内容

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 d% a. u; `/ q2 {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- F* ^" I& l0 P6 j( l# ^% d. X

" j' _1 k% {3 x1 t, X0 jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. n4 O) t3 O3 e! `( }# V5 f6 `. ?+ |/ ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, ~7 e: _1 K/ f3 v3 Y' o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( q) J4 U! y, w# L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 ?1 E8 G) I. A( p; W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* `0 T5 t. v. Obegin P_induction arriving/ E6 D" F5 x6 G" V8 b
    clone 1 load to P_pick(A_induct)
; i9 \3 y* j* m! Z3 ]- V# b, aend最大的系
+ B8 I# ^5 ^8 k6 o( ?5 |2 x! {+ y4 N! n' i, k" f7 A
begin P_pick arriving
0 ?0 C* `8 z% h; y    set A_i to procindex * 10 + 1
5 j! g0 g$ l6 G& p- B  }- W2 X    move into Q_induct(procindex)
& B) y# b* g" ]    move into pickaisle.induct(procindex)
7 ]  ~" z9 G& V5 n8 P    /*check the type of pickaisle.induct(i), for your last problem.*/
& B. M2 @. T% B
3 H+ B- w+ a6 \2 t: k1 h  E) Z    while A_i<=30 do begin
# W$ J* u5 A. e2 O. h7 x        travel to pickaisle.con(A_i)
% M, _( X4 r' `$ g, I. C( D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% r9 o# i$ r* J" r: k( M/ j        else wait for 10 sec; a. N0 t* @5 P8 M. d' ]  O
        if A_i=A_leave then send to die
& v% f3 J8 d3 L& P  g8 c% }9 n3 ]        else inc A_i by 1# B* ^" M8 g* i+ J/ Z4 Q
    end
" Y$ E0 z  D! Wend7 Q7 a$ f8 I( v% }: B+ I- Q

+ m% N; f1 t2 D1 @( R: v其中的procindex为整形,代表当前process的序号。
: }/ o( z/ R% S0 A4 C! e! r% \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-1-9 04:26 , Processed in 0.014491 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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