设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12951|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. C, x6 ]4 e5 e4 P. a5 h# n

: `1 Y: G' R/ U, ~0 O我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 W' E7 f: ]3 @5 ^" S5 X
3 O4 D8 B4 _5 H  h$ y$ _/ |8 O6 E
begin P_read arriving
9 q2 M/ l3 w3 N/ J; f5 Z    while 1=1 do begin
, u/ E. T3 u/ G' G9 |        read A_tote from "data.txt" with delimiter "\n"
/ K. P; O# e0 d* W        read A_time from "data.txt" with delimiter "\n"7 |. {. G- h( c1 ~7 s7 l8 d& \
        read A_leave from "data.txt" with delimiter "\n"
) L; m! u  R% B5 R* u  p        read A_picks from "data.txt" with delimiter "\n"
/ w6 V- f# X+ Q        set load type to A_tote5 M. c. D+ e- x
        if A_tote="tote 1" then set A_induct to 1
$ v/ b5 ?2 k, W* D        else if A_tote="tote 2" then set A_induct to 26 Z3 w" t- G4 k3 y$ b* G1 G$ a
            else set A_induct to 3    4 o- r# t1 G# W* h% P
        set A_i to 0
: Q' m" h! R, x        clone 1 load to P_induction: F( W, m1 z- U! e# b& Q
        wait for A_time sec
+ d! O( l8 |! ]! u) f0 Y) |0 w    end: g9 N% q. T: g3 X4 Z+ W7 Z
end6 y: R7 o. W4 ]- R7 G

0 w5 s+ f8 s: x+ B% e& ?begin P_induction arriving! I4 w. _) [6 i) J; N4 f
    if A_induct=1 then clone 1 load to P_pick16 X) b7 `3 T6 D: [9 f
    else if A_induct=2 then clone 1 load to P_pick2
; S8 `' w# Z+ O$ s+ m$ G        else clone 1 load to P_pick3
# k7 p  W, W/ F* ^# y! i' Xend( `* Y( A% ^: g# |1 H! W4 z7 V! L4 }
3 K' R* ?3 [" j1 _% d* W  Y* u7 ]
begin P_pick1 arriving
5 \1 R9 }+ l/ X1 s: Y* I    set A_i to 1% S; Y; F- `$ S9 w8 a
    move into Q_induct15 S+ F( a) i+ x: h4 T
    move into pickaisle.induct1
. K6 @1 K. C" ^. b& `+ r5 V# o6 ?    while A_i<=30 do begin6 o+ D" Q/ V" z# d
        travel to pickaisle.con(A_i)
/ }6 n* x9 k7 j$ I3 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ W1 @, X  I! e4 @9 J/ S4 W
        else wait for 10 sec7 R9 f) {7 T8 t0 A" {( T: N
        if A_i=A_leave then send to die
& k, [5 t3 x( t        else inc A_i by 1
% b' E! ], s9 R+ f. Y: t    end
. d0 b1 r" ?' @1 Eend
5 j+ `# v. O6 s: k, L- l
3 j. J, Z2 S3 J: @begin P_pick2 arriving6 ]; `" z7 u/ P: L  [
    set A_i to 11$ o$ m; b4 g3 V9 @' ^- h$ F3 Q
    move into Q_induct24 W7 G3 ^) ~. R" ?! x& X) h3 Y
    move into pickaisle.induct2
/ f% p4 I# b. a    while A_i<=30 do begin( [* d$ g+ [0 ^
        travel to pickaisle.con(A_i)4 g: [4 d  ?( I3 H% ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `/ L/ E! p. e5 V' U$ O$ B        else wait for 10 sec
  L; X: a& T4 @% K' O        if A_i=A_leave then send to die
. U* h# h: l  n/ Y0 _1 ]5 d        else inc A_i by 1, Y, q/ @. \2 P( H
    end
. b* C- U' x* r+ r% aend+ U* [/ {' R1 X3 a

8 Y% b) o2 h- L4 V! jbegin P_pick3 arriving
7 p5 I' W% c3 B5 N% ]% e) }    set A_i to 21) n+ U  u1 r6 D+ ^9 H- E7 {# r
    move into Q_induct3
! V  h* b% u+ X) b3 Q: f) [    move into pickaisle.induct3
& X, E. W) p1 Q' `; z    while A_i<=30 do begin
% A, e  @1 r; L+ L, b. u1 u) q        travel to pickaisle.con(A_i)$ J( }% r3 J6 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ~$ _  y) E& E( S        else wait for 10 sec
5 F6 A, D+ ^6 g# w        if A_i=A_leave then send to die
- W3 S% R4 Q8 M) @        else inc A_i by 1- q! j7 c* E9 ^- K
    end* \3 @5 ?3 D/ `4 u2 d
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是个什么东东?
9 r. e- |5 G' p! W+ Umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, n& R  E1 ^2 b  D( e$ u6 x8 g% ]' l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( b8 Y- u" l& O; l! U4 Q* l, I/ Z0 P- B
. E- [$ H( a: X/ X1 Z4 `6 A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' F1 Q, i8 ^! D4 V: T: l7 x! q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ \# Z: @) Y* ?/ a$ @8 f8 r; A
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ C# @, ?, ^0 v3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 J! R$ }$ ~3 e$ B& x% M. {
begin P_induction arriving' O! `( z' V6 c. C+ N1 c2 L# J
    clone 1 load to P_pick(A_induct)
! F1 S0 h" d* l+ r1 T2 D! kend最大的系! j9 g) M8 [: I) ^' M$ o
0 Z, z! [% |3 I
begin P_pick arriving
+ h- J( g  @8 ?" ~- h    set A_i to procindex * 10 + 17 ?" D+ r/ Q$ E$ |- F
    move into Q_induct(procindex)4 Y/ o0 J6 T, ^% ^4 h; V, k
    move into pickaisle.induct(procindex)
7 j( v3 _$ j6 `. w    /*check the type of pickaisle.induct(i), for your last problem.*/
. E% Q, a2 a4 ^0 M2 Z/ w8 b$ A
" n9 O8 V9 [" N' V3 r6 X# B; X    while A_i<=30 do begin5 P  K# s/ T, P# x/ V
        travel to pickaisle.con(A_i)+ x, r/ b; [0 @5 a1 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% L/ Q4 h; V% x2 |$ O  f
        else wait for 10 sec' V/ N/ T( t3 r* [5 V9 ]. e4 O
        if A_i=A_leave then send to die
% p" @3 C/ \7 R9 f4 y2 y        else inc A_i by 16 ^$ p/ `( b6 t8 Q
    end
) c: T& ^  Q$ j. ]' |! x( }/ Rend
2 s. ~% G4 Z3 h# s) F3 f# ^7 v4 V4 ^' v
其中的procindex为整形,代表当前process的序号。
; P- F8 q& I" S! {9 Dstation和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-5 05:40 , Processed in 0.024794 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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