设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11606|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 f3 a, `. ?( v$ i
+ X+ B! [! j+ K; e2 X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: m/ u4 V4 @; J) y

8 u1 _5 k2 ~/ S+ `' {8 X# Dbegin P_read arriving
7 A' n* W# P3 Q* c. z    while 1=1 do begin' n; g+ e. z$ k0 E8 C4 N
        read A_tote from "data.txt" with delimiter "\n"% |& q  p5 @( G
        read A_time from "data.txt" with delimiter "\n"
% Q; s* D  R6 l7 ~8 M8 _* v        read A_leave from "data.txt" with delimiter "\n"
, K1 C) v: y: |1 h        read A_picks from "data.txt" with delimiter "\n"
/ f3 p7 h- q6 B7 W  H- a        set load type to A_tote, Y! ~' s$ P# i& w
        if A_tote="tote 1" then set A_induct to 1
6 b8 E0 Z. G6 ?' A        else if A_tote="tote 2" then set A_induct to 2- f' W' p" F! }
            else set A_induct to 3   
9 n: Q7 S4 i$ q        set A_i to 0
; L0 O5 |, n1 L: L$ K# M        clone 1 load to P_induction
0 f2 M1 m& y! w: q        wait for A_time sec
4 v4 m: R* f4 p6 p    end8 @: f- |1 Y+ v* n/ f
end5 @8 A7 M$ f8 E; e" Y! u
2 n2 M6 d. p  {, r. s  o! Y
begin P_induction arriving
( S! x- A: {5 n    if A_induct=1 then clone 1 load to P_pick1
4 @# V) t/ m+ Q; d: `    else if A_induct=2 then clone 1 load to P_pick2* R8 K5 z( }& i/ g% u9 T8 Q) p) j
        else clone 1 load to P_pick38 [0 u, b+ ^: t' \7 E( h
end' S6 C6 J* b  r1 U+ B
2 B3 {) d9 N, O: N+ j+ r' o+ }
begin P_pick1 arriving9 g+ A$ k. D- C- `) q. L
    set A_i to 1
2 f' R( X+ l; G, I- i    move into Q_induct1
, R; Q5 x8 I+ M, t+ r( G    move into pickaisle.induct1
4 _. }$ R9 U* U) ?3 n) ]    while A_i<=30 do begin
6 f+ {7 h: a% ]5 s4 q0 H        travel to pickaisle.con(A_i)/ G. T6 T& r; p9 S: e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 X$ j5 H# h" ?
        else wait for 10 sec' m6 g* S3 d1 d% M
        if A_i=A_leave then send to die
- _+ O) ^) k$ a        else inc A_i by 1  }$ O0 [' ^2 |- _
    end
0 p* I. T% m/ ]& T, uend/ P; }, d& W, Z* u4 P6 d; t5 H
+ r$ {7 m+ `! S7 d  r
begin P_pick2 arriving
  D+ J% E  A3 Z8 w* k    set A_i to 11
! F6 q; N* L. B' O6 @  _+ N    move into Q_induct2
1 ]. c3 P7 K% I/ R3 ^* F    move into pickaisle.induct24 p: b% [5 r8 J7 O/ _; G- S6 h
    while A_i<=30 do begin" Z# o) n0 }. t. }* Y/ R+ O4 N
        travel to pickaisle.con(A_i)6 d. W8 `9 O0 K/ J' |: R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' _7 A: J: Z$ S! k        else wait for 10 sec
: ~0 e- e- m% o  ]# j2 {$ e        if A_i=A_leave then send to die0 E% l  T3 f7 S
        else inc A_i by 1, W# B" m7 C8 S9 f6 p
    end
  H1 z  @. W- W- Oend
, z3 _7 c6 t9 M9 F5 Y2 u$ j( r7 n! L: `3 p, ^/ E$ g6 I
begin P_pick3 arriving/ p3 L6 u! n; l% A2 z* k$ Z
    set A_i to 21; }0 m, N& ]  x3 E
    move into Q_induct33 J0 b1 g0 Y3 ]9 i; x+ h! E
    move into pickaisle.induct3) q* ~) A& A# k
    while A_i<=30 do begin8 L4 \# Z) M. Q; Y2 I% Q4 W
        travel to pickaisle.con(A_i)
9 O8 p- y1 t: H# b% h* D5 X: U- s' X: e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; q6 [, z  g2 f6 y  \9 a
        else wait for 10 sec1 U9 ]: l% b- M. f; e) H9 x5 B. d( b
        if A_i=A_leave then send to die( Y0 ]$ X, z, \$ _6 k& H
        else inc A_i by 1  j8 V- {4 I4 x! U# p% @7 K) Y
    end
" I, h# A+ G6 Y) z# }& B( u; S) w$ qend

最佳答案

查看完整内容

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是个什么东东?
8 n: u) D2 |1 |) M. g9 W' Z; k3 |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- i/ u) b" ~/ i; @- `) ~
) Q- C+ U; I8 i# ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 x$ B' R7 Z# i' W! X! M. C' C: s. j5 M7 C7 i9 k
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 ~6 }' g( S+ V/ g* S  j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& k! o' M, d4 o" J) c% ]8 V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ x8 V% {8 g7 P5 z- N/ s! p0 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  y7 g' X7 ~1 U1 rbegin P_induction arriving
$ h6 T0 ~8 U. O% }1 B. A& R    clone 1 load to P_pick(A_induct)
7 d. u1 h' w5 _: U* z2 U7 B% gend最大的系
3 F: w( F! b$ K. |% R9 x% F+ ^) V: ]4 }' r
begin P_pick arriving8 ^: d8 |, {3 {6 r
    set A_i to procindex * 10 + 1* U9 @+ ~) B% D3 @7 n
    move into Q_induct(procindex)
& }- n6 v& l: m* `# B  j    move into pickaisle.induct(procindex)
2 g2 @4 w" Y, p  ~& W' U) L    /*check the type of pickaisle.induct(i), for your last problem.*/: Z5 ?+ i: O& _8 m
) Q1 m; @( D. O4 w: E2 p
    while A_i<=30 do begin0 _  {- p) s" H9 B6 g4 l; D
        travel to pickaisle.con(A_i)- g* Y7 b& m7 X# ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ }! D3 `! a5 o  r$ i. ~7 l3 x
        else wait for 10 sec* L7 O/ F) i3 E3 w5 W: W
        if A_i=A_leave then send to die) J$ l) F$ r! E: S5 C
        else inc A_i by 1
; t3 C/ S1 M; @% p( H    end! B. K$ M, Z! Q/ S) k1 r, {8 W# k9 g
end* c# m. F9 \- O' T* S- v* ]

( T/ L9 u0 Q" Z% Q5 ]其中的procindex为整形,代表当前process的序号。
( a% e2 L  }& F# Jstation和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, 2025-11-23 07:48 , Processed in 0.021677 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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