设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15469|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( b8 A8 Z% ?; i$ M

7 A1 s8 L; U1 {' I4 T% g$ E( }  y我的问题是,在每个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 G  X. p; ]' C
7 \3 m: v* L3 _begin P_read arriving
' |7 {' ^& ^! [) N& @( b1 l    while 1=1 do begin
8 ^8 n* ?  ~0 Q, i& h        read A_tote from "data.txt" with delimiter "\n"1 G( m4 x; @. M8 Y. d
        read A_time from "data.txt" with delimiter "\n"4 _( f% w% M) l
        read A_leave from "data.txt" with delimiter "\n"" Z4 H, u( ~5 G- @7 ]" j# F  N
        read A_picks from "data.txt" with delimiter "\n"
; `4 \* z! N0 D& _2 Q$ z        set load type to A_tote7 l! O8 h& N2 }4 E2 ^
        if A_tote="tote 1" then set A_induct to 16 y3 N" B! j% f! Z8 _: n
        else if A_tote="tote 2" then set A_induct to 2
8 X. w$ ~* N9 w2 i5 \            else set A_induct to 3    4 n+ w9 i9 t/ v
        set A_i to 0
) c$ W5 E' D8 |8 k& D( J        clone 1 load to P_induction
: x, x5 P1 m. G1 A/ G        wait for A_time sec1 Q" A3 _+ i" g" f, w
    end
! Y7 U6 p$ R- `3 o7 ~) o0 wend; w) P, }- `- U2 R2 y7 f

8 D: T9 z4 H. `& Y8 i( @begin P_induction arriving
9 e/ w  Y  T0 e1 |4 X    if A_induct=1 then clone 1 load to P_pick1, ?3 H, `2 ]" y0 C' E. H
    else if A_induct=2 then clone 1 load to P_pick2
* U, b  Z; l. b" K- F        else clone 1 load to P_pick3
7 u5 }* o! p; j7 D# @9 }end
, w! Y' a" ~, t" }) U% w9 S- E; A8 K4 Z$ T6 n- I1 `3 G
begin P_pick1 arriving
- @+ \% j1 A& v+ V1 |    set A_i to 1
( W  u3 V5 [) N% p    move into Q_induct1
5 F& z- Y5 \# g1 _$ E2 p    move into pickaisle.induct1
- V6 K) I0 |+ _8 R+ w" b    while A_i<=30 do begin
$ h1 ^0 m: @" {: F. s        travel to pickaisle.con(A_i)
7 H0 E: C, k, K) e. r" {2 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& Q% {" X" [% y" X        else wait for 10 sec
0 ^5 |' Q* W5 w7 C4 R        if A_i=A_leave then send to die
* s1 T3 @  o4 u& }/ b. s) L        else inc A_i by 1+ V8 g. S& D+ ^
    end
9 a! C0 R! c# D' K" C, P2 l* Bend
! }% _+ O5 E$ E5 J
) a7 G8 s8 c0 {( [, y2 abegin P_pick2 arriving
8 x% k/ n4 o& m8 ^6 M0 s    set A_i to 11
% g: P7 R& `9 u; x0 b1 U    move into Q_induct2
! i. K) L( {# y: _- G    move into pickaisle.induct2; E; Q1 b$ w- H7 j) `
    while A_i<=30 do begin/ |: K* |8 [4 G, {
        travel to pickaisle.con(A_i)
7 o  \+ Q* {! M( R% b: j( q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 K( _) _& {. v
        else wait for 10 sec% s$ i* z! N+ W) d. x, ^; B
        if A_i=A_leave then send to die
" i" o! m" E" R( f        else inc A_i by 1
2 r! s: b  m3 R% u    end# l5 }' a* v5 x* q6 e% E1 e( g0 L
end
8 ^# z" f/ h1 V6 N: @, S6 J) G  o, P: \# o+ f% o4 Q
begin P_pick3 arriving
2 |8 c5 s4 \- F    set A_i to 21
7 }5 G( t# M- O0 v3 V; @5 o6 R    move into Q_induct3) N. z" b- l5 X! G# m# d4 }2 ^
    move into pickaisle.induct3
: p- w" l5 L4 z, f* L    while A_i<=30 do begin/ g0 F/ [# c6 S* H! t* N: F
        travel to pickaisle.con(A_i)
* Y# Y2 I8 R; a2 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! {! ~: B7 ]3 ]        else wait for 10 sec
2 i1 B; p2 n( ?% @/ b! a        if A_i=A_leave then send to die
7 \, r4 M3 P5 ?; i/ ?& P        else inc A_i by 17 V# H; j; S6 N" y/ u2 {7 X
    end$ @6 @! d4 l$ }( W
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是个什么东东?- \; ^  y. X. v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, A7 W) _8 T2 Q; L1 G- ~

) y: ^' r9 P3 O3 G/ q# e7 sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, i4 D: o& m9 l4 @5 u# i0 o
6 a$ p, r+ O& D- K* @# N4 w另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ ^+ [! q6 A; b% V1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; x7 T! c  j  c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! Y- J2 B! b+ U. F" _3 {1 q* b( D# _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 M& C+ {* d* i6 `# obegin P_induction arriving
; v9 l& N( k( ?6 e! B    clone 1 load to P_pick(A_induct)! |5 f- L& H  v% \- I5 ~
end最大的系
0 @* T* K, i' q% E$ P* {; T* \
, N1 G# F# j/ ^; B1 t- hbegin P_pick arriving5 l, Z- f+ T5 W0 w! `
    set A_i to procindex * 10 + 1
6 w/ X+ a; C: x    move into Q_induct(procindex)
; ]0 f1 Y8 q8 M; p% E: r+ ~' M    move into pickaisle.induct(procindex), X) y- ?! I1 [6 ~; L
    /*check the type of pickaisle.induct(i), for your last problem.*/
( o9 `' h' l% W* `7 A' D3 Z+ h2 i; I& m1 X! W# A
    while A_i<=30 do begin7 \5 D$ }6 {7 [5 f( ]
        travel to pickaisle.con(A_i)
, M! j! `2 K! @: a0 L. l3 x6 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- {: `% ~. A% G. s7 y1 u% L        else wait for 10 sec7 `% W! b7 g6 G$ a0 U) A1 a$ Q
        if A_i=A_leave then send to die; U4 ]! ~! {7 H) Y; ]
        else inc A_i by 1. [0 W- h& u+ b3 k
    end
$ G( s# V& b) ]end1 N+ ~3 X* e7 h6 R8 m# v1 |; F
& J* C; Z0 m( D4 V" R( }
其中的procindex为整形,代表当前process的序号。9 a% w1 c- |! `9 ?1 U
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-9-12 15:22 , Processed in 0.012744 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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