设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14014|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 g1 W) i1 H3 V4 c
% `, J2 N/ x  x; J, f4 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中的数值,不知道会不会有什么不妥。2 Z; q  [: ~6 Y: H  b* W& Z1 w

5 X1 H. d. y; lbegin P_read arriving/ j* Y7 m  p& X" o1 B
    while 1=1 do begin* `; i# [3 C3 W
        read A_tote from "data.txt" with delimiter "\n"
- {& x  f0 |/ F5 a9 @2 @        read A_time from "data.txt" with delimiter "\n"
' A$ C9 i9 @, s: q) _' z: c5 K        read A_leave from "data.txt" with delimiter "\n"
8 J$ _) E0 R+ O. d* m. ]3 R        read A_picks from "data.txt" with delimiter "\n"
8 J1 H; M. ^' E  [6 W, t7 E        set load type to A_tote
' ]* q& c% ]8 o: X' I) B        if A_tote="tote 1" then set A_induct to 1
/ H( X; j6 b( A& f# k        else if A_tote="tote 2" then set A_induct to 27 f7 V) }; l. y9 O& W) K5 ^$ P
            else set A_induct to 3   
+ \3 l4 P; \7 H! d# P. a; a. `) E8 H3 ^        set A_i to 0! j$ g; i2 M4 y/ G& [& n/ }
        clone 1 load to P_induction( u5 y) `) P! B7 o7 }5 r
        wait for A_time sec
; n" E3 o8 P6 [* N$ d( v( \    end) i7 v7 M: w0 B# |
end
  `7 g+ _1 S$ F, ~3 \" \5 Y8 ]7 H4 s" `0 g3 v
begin P_induction arriving
. u# z/ n; b; D    if A_induct=1 then clone 1 load to P_pick17 A% J" i0 C. j: i
    else if A_induct=2 then clone 1 load to P_pick21 Y; j3 p* b! `
        else clone 1 load to P_pick31 ^1 U8 I7 m: D/ t! ^& D( [6 W
end3 s1 U! a$ J* `0 e3 f
- @4 d  ?! O* {, g3 e4 C. m
begin P_pick1 arriving
$ s! R$ |( B  c/ O( E% K" ]& h    set A_i to 15 q5 Y  J* q8 W( S! w  S/ M
    move into Q_induct19 A! P! W5 _, K7 a) h6 I8 s9 B
    move into pickaisle.induct1
' j0 s, ]9 B0 G* G: R0 |9 F    while A_i<=30 do begin. w  ~/ U9 l. E% D6 R
        travel to pickaisle.con(A_i)
6 Z3 Q8 o3 _: m6 c7 c" d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 p* G5 ?' i, F% f$ L        else wait for 10 sec; p4 k8 w; U# r  U9 k
        if A_i=A_leave then send to die. }# `! T5 N. l' x
        else inc A_i by 1* }, s8 A7 t7 K  R) a
    end
5 a+ F) Y2 A: q5 _. pend$ Z7 H- Y; r; {3 l$ h+ Q# ]
% a; e; w" `! i
begin P_pick2 arriving
0 d; i0 t  X6 v+ j1 I; K) ^    set A_i to 11& q7 K9 p7 `+ T2 q  F
    move into Q_induct2* i3 x2 d6 \0 k0 F7 ]1 ~9 y. b
    move into pickaisle.induct2: U( {" t1 k* F& y2 e' {/ `+ }+ B; P
    while A_i<=30 do begin
$ A' e1 {. L9 S; B# [$ d        travel to pickaisle.con(A_i)
4 L  v6 y( h9 r* @. w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e6 T0 ]% ]; O2 l
        else wait for 10 sec% p: D. ^  {8 g( `, h$ a3 y
        if A_i=A_leave then send to die: F- {/ ~( [4 \* h) n
        else inc A_i by 1
* Y/ _& H, L; w3 x    end
# U2 h! W$ |/ ]0 J) Pend
1 g1 G1 o3 F* W9 z; M1 }$ }: F( h. K; W2 o. Z, d
begin P_pick3 arriving
% b+ ^# k' }8 H8 n* y  D    set A_i to 214 D. a7 a. V: S  p
    move into Q_induct3
! ~5 W% {5 ~2 y    move into pickaisle.induct37 x, A6 Z% V/ [! L
    while A_i<=30 do begin5 N$ V2 p8 I) M2 O+ d
        travel to pickaisle.con(A_i)
% {  i6 |6 v& U5 R4 F3 v+ W7 v7 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 a. c$ ?3 R" Y$ K! x! W        else wait for 10 sec9 E/ z" d1 x. L5 [+ I
        if A_i=A_leave then send to die4 e7 }* F/ u4 Q* _5 ]
        else inc A_i by 1
& a0 @2 |* q- c+ d3 K    end
6 y1 b3 K" ?$ X8 ^( q3 W8 ?4 Kend

最佳答案

查看完整内容

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是个什么东东?$ Y# q5 ]2 K% E3 O0 D7 q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 [" v4 Y1 I: e) V; m7 ~: ]' A3 }
) L% F" z" e; q; H# k) XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 C: y) V8 Z" B( o/ e0 w9 g. h6 P; h+ T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 d4 |3 E4 G7 g, z; c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ U) m* u* h  k, o9 R6 y- {. U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" e5 z0 b- D; A' ^: y1 B3 }6 r6 j3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 I# j' y; `3 F! J" r
begin P_induction arriving$ q4 X: [1 O) `$ f5 d$ D: _
    clone 1 load to P_pick(A_induct)/ e4 K7 i: W( S5 z9 P! k
end最大的系# ?* g" v5 e  f0 t# s
' r) ?5 M% {  L7 h9 H5 _1 s; P7 P
begin P_pick arriving
# C; v4 S: H/ o    set A_i to procindex * 10 + 1  C" I4 j; ~) ^  M* ?
    move into Q_induct(procindex)9 m( V( n: T) j. R+ H9 \
    move into pickaisle.induct(procindex)* w, I; ~1 w+ i2 r* {
    /*check the type of pickaisle.induct(i), for your last problem.*/
  o9 Y- E7 m* ^$ O/ V5 x1 ]8 c6 Q! z% f6 r8 u
    while A_i<=30 do begin
& B- G  p* c+ E/ z! W7 l        travel to pickaisle.con(A_i)9 E) T' T. B3 r: d) i, B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 e- L/ A. e" C$ e        else wait for 10 sec
' ?8 V) k: b0 R7 S9 c; p1 @        if A_i=A_leave then send to die
$ F" ?% x- [9 Z$ D* f8 W        else inc A_i by 1# k3 ?* ^! T  {& T7 T
    end
. {) f+ x5 A9 z! Q- t* }4 send% _, s) E: F7 }  f% f

* \( P4 J! C" d+ x) c其中的procindex为整形,代表当前process的序号。8 M3 a* X% F' e. s+ W
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-5-31 02:09 , Processed in 0.015576 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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