设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12475|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- x" B) O- f( d+ E# [5 _: F& \8 @, s
我的问题是,在每个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: a, f# J% w" q
/ B5 p( [( z" U6 }3 {5 i2 obegin P_read arriving
& a! M8 A" x2 Y: f; d5 Q2 f% e3 ~6 W6 B    while 1=1 do begin3 o3 M6 X5 ]3 R& C  j8 i
        read A_tote from "data.txt" with delimiter "\n"  a, d/ J4 q2 A1 ?4 ~' k
        read A_time from "data.txt" with delimiter "\n"# B4 p2 d; G; j2 O! W7 ?' w
        read A_leave from "data.txt" with delimiter "\n"* j+ [4 v$ y+ {; D
        read A_picks from "data.txt" with delimiter "\n"2 x, f# ^& n- L) F3 H
        set load type to A_tote9 w0 f8 u8 e4 _0 e$ M$ }, ?5 c, S# }
        if A_tote="tote 1" then set A_induct to 11 J# r8 Z, M- r3 C" |) K
        else if A_tote="tote 2" then set A_induct to 2
. r7 r+ i3 N1 g7 ?1 |( [            else set A_induct to 3   
; w. c$ U7 t1 r6 ]- H( k        set A_i to 0
, e' N( W( E8 i+ }& F        clone 1 load to P_induction
/ q* t6 j8 z% @  m        wait for A_time sec! P# ]7 f: |  d; E2 x" ?" b; z. v
    end4 A9 [- _% K6 H. |5 l5 d& m
end
6 i5 M' X; p  w% K+ E. S
5 W8 \; Y7 V" l8 h8 Nbegin P_induction arriving9 F  K7 ?; p! k& y* c
    if A_induct=1 then clone 1 load to P_pick1
' Y, d( b8 P, [' p    else if A_induct=2 then clone 1 load to P_pick2
; Q% C; U9 @" o: H        else clone 1 load to P_pick3
$ ^8 n+ x5 h2 g5 Rend" v. M5 l: w" h+ K; j: c( Z' s$ c

0 Q. P3 \) _$ ]2 Cbegin P_pick1 arriving
4 b. B( v! p# M# J3 Z    set A_i to 1
; G5 t- r! F0 e% ^0 Z    move into Q_induct1
. q1 D" F7 r$ u! g; C    move into pickaisle.induct12 E& q4 y8 D* s0 @% \+ O" N& R
    while A_i<=30 do begin
( ^& T6 K4 w- k" C        travel to pickaisle.con(A_i)
  y1 ~2 I6 L& i& V+ \) m$ ^7 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" B! r' s. }0 C. c  _4 I
        else wait for 10 sec
: l1 B( b2 Z/ a5 ?! M/ _        if A_i=A_leave then send to die
2 u# C; R8 d  \* V        else inc A_i by 1" h7 Q% z8 x3 B) i1 K4 e6 |+ j! {
    end
* b& A& N! n% [; R& o6 cend7 ^# N- s0 W; q4 c- ?: Z1 x
0 Y( m  d2 @# U4 @0 H3 ~  [
begin P_pick2 arriving
- p; \: b5 B7 a5 j    set A_i to 114 N- `& _7 w0 g2 u! y0 ]5 X
    move into Q_induct2( A* V$ z0 I8 I0 r
    move into pickaisle.induct29 D8 [& s0 X/ u/ W6 _& U
    while A_i<=30 do begin
9 V' v. p, {; p' R6 G% n        travel to pickaisle.con(A_i)
9 k: q8 e4 o4 Q4 D: L" l0 E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 k8 e" g" i. ~- p$ j
        else wait for 10 sec' x7 o3 I* h* o
        if A_i=A_leave then send to die. x4 i; M6 `  [
        else inc A_i by 13 |' {9 v7 |, l( r9 L
    end8 e/ Z5 Q5 a- U" j" D
end
6 B+ B( B) g8 X
$ d4 {, w, R( t- ebegin P_pick3 arriving7 \- S' r. p7 b: R/ l6 P1 ~) X' L! R
    set A_i to 21
0 K9 S4 G0 x8 ?- l8 g( J% e    move into Q_induct38 i" Q7 p# C+ i% A# C+ l! D
    move into pickaisle.induct3
, F$ e. X+ w  d7 G( i. P$ z* x3 }" c    while A_i<=30 do begin
; G5 g0 C% F. R1 O0 @7 q3 p        travel to pickaisle.con(A_i)  Q3 l; {7 Z  i( W  w  x) u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 o& O& I, L+ W. \( r7 B
        else wait for 10 sec
4 _0 w1 b% Y" l3 t/ |        if A_i=A_leave then send to die
" I  z: C( I% g5 K: u        else inc A_i by 1
8 n, Y: N/ ?6 A9 c$ T8 z& S    end
- K* m  J1 }) 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是个什么东东?
& M5 Q: f" Z% t$ \move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- Q" \+ y1 N# w' p0 U) U1 d5 _8 O5 [6 n2 s
* \3 }/ A  O' {: c8 C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ m, r7 b& y/ ~: ^0 v) U2 [
" y% n  W4 W. Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 s+ W4 P# U4 y9 j2 @
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ q; k7 U0 b3 W, r' `4 `) g' G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ [/ L, ?6 L( x& C( x0 |& M. _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! u& E3 Y' `6 d! L' Ubegin P_induction arriving
3 U( p' z; ^( j( c" ~5 ?    clone 1 load to P_pick(A_induct)- e) ^4 s: F: l0 [- i9 S5 q  v3 p' J
end最大的系
# c+ R4 I% N" K* f5 g5 t6 b3 {! ]( A. a/ N7 m) K
begin P_pick arriving4 y0 z9 n' u9 q. F
    set A_i to procindex * 10 + 1: _8 W0 S" Y, J9 F
    move into Q_induct(procindex)0 h0 j- s- l* a8 c+ _4 T1 t: L
    move into pickaisle.induct(procindex)% D3 D5 b8 d' w# g" _
    /*check the type of pickaisle.induct(i), for your last problem.*/& |- M1 C1 o* O! h, v) `8 l

& s6 X3 @% r' r9 h1 S* |  k* G    while A_i<=30 do begin0 K( p1 t( ^5 T) y3 c8 E) Y
        travel to pickaisle.con(A_i); A6 h- F/ ]- }* L2 u  j. d1 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ x" N: O0 s- B. T0 L) Y' w: g( h  ~
        else wait for 10 sec. N4 _' F6 |4 b; H0 O# k# Z+ f
        if A_i=A_leave then send to die
- b% [% \7 e# g- ?3 D% d        else inc A_i by 1# O$ R! r$ O) W/ v7 H7 F
    end  Y: x1 S4 |8 W; W
end
. Q& J6 W( x, o0 L" O7 W/ i  N" Z* S6 D6 p% Q
其中的procindex为整形,代表当前process的序号。
' {' q: A6 c3 J; cstation和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-1-26 21:46 , Processed in 0.019407 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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