设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13843|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 u0 x7 ]0 R; F# f$ ], [% m* ^7 y* F. G; s0 x( l. D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& U/ X+ a( Y; ~6 s" |* \' o- _0 m& V
! h9 M2 s& V1 h2 @$ Ibegin P_read arriving
8 z) L3 w7 K8 e1 k" w    while 1=1 do begin
5 Z2 }& U5 @- x        read A_tote from "data.txt" with delimiter "\n"
6 ^# y, {8 o6 t- `: }        read A_time from "data.txt" with delimiter "\n"
+ ~5 U5 i* l% d4 A        read A_leave from "data.txt" with delimiter "\n"
, a( F8 {3 s$ {' N- v        read A_picks from "data.txt" with delimiter "\n"" r' h1 Y% j% U: M- l
        set load type to A_tote1 A  ~# f6 a1 [: W
        if A_tote="tote 1" then set A_induct to 1
* Z& e5 m# [) `% X5 q% w        else if A_tote="tote 2" then set A_induct to 2
$ M5 Q: F( y5 R            else set A_induct to 3   
4 v: P0 x# K: P0 s1 r        set A_i to 0
) m0 F" N+ o& v. D$ f2 g        clone 1 load to P_induction
, L# d+ a( w7 ?+ @) ^        wait for A_time sec$ r" n& {7 @3 f1 |
    end
; L  |% B. y! Jend
+ w7 D: g/ V" O
( z5 J: n# [8 o! r$ Xbegin P_induction arriving  C' \8 \) O' g1 f- C' J8 T! k
    if A_induct=1 then clone 1 load to P_pick12 K  s. N+ c  z& N7 [  T' Z
    else if A_induct=2 then clone 1 load to P_pick2
% i$ n$ l% ?$ p        else clone 1 load to P_pick3
( b2 r- t; _, j; R4 H; {: K& Aend
  b2 r5 m* L/ U3 N! o" I+ }, R5 Q; X
begin P_pick1 arriving$ m; Q; f0 E( x
    set A_i to 1
' a. Q+ w9 k7 D1 U" f9 f    move into Q_induct1* o6 ^: `( l7 m3 |7 p  Q* e
    move into pickaisle.induct1% R) b; Q1 S# Y7 N  ?" ]  X
    while A_i<=30 do begin; R5 v4 x* ]& |0 n+ j: p/ k% e
        travel to pickaisle.con(A_i)
/ z( C* S! U% Z$ A% W1 h2 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" j. \* m/ a# X7 }, |
        else wait for 10 sec
) s  \$ M) d0 M1 F  ?        if A_i=A_leave then send to die
3 q) x" R' `% [& v* T1 o        else inc A_i by 17 {, k  x/ v" [/ |1 x6 b' R
    end: ~, `3 W# E% |7 Q6 |$ y/ G  t
end* i0 b- V3 J; O

9 }# D# J$ o2 W  D  l+ y6 W% Jbegin P_pick2 arriving
: ~2 c/ C% X9 p( }  r9 j8 f: W    set A_i to 119 c, y8 l+ \2 L' r" L
    move into Q_induct2" A9 [# m2 Y9 T2 _5 j/ O. J/ D* z
    move into pickaisle.induct2
* e. x$ f5 w1 ]+ z; [    while A_i<=30 do begin3 P( x) {8 D+ {; I3 t1 @7 _
        travel to pickaisle.con(A_i)7 u  N1 N) V% y+ [2 r; h7 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ^$ U7 {- S" j% q) p, e% @0 @
        else wait for 10 sec: z, `3 D$ [. D% ]: x; V0 M
        if A_i=A_leave then send to die" o! R+ C* E( k
        else inc A_i by 1
) b  y2 U( r! F" }; _) J    end
* |" e+ O1 c. d; P% Jend: T5 \) l" c3 u7 Y4 T0 B+ e& S

5 o- s6 N3 {- M8 z' u) d7 {begin P_pick3 arriving  s: K. k9 ?. K$ n
    set A_i to 21" M! R4 K2 O. N/ G
    move into Q_induct3( M1 z$ k2 n5 m. i6 {
    move into pickaisle.induct3
: H" j0 E! w) h% u  e! m    while A_i<=30 do begin
, b# j# i' l( ^1 C) x        travel to pickaisle.con(A_i)4 {$ I8 f% B3 ]& M& V5 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" O. p: Y2 A/ C9 v/ d
        else wait for 10 sec, \2 L8 |, {: M8 _" R( p
        if A_i=A_leave then send to die+ y6 b6 C8 i( H+ G3 w
        else inc A_i by 1. W% t/ p9 E0 Y& y1 {
    end
" q, N0 n3 b0 S% F! yend

最佳答案

查看完整内容

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是个什么东东?( d+ O: n* g- C$ _5 `& L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. I; U/ a1 r+ f6 O/ q" R& _% q5 R
8 W, p) K$ Z6 S- z6 e4 b# qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 H8 i) M5 O" y! s8 N+ ~8 ?# ?/ v8 ?+ \' S6 @3 W3 u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, F- f! O, \( M: ]" P& ^6 A3 H1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 Y3 M$ w( R9 K% M9 d( q3 b8 L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 o$ t  x, s# r% M& l; i, Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; {4 m1 p- d8 `1 p& G
begin P_induction arriving6 T8 V8 g0 ^! z. G9 g# u
    clone 1 load to P_pick(A_induct)
2 X+ X5 A7 h2 O; n( E" T% J2 l. W$ fend最大的系6 v- C' Z+ E4 ]  _7 s
1 X9 \1 S8 B  E" d6 F, k: L
begin P_pick arriving2 z1 `$ T4 I; i( ?/ x# ?6 `
    set A_i to procindex * 10 + 1% @8 P5 S2 ?4 @( U  A1 \9 K
    move into Q_induct(procindex)4 U/ O, Z% P! S* x
    move into pickaisle.induct(procindex)3 ?+ [2 l/ S! @- N- k. l
    /*check the type of pickaisle.induct(i), for your last problem.*/3 T; m' |3 @4 n7 @
8 B4 d" T3 b3 F6 N' Y/ a% K
    while A_i<=30 do begin
9 ^- X, t+ C" O        travel to pickaisle.con(A_i), [3 T7 P5 @( u) d; U- C, @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. F+ M- Y+ n3 h" `' w4 o3 [4 ]        else wait for 10 sec: l" [' s5 G. D) B1 L7 }
        if A_i=A_leave then send to die* c/ [1 [5 \5 L" Z4 Q  P: W( }4 }
        else inc A_i by 1
  Z, I! V8 z. q  `0 M    end
! \# o& a& E: f3 e9 zend
: G# I0 F2 {, x% R7 C1 o/ `# r8 z5 W3 a( w
其中的procindex为整形,代表当前process的序号。
7 y1 ~4 e- U6 y# E3 Wstation和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-11 22:55 , Processed in 0.018672 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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