设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13172|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 _. x1 f% n) F8 K! x) i

% C/ U' H$ X+ s' I7 q, m5 ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ d, J( c5 i* f* P/ \$ b* v, V3 ]1 _0 L) C0 p% i) \) D
begin P_read arriving  E. ?, b" v8 q) D! S" w
    while 1=1 do begin
  h5 C# z( X; ^( i; {$ l0 c        read A_tote from "data.txt" with delimiter "\n"9 h; P; [) ^6 x! i+ q9 Z
        read A_time from "data.txt" with delimiter "\n". F( A# V2 j7 w) C1 V: H  ?
        read A_leave from "data.txt" with delimiter "\n"
4 w  d# [- t, A& J* D8 L        read A_picks from "data.txt" with delimiter "\n"
7 B" J" H( f/ H# O        set load type to A_tote! v# R7 Z$ _# d. @. x
        if A_tote="tote 1" then set A_induct to 1  D* n. a' N9 U
        else if A_tote="tote 2" then set A_induct to 2% P/ O: z% L+ L
            else set A_induct to 3      v& B+ E3 r. _* Y' f* M
        set A_i to 0
; N4 m7 `0 w$ k/ q) l' p) L        clone 1 load to P_induction% X% {$ K$ b- n1 h8 u6 y
        wait for A_time sec5 E1 |+ g! z; B" J- j1 u
    end
+ x5 ]1 |4 E* y5 r2 B9 oend
$ K/ ^8 V' q9 w0 a- R1 q; @
- j* c1 `+ H$ F" p: k  b0 ybegin P_induction arriving0 J% B' g; F6 A
    if A_induct=1 then clone 1 load to P_pick1
; F' N+ m6 A( e% ~3 \    else if A_induct=2 then clone 1 load to P_pick2, W5 P5 K8 F/ e* s! B( P
        else clone 1 load to P_pick3
9 X1 W- q3 W4 Z9 ~# m/ bend
# W) i+ ^& M4 f# N4 e  ~" E. y* X* F3 ?
begin P_pick1 arriving
$ D1 f* f6 l4 u6 w; C' e    set A_i to 1! }& T" B! ~2 c7 a" k. s# @
    move into Q_induct1
+ Q" G- M) A' g5 e1 E2 \    move into pickaisle.induct1
$ Z8 f( p& z9 r9 w8 a2 ~' [    while A_i<=30 do begin1 Q! p  |- ~# F4 G9 D1 m
        travel to pickaisle.con(A_i)7 t2 ~  C/ l' A% a& e3 t  H7 R, Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* J  V7 Q1 [  F$ z        else wait for 10 sec
# _0 _2 {7 g( Q6 I9 y! ]" X- K        if A_i=A_leave then send to die1 |0 X! }% D' e" ?
        else inc A_i by 16 I9 j7 n. U3 w6 Z4 B- M
    end  T& @$ w( \0 j! p% o1 W0 h$ ^
end
1 W& n+ ^) L; m) w8 U* ?& s
: r4 Q, T7 q, D) Zbegin P_pick2 arriving
3 N" V/ D# C! S# q% Z  D6 B    set A_i to 11" N2 I* o- z0 `( O
    move into Q_induct2: w& I' B8 g* u, w* N  U( Q3 B) t, b
    move into pickaisle.induct2
- \- @2 h4 F4 u5 [0 i2 i    while A_i<=30 do begin
3 V3 k, S; Z9 G! Z) f: R        travel to pickaisle.con(A_i)8 _/ T4 `- W6 r, _+ ]7 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 `+ ~- `& o0 C" E/ t
        else wait for 10 sec
- a' V8 X7 b7 N6 }, w( V8 ^* `        if A_i=A_leave then send to die
1 [8 G" q6 c, H/ \8 A& O        else inc A_i by 1
0 s2 N2 X: q  B& B    end
  ^. y3 E% x7 t- g, }end
$ _9 i1 e$ V" d+ g3 M- o5 C9 c& p9 }$ `6 ~% t- w
begin P_pick3 arriving; Z& {5 y8 T( F; ^
    set A_i to 21
, }& w/ H/ w" h  S    move into Q_induct34 J! V- ]4 h, y8 G* g4 l
    move into pickaisle.induct3
; L# f- A2 J! y' W5 W" Z    while A_i<=30 do begin4 b) K/ r, n: r  D9 G1 Y
        travel to pickaisle.con(A_i)
# V% w  S8 W$ u  u. f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) x) [1 i; a8 h2 U8 n4 d, X
        else wait for 10 sec
6 a7 {; Y; q, z2 {9 O% n        if A_i=A_leave then send to die9 W( S/ _1 R% H$ N0 z* e
        else inc A_i by 1
8 [8 B( T+ x5 x    end
& M$ N! P8 K! S4 @1 xend

最佳答案

查看完整内容

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是个什么东东?! z$ o6 V8 j& Q7 L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! A& F- w( Y. W, L! ?. m6 D
7 X( O4 n! p) d. \1 ]( |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 {9 }, U8 \+ J5 n2 h- q( t+ H- X+ a: G6 O; q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: M  s8 u8 _$ Z6 {0 |4 D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) \% }2 G. U, q2 k, x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; [9 ^! k' G1 M3 G$ z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 M& }9 K8 c; ?- B4 C% `; C) G- j1 E
begin P_induction arriving: ~  O$ y/ C2 e/ s  y! i5 g( r  Q
    clone 1 load to P_pick(A_induct)
8 N% C' t4 d# V. B" m* r5 w  rend最大的系
2 [  D! V) o+ i; g+ E6 r4 X# [- j" t- a& I# ^9 z- G% O( t) H
begin P_pick arriving3 ?6 ]. i7 K0 E! D/ G
    set A_i to procindex * 10 + 1
5 I0 G2 D% Z9 s+ u* N3 l    move into Q_induct(procindex)
* e  G& F) u3 a    move into pickaisle.induct(procindex)! W$ C2 u* e) O
    /*check the type of pickaisle.induct(i), for your last problem.*/
  F3 q+ ~# m) L/ C: ]( H% p- C6 _  b# X1 d
    while A_i<=30 do begin
& @, B& O" L0 d* b0 `        travel to pickaisle.con(A_i)9 q! L. Y, c4 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ?. d' W& j: h* Y
        else wait for 10 sec& h8 A7 \: m8 `) r% u# A
        if A_i=A_leave then send to die
+ L' m- D/ a" d% L        else inc A_i by 1
. X' w3 I) h, c7 _) `1 g    end
# |) d7 i3 @- M( I" d( D/ pend+ \' \4 K. I# X% ~) Y) p0 |
  }: L8 q) i2 R6 f
其中的procindex为整形,代表当前process的序号。
; q5 B' r4 c" s  o) I/ H. K" 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-3-23 23:38 , Processed in 0.015673 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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