设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15417|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. b1 E5 l! i  ]
; _- Z! N2 E8 M4 Q7 I; L* I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 i5 i7 u0 W7 p% O
! R9 r8 H6 O+ D6 G# R$ T* X( V
begin P_read arriving
1 J$ m6 @; S/ }9 m    while 1=1 do begin4 @4 C5 }3 R: e
        read A_tote from "data.txt" with delimiter "\n"3 O. V+ V3 q. ^/ N5 b
        read A_time from "data.txt" with delimiter "\n"* K  m; O0 u% s+ Z
        read A_leave from "data.txt" with delimiter "\n"
6 F! K" C+ D! ~# K  {; |, L# E        read A_picks from "data.txt" with delimiter "\n". t5 w5 q$ v# O0 l
        set load type to A_tote
- r+ J- }6 L2 O, o        if A_tote="tote 1" then set A_induct to 1$ a* r" s; O" b' v$ Q: J7 b
        else if A_tote="tote 2" then set A_induct to 29 L9 E$ G- a9 `7 j: F
            else set A_induct to 3    6 o: X0 j+ c  O: b9 Q
        set A_i to 08 F6 ]! M) d$ Z( N! k8 I
        clone 1 load to P_induction& B4 C4 d% J' j) f. R5 G
        wait for A_time sec, ^6 }  U, W9 I$ c* S
    end
( A/ m5 T+ F( `. Q9 cend
( x4 S. U- }7 z, Y, W5 G
3 p3 }9 X& X% R$ r. Ubegin P_induction arriving
5 A& u0 K( S1 ?$ \5 W    if A_induct=1 then clone 1 load to P_pick1) M( a3 ?' U- [- a
    else if A_induct=2 then clone 1 load to P_pick2
8 L& C% I2 X" \6 g        else clone 1 load to P_pick3
6 |0 t' x, |' jend
$ r8 o! X" I. U
8 T9 ^- h* h1 V: O( h. b, Rbegin P_pick1 arriving
' e8 }( G2 s; D7 L7 n9 {# z% V    set A_i to 1
* q1 k3 Q9 c1 z+ f; \6 [7 ?* s6 q9 Y    move into Q_induct19 g& l) s) j" v+ W( @: V) X9 F
    move into pickaisle.induct1
0 Z! e! Y- A8 W- K    while A_i<=30 do begin
% {8 j2 A0 |: e0 V! `        travel to pickaisle.con(A_i)9 ^8 h. G4 a3 s! P8 [! v* F! f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 @# L- Z! d/ u& p; `        else wait for 10 sec& H* o- W9 I+ g
        if A_i=A_leave then send to die
2 K  i0 Z+ W+ O* S+ c        else inc A_i by 1! E8 v' m! W4 X& L! k: v% K* @9 F
    end
. S0 l6 c; D, d2 T/ send
2 x: V5 y5 l1 F
- X7 }( |+ ~* ^' x5 _0 f" V7 Obegin P_pick2 arriving: \5 r* J( A2 h7 {3 c* ]* P! O0 B
    set A_i to 11
, s) Q. S/ m5 X5 J9 E    move into Q_induct24 l1 X+ I3 Y5 P- v, u" a: W
    move into pickaisle.induct2% g# Q4 \" g% ~
    while A_i<=30 do begin
& J) D# z6 |) i0 l3 k4 M" J4 p. C        travel to pickaisle.con(A_i)/ u! ?$ E; z3 n* x% Z- Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 w' O' a& Y$ J% N
        else wait for 10 sec/ O6 f; K# i. H7 c2 p  e
        if A_i=A_leave then send to die) f. Y5 R. J: C' U* ~
        else inc A_i by 1$ ]. R4 i) I4 e8 Q( [: e$ T8 H
    end/ V  e1 M$ F5 v+ X& h! u6 ]+ u, R
end
$ R3 K/ w0 X9 W& I
5 T0 Q8 I  ^9 d9 S- v0 i( w$ Z# Ubegin P_pick3 arriving. l4 T  U0 h* A5 c9 X
    set A_i to 21. W" y6 h3 n7 D6 j
    move into Q_induct3
$ S1 M* \+ ?+ u3 ?( j    move into pickaisle.induct3
5 Q; V( B- F1 }& X6 L    while A_i<=30 do begin
& E0 ~1 [( s% M! ]' S        travel to pickaisle.con(A_i)
! H  d& q; l# z1 u2 q# }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- P; G' M' t& v9 r8 I4 o2 L        else wait for 10 sec# W4 s$ x1 O% L1 D5 {1 P8 q! Y
        if A_i=A_leave then send to die! t9 o& {/ ^+ b' ?2 d+ ^. w
        else inc A_i by 10 X9 `# z0 E' ]; H
    end
8 E$ p9 E& p1 t. Fend

最佳答案

查看完整内容

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是个什么东东?
3 v! ], s; G  g3 d: cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  Q9 k) T$ k, M# ^% C
1 q2 D/ z9 F# N6 g, B- `AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" a: n9 a$ K& j; b7 a; E" P" H! [9 c
6 u7 p/ P& \( Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 T! g- I, d2 ~; O* m5 @1 V' X5 O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  A& n* [9 I5 ?. W/ l% |+ q* n2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 k" i- ~5 c6 V/ w, F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 n5 D1 J3 ?# ]3 M3 K
begin P_induction arriving% e5 I/ R3 z1 Z# ]6 O8 ], `
    clone 1 load to P_pick(A_induct)5 k- e$ o' F" h. W
end最大的系9 N3 H/ q5 {0 |. s  Z5 f
0 o" ]9 L: k) B% g) |3 s* b
begin P_pick arriving
: `) r6 D( O+ O6 q# N    set A_i to procindex * 10 + 1! D+ }6 k! T  x- x3 ]
    move into Q_induct(procindex)
! ~9 S* Z/ _# `    move into pickaisle.induct(procindex)
0 H0 l& ?" a: x, n    /*check the type of pickaisle.induct(i), for your last problem.*/4 @5 k+ Q/ \0 `: m5 w

" N% A! d; q4 N$ q/ P( m    while A_i<=30 do begin
1 t  [8 `' ?( z8 l5 @: o4 l- Y        travel to pickaisle.con(A_i)
" K' z0 o& {8 {  }& b' J, n( F+ K8 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 k0 t* v. W& L! W  w( j3 z$ S. w        else wait for 10 sec% C+ y: @' E$ x! A
        if A_i=A_leave then send to die: A9 R# y, {. M% ?2 H' @* k! C
        else inc A_i by 1, I: `3 Y) l3 j% p4 `' n
    end
4 Q, j" R: L9 i+ v9 send2 C! ]9 L% L: o- t
; S" `* p/ H' g' M/ C& p
其中的procindex为整形,代表当前process的序号。
, v. D& x: @4 K2 J! G6 fstation和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-9-9 20:13 , Processed in 0.016914 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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