设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14838|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 S! }- Z1 Z8 A( K% @9 J  m: v

- `/ u. }% x  Q$ F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* s5 \3 h( t8 l4 [" D
- j( X! R: }( ~6 ~; xbegin P_read arriving
; ^5 U/ o/ d( `8 d( \    while 1=1 do begin
( e8 I" Z9 U: ?' z        read A_tote from "data.txt" with delimiter "\n"
( [! Q. B, F* n2 S4 P. L4 \        read A_time from "data.txt" with delimiter "\n"
4 {+ L8 p' z% L! F3 ]        read A_leave from "data.txt" with delimiter "\n"
# d0 ~5 d4 l5 p' e+ W! |' |$ I        read A_picks from "data.txt" with delimiter "\n"- ~* N0 H. f0 m' |: _3 F
        set load type to A_tote
( Q( X0 E3 i$ |: w- F: ~$ z        if A_tote="tote 1" then set A_induct to 1
6 z/ X! o' n! x4 r7 C4 T6 k$ i        else if A_tote="tote 2" then set A_induct to 2, U3 t8 P0 B& |  A: b7 {
            else set A_induct to 3      B, l: z& e7 p3 h( i# i
        set A_i to 0
0 m2 Z2 V# j; l8 A7 _- s        clone 1 load to P_induction  p8 ^$ Z5 R( s; O+ M
        wait for A_time sec4 [  i# E0 `; l$ H  A
    end
6 a* l( u' ~% d4 xend
1 O+ I  |& c1 ]6 ^" m4 m1 w. e) w9 Y2 z6 G" W+ v1 j
begin P_induction arriving4 q; J+ x, K' j) Z& @& |
    if A_induct=1 then clone 1 load to P_pick1
) U: [8 c: O1 y    else if A_induct=2 then clone 1 load to P_pick29 S. x% ]1 S+ r7 u
        else clone 1 load to P_pick3
# N) c1 R+ d/ k: K2 B3 ~$ c) N6 ~' bend( b) U1 [0 m8 G* c5 B5 Q0 _7 R

: w& ?: k- c6 _8 q) U0 Ibegin P_pick1 arriving
' o: ^8 f$ s! S1 X    set A_i to 19 L6 ^% |0 n4 T1 I8 g7 n" {5 E4 D; e
    move into Q_induct1" V" A( h) W4 W# f: h
    move into pickaisle.induct1
' `4 y$ J" m4 _. }* F, q; E# g    while A_i<=30 do begin
9 L) I1 K% h; s) O! k8 x6 N) F        travel to pickaisle.con(A_i)* v+ @6 s9 p6 i$ r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! U8 Z# D! s) X3 R* i% r! [
        else wait for 10 sec
) y; u% B5 e/ J( D/ O        if A_i=A_leave then send to die' Y: ?$ R. k" F8 d
        else inc A_i by 1
3 ?$ P& `6 }; v% h* _# _0 A: l    end( r2 C: D8 |; w: l
end9 l9 H8 f+ n0 q  q3 _0 f4 }8 D1 W
, ]4 Z2 f8 y+ r7 j( d+ t
begin P_pick2 arriving2 J6 b% v& ~6 S* X! \, y- d4 T
    set A_i to 11) G+ P$ I( r8 t) U6 E/ n
    move into Q_induct2
0 S5 @# _2 q" d$ B    move into pickaisle.induct2
( k( l& w9 ^0 u/ w$ e    while A_i<=30 do begin& {7 d$ B( S# k. b1 e6 L
        travel to pickaisle.con(A_i)2 A/ y; D8 P2 u( F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 M8 M" ?$ E/ q' K& \& I' P0 x. R        else wait for 10 sec9 P4 K% W" p& c+ Y* M
        if A_i=A_leave then send to die
4 K4 |1 L5 o" R( c: S        else inc A_i by 13 Z/ Y/ y4 T( y$ |
    end
% b1 C+ b: k5 s. e  |end' G/ G/ `3 F. s1 g: s
5 |+ b0 c  p5 S  ^- f3 D! K: G
begin P_pick3 arriving
0 Y) `3 y% c9 S. |& K    set A_i to 21
  G6 V6 Q* c  `( L    move into Q_induct3
* `6 Q6 T  Q8 b: s. J    move into pickaisle.induct3
) f6 r# W7 e! p6 `% p    while A_i<=30 do begin+ U# j5 [" [7 `6 T- i7 r$ O
        travel to pickaisle.con(A_i)
4 t1 _: g  r1 i% P( _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Q4 I- c  i/ }8 o
        else wait for 10 sec
3 ]$ O0 l7 j8 V! h        if A_i=A_leave then send to die" `3 V4 t: ]& x  M+ q2 r
        else inc A_i by 1
$ i" g8 L) z' S( r- ~    end6 a# Z& D, w1 R" A/ {* b, f: o
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是个什么东东?
" M- R  C# ^0 Z8 z# y  M6 Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- a) t0 r" h, @) Z4 i2 b
) X9 S& d1 R' x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 S6 d' c: p6 ?. Z1 a
% q1 l, [0 j: c& B+ b. K: w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 J6 I5 S, n: r$ s! A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' C2 R+ z7 `! W, z# |; }9 n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& w: q. z' S3 U. w4 p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 i/ r" |6 E% B0 J0 l
begin P_induction arriving" l1 c! v  j- |  z6 V- M( p) {- B
    clone 1 load to P_pick(A_induct)
2 V" ^! f0 y& W& send最大的系: y+ p8 {/ ]* `% g. c0 h

: [% X& {# D2 Z  E5 _$ [3 Tbegin P_pick arriving7 {* R8 o9 W  c1 Y7 \
    set A_i to procindex * 10 + 1
0 z7 {5 C7 n! W) r3 K    move into Q_induct(procindex)# w# a% j# R9 J9 O+ l
    move into pickaisle.induct(procindex)
1 X: G$ \% ^6 ]) B4 E    /*check the type of pickaisle.induct(i), for your last problem.*/
9 u* J  V" a/ w" A7 B
3 c- Y4 o1 s( m9 d    while A_i<=30 do begin8 u5 H: s- ^7 U
        travel to pickaisle.con(A_i)* D" A* i& y8 |8 H( r5 l/ H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 X+ N; {3 w% A3 W. S        else wait for 10 sec
" z1 p: u; N2 S7 o) L* f        if A_i=A_leave then send to die" I( ?# G/ @3 x. M' [, v7 {
        else inc A_i by 1. S  E2 J7 b2 C8 w: _0 T/ W
    end; p: O) m4 a& n9 n6 W0 g  q* e
end
# s6 f  a' l; d/ e; ~- y4 V
( k! y, R8 a' K! G% u其中的procindex为整形,代表当前process的序号。$ @  m/ N$ m# A
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-7-28 21:00 , Processed in 0.044489 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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