设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12665|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) `& h: S2 z  e" l
  B1 e: W; w& o; N3 F8 V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 x" F% @1 r: a& d/ ?0 |3 g- g! o
begin P_read arriving
/ J8 n0 H% g1 r7 w' Q    while 1=1 do begin5 S9 Y0 m2 s- n% ~. P. }
        read A_tote from "data.txt" with delimiter "\n"2 }& s( [7 x+ e" v
        read A_time from "data.txt" with delimiter "\n"
) j$ b9 U( w6 r: f. z        read A_leave from "data.txt" with delimiter "\n"
$ ~2 r, A  \  s8 r2 x: A        read A_picks from "data.txt" with delimiter "\n"
! Y1 w2 R/ v+ h: O* \        set load type to A_tote$ D1 Z! O2 X- \4 N. u: W
        if A_tote="tote 1" then set A_induct to 1
% h+ k' q# A! {) q) P. x  A  d        else if A_tote="tote 2" then set A_induct to 23 m7 S* d6 o4 W' U
            else set A_induct to 3   
) F( k; @  n4 C' A; }/ ^        set A_i to 0' ^4 }8 O! @0 M: D1 E
        clone 1 load to P_induction8 y' J* Q: F0 l$ ]
        wait for A_time sec" g9 E; `3 t) b
    end
; h0 b3 `: P, {7 l9 g' xend" x1 R0 E9 @9 i0 h6 M. G

+ C; g* I% q6 B, ?3 Obegin P_induction arriving- [' J6 K1 y, U1 P3 S6 q2 y- m  j
    if A_induct=1 then clone 1 load to P_pick1
0 H. i% c6 w; ?5 J$ }" \$ i    else if A_induct=2 then clone 1 load to P_pick2" y) ?0 ^: E7 g. G
        else clone 1 load to P_pick3
, `- b- V0 |1 \1 Q; [% J) P0 T- ~6 M) yend
2 Z8 S% i" W- X2 v0 h% ?0 s5 L6 e) R; F2 i8 g5 ]
begin P_pick1 arriving
1 D/ Q7 Z1 R2 |# [) D    set A_i to 1
9 h/ f6 K* o1 j2 e$ ~    move into Q_induct1
. F. ]. A( A8 _    move into pickaisle.induct1$ M& V( K! R- F6 O; [. O8 `
    while A_i<=30 do begin) j( ?/ }" m" Q7 L' y" {
        travel to pickaisle.con(A_i)0 L" p2 k3 V' y7 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" s% p/ J% s/ `8 {0 z
        else wait for 10 sec( r8 s! J( J6 v! Y) {% C
        if A_i=A_leave then send to die- N  a  v& D% N
        else inc A_i by 1- A" [, x/ N5 O/ N8 }1 g8 O
    end
% s" V9 q5 ?$ m: P9 send" w* ~% B/ F. w9 d/ @
7 I4 U  `% E& p% L
begin P_pick2 arriving
* v: k: `; @. s3 f- K8 m! J& U    set A_i to 11
0 S; R; t1 |, x" w* \* Y    move into Q_induct21 l/ m" l  d( y# |# d
    move into pickaisle.induct2
$ p- U  K5 g% F: Q* D    while A_i<=30 do begin8 y+ ?& c' z, |5 g) j
        travel to pickaisle.con(A_i)
% q$ c7 c1 M- U5 h0 i. P  y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ [  }. X1 Q5 p9 x( y
        else wait for 10 sec: \, `0 ~7 t* f: m1 |- ~
        if A_i=A_leave then send to die
& ^2 T8 g5 w8 N4 J2 q( [0 g/ q; r        else inc A_i by 1  ?3 z/ w9 c7 w2 n# B# `
    end$ {0 x5 i7 O6 I% z9 a3 G0 T
end  z5 ^, P9 u& N, d) R- U( A
. K/ q+ Z& c! d  z2 x6 W: Y
begin P_pick3 arriving8 b; L* t$ p. y& A- @- b8 W7 e
    set A_i to 21
& L7 A) h7 c' u/ b- z& v6 p    move into Q_induct3
$ a, c. }) q8 s5 w; E' o    move into pickaisle.induct3" }! Y* v) R+ `' ~
    while A_i<=30 do begin; K2 Z! D& v+ h
        travel to pickaisle.con(A_i)) H3 K5 ~8 @8 b* W3 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' N: p6 n5 k& `$ n        else wait for 10 sec4 M, h# g, {3 A+ l6 w, q3 j" {
        if A_i=A_leave then send to die- V" l" U4 b" D9 u7 ?9 J7 U
        else inc A_i by 1
9 l, `5 o$ i( G2 f1 a9 m    end! h5 K1 O: `/ p" s  B
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是个什么东东?: |" x/ |2 k0 [( [0 E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 [5 v9 b2 t; D, |
. {; K1 z) w. C% l: r4 D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% l& A8 g( c+ _, N2 k: L

) z( i& k% B% w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ P2 U" h5 X4 H& ~7 l$ ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 H' Y1 c% Z, |6 s8 `7 N9 ~9 y/ ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 Y/ p' S1 y# f2 s# Y+ L# R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: B: j3 Z! [: z4 u0 Z% R2 Wbegin P_induction arriving- b! ^7 t! [, r8 L$ L
    clone 1 load to P_pick(A_induct)
9 H7 A0 a& e4 c$ m; oend最大的系
& G- G( x: g2 ]9 v! r" J1 n  W6 N. l) C, a) B. h0 b
begin P_pick arriving$ T9 A6 d; v9 `( `
    set A_i to procindex * 10 + 1
% h3 Y9 \! K* R/ i0 x! i    move into Q_induct(procindex)  n/ Y% u4 J& A- A. q% s* q3 [1 w
    move into pickaisle.induct(procindex)% n/ k. x' q* i0 z( Z. V8 E- C! g
    /*check the type of pickaisle.induct(i), for your last problem.*/
) }" Y3 n; F8 x9 u4 g* ^
: }+ ]2 P* w" C# h2 |- s4 s: N$ M    while A_i<=30 do begin
" l7 v  l( C7 q; S+ `# K        travel to pickaisle.con(A_i)
6 k0 ?3 r( R/ G9 s% x( W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 t) d7 D) }7 T        else wait for 10 sec' K; o' O2 e/ K/ s8 F# P+ M; V
        if A_i=A_leave then send to die
* E# g6 m5 L* T$ A# p) y        else inc A_i by 1& X7 C& f0 @( f
    end# _, Q$ S  Z2 [
end
3 |7 P/ _2 S8 z; X* b* E
1 u& g" w; \/ J6 V2 M其中的procindex为整形,代表当前process的序号。* ^/ \' F/ [- \" N" Y  m9 w
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-2-9 11:21 , Processed in 0.015780 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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