设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12272|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, {% E$ X/ B4 Z9 g& q$ i7 Z# S/ C) U0 z5 Z* 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中的数值,不知道会不会有什么不妥。. g9 G: v/ n. j. Y& t0 J, t- C4 G8 t

; ^4 p" d9 G: J" |2 x% {- ]  zbegin P_read arriving
% A: I7 d# H! f, V    while 1=1 do begin
0 S7 P$ X7 s: Z! ^        read A_tote from "data.txt" with delimiter "\n"
3 L: x" M, X* W$ r$ i        read A_time from "data.txt" with delimiter "\n"0 c% r5 I3 V, G+ u+ F2 e
        read A_leave from "data.txt" with delimiter "\n"
2 p0 g3 T) A. a4 O, X. L. K9 E        read A_picks from "data.txt" with delimiter "\n"# P0 m5 v  q+ i$ _
        set load type to A_tote
# e7 S7 e- O2 o$ E! i' W- H2 W6 u        if A_tote="tote 1" then set A_induct to 1
" J$ d- e( t$ z        else if A_tote="tote 2" then set A_induct to 2
3 E) _/ l' h9 ?' Y* k            else set A_induct to 3   
* @5 w% Q. P6 P5 b9 e) h        set A_i to 0
! e; x- I6 l/ u+ ?        clone 1 load to P_induction" H1 G+ r* D. y
        wait for A_time sec% Y0 r; Z( Z  r: a% |/ r
    end' M; \9 o# S; M# X4 {7 x9 ~$ z
end
: Z5 i1 |' [/ ]# B" b
; d1 S( @1 {5 X% [* [3 qbegin P_induction arriving
% a/ V1 n5 s3 L$ {    if A_induct=1 then clone 1 load to P_pick1
: X) `; J% T$ C1 `( W9 G4 R& z    else if A_induct=2 then clone 1 load to P_pick2
9 b. U' F; S- C5 `  V        else clone 1 load to P_pick3
# C4 z0 y+ T2 ^- V$ q" Yend( z: B, d- T0 A/ k0 b* j

2 [3 L: x, |& u7 R( j) Z: lbegin P_pick1 arriving0 Z  v1 l5 ~2 o) U* d% {- t5 s
    set A_i to 1% l1 {# a0 o* e( d
    move into Q_induct10 S/ N# f4 {# M( z3 N4 p0 p
    move into pickaisle.induct1
, B$ g6 W* b7 u' N6 w4 F2 L) u    while A_i<=30 do begin
1 s: K3 M7 D/ t6 E0 E        travel to pickaisle.con(A_i)( E+ `8 Q8 |4 W5 g1 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 @' [  l7 H* b        else wait for 10 sec
% q6 Q, H  R7 Y3 I# ~        if A_i=A_leave then send to die
2 O/ ?; x$ c: Q/ g$ l& D9 I        else inc A_i by 1# }4 x: j+ y2 h6 ?5 G
    end8 ^( c# Y' ^. ^" q. O
end
( {8 N, W) I3 @1 x) G
" @. \& `: ]& s. Q8 H1 y* A) R$ Ybegin P_pick2 arriving
7 k4 c$ S8 e4 d    set A_i to 116 J5 X  S/ r) l0 z
    move into Q_induct2
5 ?( Y: r' X# U/ G/ \& K+ ?9 Q3 X8 G8 R    move into pickaisle.induct2
+ {$ G& ^  y/ B/ ~2 _5 W) M    while A_i<=30 do begin2 ^7 ?5 n. v4 o
        travel to pickaisle.con(A_i)) D! a' t  @# z3 v, {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 A, A8 N) q' y
        else wait for 10 sec
0 @* L  E, T: j. ~  m5 l0 E        if A_i=A_leave then send to die
7 J: A# [8 d3 U: b8 Z        else inc A_i by 1
6 Z5 d$ F2 i3 A  I6 E! q    end( ?! K+ Q( i/ @% r/ S4 M2 j- a* A
end9 S8 B* f/ M' G0 K3 E

5 e1 B: w  P7 lbegin P_pick3 arriving  W- e* ^5 N9 S
    set A_i to 21
. z' K# r. z0 p0 X4 y, ]2 X    move into Q_induct36 z% d7 ]" e* e$ W% ]/ k3 s
    move into pickaisle.induct3
- T, L  \! s5 S) O    while A_i<=30 do begin
5 F1 e2 C2 _5 e# D( V  X        travel to pickaisle.con(A_i)- `3 G- d2 e7 P2 R, w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! U, j3 G# ^  Z0 h) q# Y6 ~        else wait for 10 sec" V2 p1 M+ Y1 {* c6 N
        if A_i=A_leave then send to die5 H' a+ }7 _! c( j6 Y, I: z" @
        else inc A_i by 1
: |! O8 l' N' h5 ^. s    end
% a5 }) }! C& I* Zend

最佳答案

查看完整内容

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是个什么东东?
+ G6 N! j: Z, v8 Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( F% c4 M1 s+ j7 u1 U  ~4 I( F; W/ V' S8 u. J: o+ }
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 E; U0 y7 {6 C- w% G# P; u, x

7 G; m" \: L$ T" ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  r/ p& R$ `% h! i! j' @( n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 P: \1 O3 T: k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* o8 R/ }$ x$ e9 \& n( Y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 c8 C1 g( h! C) {
begin P_induction arriving
* i4 l/ ^$ g2 \& O) T- L    clone 1 load to P_pick(A_induct)- a, l4 _: l$ M0 B0 S8 z2 l" n
end最大的系# ]( X6 m+ w2 ?

  A: o; }8 m. }9 r" p; C% a8 y% T1 pbegin P_pick arriving
: P) o3 l' ^* Q4 ^' s    set A_i to procindex * 10 + 1
& @& W1 R0 _: I# P    move into Q_induct(procindex)' O' f  C4 t' W; a
    move into pickaisle.induct(procindex)' A0 u2 s2 b0 p% H0 R& G
    /*check the type of pickaisle.induct(i), for your last problem.*/0 u+ J  v8 Z7 j+ n3 `
. M0 J. t; H$ o
    while A_i<=30 do begin7 E% ]6 t9 ]; q+ @9 D. e: N1 B
        travel to pickaisle.con(A_i)6 @6 G6 d% `" l4 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 E3 k. J' }1 _, b0 @2 t1 ?        else wait for 10 sec
5 N* u6 K( [1 k. L2 Z        if A_i=A_leave then send to die
4 S+ l) l; @! W5 ?1 i        else inc A_i by 1
! E! i' t6 g# v    end
$ _/ m9 |" G/ f. }4 G$ ^4 Iend  r" E/ P; z! w" T
6 `8 x) v+ j, H' }
其中的procindex为整形,代表当前process的序号。! w: g5 G, V' M. I+ {( ^
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-1-10 06:12 , Processed in 0.019149 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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