设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12325|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 c$ D; e# Q- G8 h' W

0 Z* r; u0 V6 ~! j我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% G7 E! I) E3 X0 }
- l" K& W7 G( J3 K/ c' [! F( Fbegin P_read arriving# D- p0 L4 w% a: o2 g& O6 w7 J
    while 1=1 do begin5 M1 z! }$ Y* E& g4 L
        read A_tote from "data.txt" with delimiter "\n"
* e- ?  [1 q; g- @; v0 `0 X        read A_time from "data.txt" with delimiter "\n"; [# `6 O8 X8 ]2 z4 e! J" h
        read A_leave from "data.txt" with delimiter "\n") [( I% \! y. Q/ i; A3 L9 M
        read A_picks from "data.txt" with delimiter "\n"
" t- Y9 ]) i0 m! v% a6 A        set load type to A_tote. \: R" d$ J' h6 F
        if A_tote="tote 1" then set A_induct to 18 ?+ @% k3 ]- I4 l: @, t
        else if A_tote="tote 2" then set A_induct to 2  v5 U6 d6 C7 s/ X9 N$ |% q2 o
            else set A_induct to 3   
4 N0 r9 u5 ^- l4 |' |# s7 o# D        set A_i to 0' c; M% D! O6 X1 t/ _
        clone 1 load to P_induction& {8 e7 Q8 _% [
        wait for A_time sec3 e( d" [$ K, ]+ }  Q
    end  c3 j% r% O( Z& U  \% K
end
! B2 i8 p1 o! t7 m5 z3 b$ f; z9 m6 _: m6 Q
begin P_induction arriving
( }' w7 B1 ?6 E, C    if A_induct=1 then clone 1 load to P_pick15 h- T/ ~- m" r
    else if A_induct=2 then clone 1 load to P_pick2
& y  _  e) C5 k  ]6 _- e        else clone 1 load to P_pick3
, Y  @7 b0 N# {% z0 m0 W7 [end8 o1 y. u  {# M/ Y

4 i0 h7 b' ]% o; I" k3 e$ w. Obegin P_pick1 arriving6 t; x! [, A1 D) h* K; `" O
    set A_i to 1
8 N7 ]& D1 V: ]3 P# R* G: Z8 g    move into Q_induct1
0 w/ j5 k' E: @, [+ W" e; `. C; U    move into pickaisle.induct1
' m3 q# y# U' [8 W7 W. Q    while A_i<=30 do begin: F" ]: _7 W( H7 C
        travel to pickaisle.con(A_i)
" ^- y: w+ O" r( B6 n4 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% |' O5 g% {- o3 f: `! [7 F
        else wait for 10 sec
  D3 I) g: @4 T+ v7 O        if A_i=A_leave then send to die
; K6 e3 H. \8 f        else inc A_i by 1
) e" {$ k1 A5 K" X% H4 d0 U+ G    end- }- y; T/ ~" ]- n! b0 ^% r, m; ]
end
2 t. V2 O9 S( {' ?+ G& u2 l. I/ o( l6 k, p
begin P_pick2 arriving
1 q& a* q7 G" L4 P1 b/ `    set A_i to 115 {2 W- }: a8 k1 p" [6 w8 B
    move into Q_induct2' W+ j6 w* l5 |" z- `5 `1 g
    move into pickaisle.induct2
' x7 r0 r* C5 B6 [, o# `    while A_i<=30 do begin
  \: s3 R5 o; |6 q  i1 n5 o# V        travel to pickaisle.con(A_i)
0 A3 U7 G$ U/ r5 G! }& \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  Y( |* q0 s* F" |7 g' Q  t% v
        else wait for 10 sec8 z# j$ b+ M7 C& Y1 H
        if A_i=A_leave then send to die3 f1 L7 a8 P+ o) g6 L
        else inc A_i by 13 J9 q* U5 U# q, ~
    end" g3 q" U8 D( `" g
end
5 o) @; t1 t/ U$ f. r+ o9 T2 ]4 o9 M) J. I; O' p
begin P_pick3 arriving/ [( Q0 g6 B& V, ^: _: d
    set A_i to 21
1 m7 Z: F/ t1 P. p& A( c    move into Q_induct3
, ^0 d6 x. m8 O    move into pickaisle.induct3
3 P' d. U; I+ F3 F    while A_i<=30 do begin6 n" |, ~2 X% {; T' C0 R0 y! T4 E
        travel to pickaisle.con(A_i)+ U3 [3 w7 e& }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) y& U. [2 s  ~- z! W4 r
        else wait for 10 sec$ `/ i5 s( F$ `- H0 _
        if A_i=A_leave then send to die
* @9 _, R, w* v, y# R) b7 w: k+ ~        else inc A_i by 1
# q- _+ N+ d6 Q# Y9 q2 T" ?    end# N# s1 D1 f8 F7 A* }! k
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是个什么东东?
; k1 H5 R! T; `% @* Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  i1 B6 u# g8 i0 H3 Y
$ _6 q# q3 @1 L, h3 b( W+ AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: x# ]" c  G2 M* \7 h3 s* C5 h3 V0 _/ J2 Q8 Z* X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- f% E, j6 D7 l7 I  E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% Y" q% F. e7 y2 `4 ~$ V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& {7 r* S2 L7 p$ C$ R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ b2 s$ \, C7 L
begin P_induction arriving! m5 S. r, k4 |* a' [+ a4 P& T$ e
    clone 1 load to P_pick(A_induct)
+ X8 O; n/ ?4 s0 ^( J4 s3 ]end最大的系* i! [0 p8 n% f9 K( y1 i3 \- \

; N! S" b5 r9 N1 l7 O. Obegin P_pick arriving
, A* y% `3 x! R+ m. s) H    set A_i to procindex * 10 + 1; ^. ]% T% K; ^
    move into Q_induct(procindex)
$ m! f$ |$ `4 K8 T% I* O( x6 m    move into pickaisle.induct(procindex)
( J; p5 m. d# R% ]    /*check the type of pickaisle.induct(i), for your last problem.*/1 L/ I8 k0 d' n

8 I1 K8 v+ N/ U9 @; b# C* p6 U6 k* d    while A_i<=30 do begin. ^. q: G* F; H7 P. G) P
        travel to pickaisle.con(A_i)
9 E/ A9 \. h, i! k# p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 X9 n( r4 P0 b5 V- {" s
        else wait for 10 sec* @* q. o5 w" j$ @
        if A_i=A_leave then send to die" s2 Y$ ?! s8 \
        else inc A_i by 1
$ B0 @3 R+ o0 \% ?  B9 \    end
8 u' K0 V3 N- B/ ]- f. tend  w- @: y& z: G' _' V4 D

, X- z& s( }# `+ t; f; E7 c* q其中的procindex为整形,代表当前process的序号。
: g/ G% E7 e. M# q, G" D3 ]0 ystation和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-13 18:40 , Processed in 0.019483 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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