设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15163|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! h# Y+ n' J! F% z; H7 ]/ S; r  P) ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: J  e5 a  j" K: b; m% O3 o1 A: a& d0 K' D5 r3 f+ K7 L! q& Q
begin P_read arriving
) @2 r% E( r1 x$ b- M" Y    while 1=1 do begin
  J& f$ n6 a' L5 U        read A_tote from "data.txt" with delimiter "\n") b$ ^; K& v& d% }  f! `) m
        read A_time from "data.txt" with delimiter "\n"
) D! h: W$ k/ M1 v7 x        read A_leave from "data.txt" with delimiter "\n"- {" C0 t7 A) j+ D2 f4 T1 c2 u% y8 G
        read A_picks from "data.txt" with delimiter "\n"
) ]3 F% o( I" I& X5 a) h- l4 K        set load type to A_tote
& [8 w& S- A0 \" s2 A: A5 i( m        if A_tote="tote 1" then set A_induct to 1/ D$ g" I1 e% q' ]( z/ @
        else if A_tote="tote 2" then set A_induct to 2
8 v2 A/ f: e0 k/ y' v6 w, ^6 _            else set A_induct to 3    # ?7 m; `, _2 C2 _, {1 q
        set A_i to 04 @  [1 ^& g* ]* Q7 B6 u
        clone 1 load to P_induction( [1 L+ m1 U9 v' s$ }$ {. c
        wait for A_time sec
6 [4 H: R% m, W# M3 e  j    end
1 \! C) q  a9 a5 c4 f! J; W  Vend
$ k: T1 E1 j7 M  |) X; }$ Y
, [1 i3 X. c/ m; u4 m7 Zbegin P_induction arriving
5 j2 G0 k' r' }( I    if A_induct=1 then clone 1 load to P_pick1
1 f) n: ~$ k. \4 d    else if A_induct=2 then clone 1 load to P_pick2
. r+ m% |/ I/ w3 Q3 v9 o        else clone 1 load to P_pick3
7 `) `1 K9 t0 S; N8 x. E* Z  B8 mend$ e/ O! ]! f1 P* R) d
% c$ q! O" _6 k0 c, [3 d1 w7 ?
begin P_pick1 arriving
3 a3 k/ x# F1 J! a  S; C    set A_i to 1
9 f4 F" i9 a' }$ \) T$ V, }    move into Q_induct1
' c5 {$ N3 z% d& r1 W    move into pickaisle.induct1. S* y  i0 `( T+ b" q6 J
    while A_i<=30 do begin
0 f8 I& x7 F. ^        travel to pickaisle.con(A_i)
0 S- x! V! x4 U8 m  N% }, }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 v7 f% ?# g" U+ D$ l
        else wait for 10 sec
% {, W0 D  s3 z- U! o4 g2 ]1 u        if A_i=A_leave then send to die
$ N/ k( m# [, l( v7 [: I) U        else inc A_i by 1
5 \) |- a9 \& L: D% R    end8 x* G( i3 \3 D# f- h/ j) b* A5 Q
end; K; E) a( D! m  z
3 L  d8 m, |; R: L  Z
begin P_pick2 arriving+ y' z- M" t  u1 _  Z8 `
    set A_i to 119 _/ z' K+ y- j+ G" k
    move into Q_induct2% r% }/ e* f! T. U5 v: |- E
    move into pickaisle.induct2
/ E$ A6 t5 L/ y$ Z; j" G0 w    while A_i<=30 do begin. n- `5 p; \0 B$ ]( p; |
        travel to pickaisle.con(A_i)( l7 d, p% O. L* C7 W0 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# A. t8 K, G6 m' a) N1 _# a
        else wait for 10 sec
4 h) [+ q: C5 l0 n" L        if A_i=A_leave then send to die
4 W4 w/ f7 i& j9 F/ E, r        else inc A_i by 1
+ M4 ]5 Q# J; x, ~    end7 ~" z3 s' e- ?; s" y
end/ s. \4 c* }' _
  S9 z7 N" \5 \/ `: Q
begin P_pick3 arriving$ {! ?4 ?; u+ B: y
    set A_i to 21) t2 o) c. i  _7 e6 ^3 t
    move into Q_induct3# C* h' S9 j  R
    move into pickaisle.induct34 @4 f8 w2 |( B. `- f1 d
    while A_i<=30 do begin. b- J! C# j' a) m+ t
        travel to pickaisle.con(A_i)5 X4 Y" g) [/ H4 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: U, c& t- Q1 ]- L6 j9 e        else wait for 10 sec
& z1 s) l$ F) B- p+ l7 V$ y5 y) ]        if A_i=A_leave then send to die
/ n$ N4 L) H; R) ~1 O; k        else inc A_i by 1
$ V3 }3 C% ~# T* N8 z' I, \2 Z3 t    end
. |6 P/ r7 i4 {& J) U& V+ g- nend

最佳答案

查看完整内容

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是个什么东东?3 G4 D, }6 R# h8 \+ w, L  M* ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" S+ }1 q' A2 {5 M0 s" c+ l9 t: G% m/ e9 \5 ^
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 t9 P* M/ ^% T) J0 v3 ?+ r8 M
7 u. j. x" \0 s- P7 L4 x
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- v" }: s" d7 }. A1 P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& |& g' A- K$ y1 |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 \9 ~) g7 G& ], J3 P0 \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: z% F& y; o% b) q) F( }begin P_induction arriving
4 C4 N0 S- ~% F& o5 I/ |: j9 W: t    clone 1 load to P_pick(A_induct)
2 z5 j) P( E: Q, b( Hend最大的系% u2 A4 x# Y+ H

" s9 a" P+ R4 vbegin P_pick arriving+ m9 M; ?8 |& Y, }, u5 F
    set A_i to procindex * 10 + 1
3 p( g3 h2 j1 ]+ U9 u# f! |. ^7 h4 T0 X    move into Q_induct(procindex)
6 @1 A8 P- `: p2 p    move into pickaisle.induct(procindex)
) o! a( Q* G: z# D6 Z3 p+ E    /*check the type of pickaisle.induct(i), for your last problem.*/
/ p9 C9 _! }( A: C7 b+ w" B+ o# d- X# ^6 k2 ]% Z0 [+ Z
    while A_i<=30 do begin0 S+ ]8 E9 N1 x5 P6 _
        travel to pickaisle.con(A_i)
, {. w7 E, Z/ _  k9 F+ h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! f- h2 v/ F) D% ?        else wait for 10 sec
" }; d8 f) A; c, F" d2 u& E        if A_i=A_leave then send to die
0 a1 O- C6 z3 B, |1 d3 g/ \        else inc A_i by 18 r& F7 N3 l7 `+ Y
    end
2 N+ u. F3 |& jend
( b9 R" t% L9 n
, R$ T, Q7 k) d- p: E* _其中的procindex为整形,代表当前process的序号。2 o+ u0 Q" S: @! 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-8-17 21:11 , Processed in 0.019311 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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