设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12941|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ C( L. ]2 G) q; k$ q8 K% r9 @4 B" Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 i3 `$ C, A: v. C7 i9 o* i5 ^
6 {- Y: \( R. v! i4 D* `begin P_read arriving
( A/ X2 ?4 ?8 f+ P" K    while 1=1 do begin7 P8 y% h5 S) T
        read A_tote from "data.txt" with delimiter "\n"' N" ~) |* ~7 u2 N( v2 x
        read A_time from "data.txt" with delimiter "\n"" P3 a8 @5 c. s: p( H
        read A_leave from "data.txt" with delimiter "\n"
6 y* q% a+ X( n) J, ]+ C        read A_picks from "data.txt" with delimiter "\n"3 ^+ A1 R  v' o. A: d0 {
        set load type to A_tote. x1 l: O% i- h  x. Q
        if A_tote="tote 1" then set A_induct to 19 G$ n" X* ~  i9 a
        else if A_tote="tote 2" then set A_induct to 2
/ H. b, I8 L" m3 j            else set A_induct to 3    7 h5 x( j4 B$ C) @9 e+ j/ v
        set A_i to 0
& d4 L0 n" }7 V; n. U/ V  p5 `        clone 1 load to P_induction
* s  j% Q% h$ l3 a) |        wait for A_time sec7 }( }: @- n) U8 l+ ^: U
    end. C7 P  e7 s+ V+ V8 N5 a0 S2 L
end
! E- C" G& {$ @, T4 W. ?
0 k! w! j/ U" B/ Mbegin P_induction arriving' f4 a: B) e( q5 ~2 H
    if A_induct=1 then clone 1 load to P_pick1
. Z( c' C: C) w& M( i8 s2 p    else if A_induct=2 then clone 1 load to P_pick2
; _3 t4 {6 V$ R- K! H% Y, o        else clone 1 load to P_pick3
! ]7 n6 \+ @  Q2 g  }9 b5 N4 y8 M+ }end( J6 T, ^* _, @8 [% E& A% k5 k
- @3 d4 }; [: B. a' @6 k, H
begin P_pick1 arriving- \7 r# b$ J* m% I/ p- c: _
    set A_i to 1: O9 k) c+ T% Q% [6 U% m3 A8 L  v
    move into Q_induct1
; X7 J; ~: y3 f1 ~    move into pickaisle.induct1
/ Y, m6 L4 B. I; Z. V2 n0 i: y    while A_i<=30 do begin
7 |4 d' o, N- h# R& {. l5 T        travel to pickaisle.con(A_i)
$ c" e# ~9 p/ Y: y/ L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R8 m( B; z0 J        else wait for 10 sec
  B  O: Z; z. [. q; w        if A_i=A_leave then send to die* U. g4 c! h5 y, P, q: M; w/ `
        else inc A_i by 1
/ B: H: d' q9 W8 _+ M% I8 m    end
) O% G2 g# K! e, O2 Z" yend2 O' O+ S, W# _9 r; B; c: u

  L% I: ~7 ?9 O& h8 J8 vbegin P_pick2 arriving
) u: x- z9 W3 R+ s" X. R    set A_i to 11
- y# r1 Z% b  |6 k    move into Q_induct2
/ V4 ?' j6 k2 n( d2 F- U% ?    move into pickaisle.induct2
2 u' {% o+ D+ u. K    while A_i<=30 do begin+ g* O0 x8 Q/ ?" ?& Z- [2 ~
        travel to pickaisle.con(A_i)5 }  I/ ]0 O3 ^" P! F5 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  C. @- }$ V3 k0 }. y: B  S        else wait for 10 sec
' T  {9 \* H! [3 E4 F  A: U        if A_i=A_leave then send to die
0 L  v% P; S  K0 M( n4 U0 e  }        else inc A_i by 1$ U' m5 k! u' c( B6 a. r- P
    end0 X) G& a1 v3 f2 w( J
end
" s0 v- \2 G% s. C; d) ?. ?( S& L- [$ Q3 t
begin P_pick3 arriving
5 O* Q4 w& f/ _5 l    set A_i to 21/ N" P) W% V; I9 t5 i/ V- E
    move into Q_induct3
0 d5 N1 {& {/ |; y: P    move into pickaisle.induct3" K4 t5 ?0 G7 v8 i1 W  L
    while A_i<=30 do begin
0 g) N3 L  u  ]& r        travel to pickaisle.con(A_i)
  U! v( F# g5 t7 `5 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q0 L* Q4 E. `3 J( C% x5 @        else wait for 10 sec9 l+ g: U/ n) c, S. o, s2 u
        if A_i=A_leave then send to die
! H; ~2 q" b# C' a0 R        else inc A_i by 1
8 }+ q2 q  {( s    end
! g* _5 n& |5 k0 E2 A! {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是个什么东东?
0 `& k8 @8 n& M- ~1 _7 ?% a& Ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 _6 ^% P" W% I. Z% g3 _4 K; D+ x- G0 X+ ~8 _( `; H5 P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: U3 A7 g1 X3 W: o; F& T

! p7 _* {# g6 }) \. q1 h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' d5 U* D% l3 T9 A) e4 C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 G$ d5 v. j& R# N9 e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 m, M& n8 m) F7 T1 B+ x8 ^
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ W. d/ w% k! p! I* ?4 R9 x  a; Pbegin P_induction arriving
* W" [: x- i. r  a    clone 1 load to P_pick(A_induct)! t9 Z9 U- c# a- y' H0 E7 S" T
end最大的系/ g* x6 b# x- y. h/ t. i6 Y

$ g, L# V9 G5 u+ K! jbegin P_pick arriving
8 {9 `0 }6 q! ?, m% C% B0 q) Z    set A_i to procindex * 10 + 1. k* ?( S/ w: K* N4 m: s
    move into Q_induct(procindex)
" [7 V. ?, p4 }: n; e2 {    move into pickaisle.induct(procindex)
4 O' `$ p# _5 y; J* s' ]    /*check the type of pickaisle.induct(i), for your last problem.*/
) N  R& y' `$ N4 e/ }" C& N4 p  s% e! v; c6 g% F2 y
    while A_i<=30 do begin8 Q2 n5 x# d/ D7 S+ D
        travel to pickaisle.con(A_i)
* m5 f' N% ^5 Y9 S2 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 M& z! k  K" n/ l6 h/ }- U
        else wait for 10 sec
- M, `  f' y# P$ D, T* W2 ?5 i        if A_i=A_leave then send to die0 {- u9 M/ J' L! _
        else inc A_i by 13 {2 V/ ?7 v  Y9 |) U& [. w; k
    end' X) o* i2 E, j9 r+ Z" C
end) k: F4 H; x% D, [3 O
# C' e. ~5 N0 P5 W$ b
其中的procindex为整形,代表当前process的序号。
8 ^+ m3 S5 n2 N2 Y7 y5 pstation和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-3-4 12:30 , Processed in 0.017874 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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