设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13816|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 M. q4 ^. ]) n, F1 B
- ^' e0 ^6 k! W我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 m9 k9 Q$ Q5 b3 g: ~# U, j- o

( q2 X& \" ^8 F" Z+ M% Gbegin P_read arriving
+ i1 X! D# [: I  y    while 1=1 do begin) k! I* b/ S7 H0 s
        read A_tote from "data.txt" with delimiter "\n"/ s3 S) p) }, n4 p
        read A_time from "data.txt" with delimiter "\n"
0 g, S- i" h- g' Z        read A_leave from "data.txt" with delimiter "\n"
6 _) x' X1 b7 Q7 a5 m- W        read A_picks from "data.txt" with delimiter "\n"
5 s) t: j# c( F, y9 U/ r! m: U8 c        set load type to A_tote6 _, L& L! r  ~
        if A_tote="tote 1" then set A_induct to 1% w0 w% w- ]5 x+ E
        else if A_tote="tote 2" then set A_induct to 2
% Y) i8 ~* Q6 [! O* T+ h7 I            else set A_induct to 3    ; E8 q% w& s" _1 B% Y
        set A_i to 0
! T$ v6 D8 O  s, K# n7 v        clone 1 load to P_induction
' x9 F" {; ^; h! s4 ?" u        wait for A_time sec: \; v9 W5 B' y2 E
    end% a+ N* q( }: F8 {# f
end
) h6 s* B2 N' @$ G* R( v, S; ?( N5 X. o) I: M3 G: W0 t- Y% ~
begin P_induction arriving7 D' C0 y  T8 a8 [. X: c" b$ \! l
    if A_induct=1 then clone 1 load to P_pick1
. U* A8 u, `* F    else if A_induct=2 then clone 1 load to P_pick2
- G9 u3 Q# K# j; g( o: ~" Z        else clone 1 load to P_pick3. U2 H+ o. v' p7 `8 K& A& B5 u6 j8 q- j
end
0 @# `5 d2 Y% b
, W1 \! w: G' p1 Wbegin P_pick1 arriving' M" o  d- A2 E2 O. e: l' \: y
    set A_i to 1
0 m( v+ u/ v* \5 ?7 X; ~% k7 M( }! y    move into Q_induct1
8 E& o' r& L1 g9 A    move into pickaisle.induct10 [& m& \- |" o; @) j, S3 _% e$ @
    while A_i<=30 do begin
0 x9 u, p/ @3 Z        travel to pickaisle.con(A_i)9 k! N* F$ B1 J9 H, ]) p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ^; P4 a; a+ ?9 b* {$ i+ F' M' y        else wait for 10 sec, Q( @8 x! m5 j3 \$ c
        if A_i=A_leave then send to die
- @. r# b! X) P" [        else inc A_i by 1$ n$ S) ?9 W$ Q( G! Z' k" v8 {
    end
  H) X' |+ h. C. tend
/ M4 i0 E0 [6 h" G( P/ E! |0 U
2 T5 P/ I4 ?  n1 U3 G0 y( Dbegin P_pick2 arriving2 N' |( {8 o5 q. P- s! b
    set A_i to 11; e) A5 F4 a3 ^" v2 U
    move into Q_induct23 ?5 F. z7 C0 e- n. `. ]. O
    move into pickaisle.induct2# T* {0 R9 s5 o7 x& x1 F- j! p
    while A_i<=30 do begin' ]* S2 W9 M4 i8 V" B
        travel to pickaisle.con(A_i)* m" t" s% j; G. u; @$ D1 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 p5 I* f. `+ Y8 b& j9 Y        else wait for 10 sec
7 F5 }( c- L) V$ h        if A_i=A_leave then send to die/ U, L) c2 {( L: C
        else inc A_i by 1% r, O7 ^: }! y! R& V! `  Z: E8 ]
    end
$ @# p" G  H3 e8 y2 t3 ^: S+ `end/ q% @! g6 J/ C/ T6 z4 f: v

8 i# {" L1 ]" n: Abegin P_pick3 arriving
( ^! Q; B* y# |# C    set A_i to 216 C3 V8 l' [* Z$ r# U" l
    move into Q_induct3
% ~+ X% @, U6 C$ ^' C. O5 Z, l    move into pickaisle.induct3
. \. u# Q8 d4 h: r% \2 b$ l    while A_i<=30 do begin
! P" p) O6 n( f" [# p        travel to pickaisle.con(A_i)
' J/ ^" K0 G- L5 p# E& x* }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 {9 e$ m: _% w9 B% E$ p5 h2 m% F        else wait for 10 sec* B! x  A7 H% y5 x' W; g' v
        if A_i=A_leave then send to die( x4 }9 O! C; g3 b
        else inc A_i by 1
5 R2 m& h2 N, t. j, \    end( B; N2 M4 R" F$ r/ {* g
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是个什么东东?) Z% V% @+ h6 A& v3 q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( Q6 C% w% i( I" q6 t

" ?) l$ ]/ \2 `' OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& Q; N4 ~* |! c3 \
* q$ j; R. X8 z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 d6 h$ p3 w  V: G4 Q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; n. B5 f" i, U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! b, f& a0 j* N% A$ }# w3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; D  w1 w/ m+ l1 w" F; u) zbegin P_induction arriving
- W, X! G5 u$ H5 F    clone 1 load to P_pick(A_induct)
- @3 D9 ^! E: V2 e9 [end最大的系
1 S# Y4 T' R$ G( d
& ?0 }) Y! P3 H8 |. M5 Tbegin P_pick arriving
: A- j# |* m6 `  {3 w! K2 o' e: J; \    set A_i to procindex * 10 + 1! Y/ Z9 @3 R) O- n  d! F$ d
    move into Q_induct(procindex)0 p9 y4 z* A  ?6 A  C  v
    move into pickaisle.induct(procindex)5 p0 B8 _$ c& h5 E+ l
    /*check the type of pickaisle.induct(i), for your last problem.*/
) L  G' A2 [. H/ {' v) M! p4 U. B$ a( c. c  O
    while A_i<=30 do begin6 l- ^5 G( _4 l8 b7 }
        travel to pickaisle.con(A_i)' N  ]& K* H7 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 _+ N3 @- i5 Z) u% x        else wait for 10 sec% T: g9 J9 P* |1 C2 \$ n/ q- f
        if A_i=A_leave then send to die5 T: t, F9 w$ ?% J% J3 {' z
        else inc A_i by 1# L, A$ N- e) Q8 j4 `
    end4 M* Z0 z* Q# `
end
7 J7 Y& n( {1 B  w* F9 }  d  F
: J: S9 `; \5 C8 x! x0 F6 M其中的procindex为整形,代表当前process的序号。: g0 a, f6 q% J
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-5-7 16:24 , Processed in 0.016313 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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