设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15057|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, Q5 I4 }3 O. K6 _. g8 p
/ E; ~) L- Z  Y7 I0 c7 g
我的问题是,在每个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 P( [1 A( H7 q8 h7 E2 }  q0 N" h, F% _
/ u# }* y) [6 P; O; nbegin P_read arriving
; ?# a$ K+ E: K3 P+ I    while 1=1 do begin
# ~! o5 D% J( u, w# A, K* ~        read A_tote from "data.txt" with delimiter "\n"
: b2 F8 D. b" O, Y$ {7 w        read A_time from "data.txt" with delimiter "\n"
$ O1 R' C( J: O4 k8 R9 J# o# a% i8 c* Y        read A_leave from "data.txt" with delimiter "\n"
% u3 W: t5 A9 m. o        read A_picks from "data.txt" with delimiter "\n"8 \9 P* N4 p, w7 g
        set load type to A_tote- ]1 j4 }/ R! G: I
        if A_tote="tote 1" then set A_induct to 17 H- y. ?( W- M  b: ]
        else if A_tote="tote 2" then set A_induct to 2
) B5 O0 f) ]3 @1 `) G7 h4 ~* S            else set A_induct to 3   
1 l! [# I. I9 Z        set A_i to 0/ |. r! }8 Y2 h# F: Q  K3 x" g
        clone 1 load to P_induction
! Y- P+ e$ z* h& o% m        wait for A_time sec  y, D2 X( F4 [8 s0 A1 w
    end* p5 \$ p/ x8 ]
end5 ]5 [  x, r/ @# o+ N
3 D4 D# v) h( y7 G0 _
begin P_induction arriving5 n8 [! G' D! v5 a, G3 O  ^5 }
    if A_induct=1 then clone 1 load to P_pick1
/ X0 |7 |5 m, H& ^    else if A_induct=2 then clone 1 load to P_pick2
+ N0 m1 S- @1 b+ t- q* N# t- C        else clone 1 load to P_pick3" k- Y; H) d0 [) @, H
end9 s8 j" X% |) B; X* n
/ T2 O1 P9 H7 _. o* e' p
begin P_pick1 arriving
+ W( w* t. }# D( h    set A_i to 1
2 ?9 i  ~5 {; W1 R, p( y    move into Q_induct1+ ^, J: m7 ^' \" I
    move into pickaisle.induct1' m; a" p/ S# Z5 s
    while A_i<=30 do begin
5 j+ P7 D( ]  ?4 G8 }        travel to pickaisle.con(A_i)
( f8 l6 t- O% l  X  a! ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& v! K% C+ n6 ~) @7 X        else wait for 10 sec& Z: I" C* [) |( w1 r$ V& C
        if A_i=A_leave then send to die: g' Z% h0 R& v2 x" K5 [* `
        else inc A_i by 1
- u  z$ G+ ~$ j- g    end* B& ?3 W  x1 ]2 R+ M- i1 ]  ]
end0 s4 g! u; c; X( {" l5 d0 v7 m

; i6 ?  [" J# abegin P_pick2 arriving8 e6 G  S1 u/ i& U/ {$ y) n( [4 r
    set A_i to 11- X1 T# P2 ], F* d# t: \
    move into Q_induct2
& F5 X# q; P5 f. {2 P    move into pickaisle.induct2. {" V% I: u1 f1 n! }9 a3 c, a
    while A_i<=30 do begin+ P( D. G2 O5 n% ^
        travel to pickaisle.con(A_i); s9 _3 i# N8 A- n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 r7 \; \; V- w* }( Z$ e        else wait for 10 sec
; f! y$ c8 W6 I7 s0 _6 c        if A_i=A_leave then send to die
8 ~8 p: l* j1 ?3 {' _- E: Y- H/ r        else inc A_i by 1
! k+ g* T8 n6 G/ n$ {" B    end$ o. C$ ?4 l* f
end( }8 r& ?: G: U4 S- E% [8 e
' |5 s$ K, ~2 y4 Y/ @
begin P_pick3 arriving
" j/ g7 A  |& Z, ~4 \6 c    set A_i to 21. ~( c1 m& ?* ~8 J
    move into Q_induct3% A* v- D, b# @: Z
    move into pickaisle.induct3% ~; J9 Q+ S5 f: A5 d5 p" W
    while A_i<=30 do begin. `) b. g7 w! w6 U1 v; V# B
        travel to pickaisle.con(A_i)4 _5 A9 J1 S$ A) ~' H( x8 Y0 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! N2 s* n; S9 B. }2 ^
        else wait for 10 sec+ k8 k, N- a% {0 J' j- p) t
        if A_i=A_leave then send to die
/ B) [. V, B' y- n) e" [7 ?        else inc A_i by 1) f3 w; g) i9 ?+ H$ J
    end
- V" X) s7 E) f! e! e$ {/ Dend

最佳答案

查看完整内容

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是个什么东东?
1 M/ d4 P. g" W* o  ]) ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  f  r2 W3 k  c2 x" V; w4 w7 w6 p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" ]. f# ?; u; P4 j  R( P$ G; W7 P* a* e0 N
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* _3 A6 J8 G3 F1 k3 N' h* L; x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: x' v  i+ D9 h8 C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% [6 N  z, W7 k3 N3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* k+ j+ s$ K; q0 ?% p1 K' \begin P_induction arriving
4 Y, t  l) o' r! J  n# u    clone 1 load to P_pick(A_induct)
1 h; j, y, F  hend最大的系
# Q6 h0 h( q/ p" L9 y! i" f' n# H, q4 ?( A. U, g) r0 r' m5 S
begin P_pick arriving
; ?& u  U; B% k% G: Y    set A_i to procindex * 10 + 1/ a/ ]& z% f1 C& V5 j
    move into Q_induct(procindex)
; C2 @. k! J% a3 @( X& z6 c    move into pickaisle.induct(procindex)
0 [% A6 a" g1 H    /*check the type of pickaisle.induct(i), for your last problem.*/; t5 g+ x  W- p
) g* A; P- ?! t- Y) O
    while A_i<=30 do begin) r9 x! Y# {' B2 g, @8 O+ V
        travel to pickaisle.con(A_i)( e3 x( E8 H3 U7 _: @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ r( A; Z3 x# A$ z4 c: @& L
        else wait for 10 sec
9 N( g( a. z# i' w$ _        if A_i=A_leave then send to die
  A# U% k* j" o8 m        else inc A_i by 1' e/ Q% _4 ^. O0 h# }; t/ A2 e
    end4 {* D* f( p% v7 W( e2 V- D
end: O3 ]3 I: F/ @" A: a

2 A, m% c2 }6 V" b, U: k- S其中的procindex为整形,代表当前process的序号。
  [, c5 j* z$ Sstation和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-7 00:22 , Processed in 0.012803 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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