设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6210|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' ^* u( _3 M1 k* {# B1 p( h6 L2 J  t/ N4 z5 B# Q8 b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! `! B' S: [' Q" c) x$ O* d/ r/ ^1 B7 K& ]% A" g1 ]& @) C- V+ N
begin P_read arriving
0 X7 |/ ?7 \, m4 ~  K# H    while 1=1 do begin0 ~1 ?- z7 D; e3 h- z
        read A_tote from "data.txt" with delimiter "\n"
2 \' y# ?' U* @& G9 ?$ P) T: r        read A_time from "data.txt" with delimiter "\n"
6 L% r/ a9 g" `        read A_leave from "data.txt" with delimiter "\n"! G* S  x% Z, g9 g3 Y
        read A_picks from "data.txt" with delimiter "\n"9 E' A/ n3 {! P0 f! U2 j
        set load type to A_tote
0 E- a( ^3 I( u$ E        if A_tote="tote 1" then set A_induct to 1
  y/ ^5 k4 M7 |2 B        else if A_tote="tote 2" then set A_induct to 2
5 r+ e+ h; L  w            else set A_induct to 3   
/ E, `; N: w9 L2 a! K4 V' ~8 _9 s        set A_i to 0( [+ P+ f9 l$ c7 E
        clone 1 load to P_induction
: {% F( P6 G. Q        wait for A_time sec
2 l4 S/ z3 ?8 Z    end$ H4 f. u% F% O: A
end
  F1 T) V. \: X' I% ]4 Q7 l9 K8 z9 s. r+ s0 B- K* X9 z2 J
begin P_induction arriving4 i* J2 n  |4 s
    if A_induct=1 then clone 1 load to P_pick13 D( j; |% T5 w( r
    else if A_induct=2 then clone 1 load to P_pick2
" s  j, n( B; I" J1 x" P5 s        else clone 1 load to P_pick3, r+ |4 K# ]" K3 G
end
& w- O; `! V: t9 |
! Q+ D% H# ]1 v/ h* r7 abegin P_pick1 arriving# e/ o& D6 q3 S8 L
    set A_i to 16 h$ c9 U$ O& F; G- e
    move into Q_induct11 z/ B! R: `$ x1 m, H" W2 T' s
    move into pickaisle.induct1
) z+ q) }2 X: Y9 W" {3 h; @, X    while A_i<=30 do begin
' e- [$ {4 S6 I- a4 v        travel to pickaisle.con(A_i)
5 S( v& h  a8 h) b+ n* G- ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- p! `$ P5 B/ n, N( p( E
        else wait for 10 sec
0 z$ ^0 a/ r' e! g( o! ?# x        if A_i=A_leave then send to die
3 V1 o1 J8 t! g' I        else inc A_i by 1
5 g# n: R6 a7 g" k0 o( V! I5 v" S    end3 L% U3 j# G4 H2 P5 T( @9 f9 V+ Z
end+ d* F+ O2 Z. ~

  W5 p; e/ a" P0 J% S4 S# Kbegin P_pick2 arriving
% }3 H8 T; U  r" [0 f7 ~    set A_i to 11
7 I4 A- ~- M1 b" G; t    move into Q_induct20 R/ I; {; m6 J3 Z- g* U0 s
    move into pickaisle.induct2/ z: x4 y- g6 L: u" ^
    while A_i<=30 do begin
" B, T6 l, f, ?        travel to pickaisle.con(A_i); B! c" l- E# m; B' r% K, U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( g' g6 h5 M; u$ d8 h- q        else wait for 10 sec- C5 T5 ?0 _9 R( p
        if A_i=A_leave then send to die
) J: L! d6 g* C5 c4 u        else inc A_i by 1
5 q/ [& H6 w8 F) g    end
: n) ^$ i0 \3 h) k% `end. K7 Z9 ~8 u/ ~+ d# p  C

) ?  y( y4 A2 qbegin P_pick3 arriving9 {4 n7 {0 w/ l/ s$ M
    set A_i to 21- [9 i" l2 u# e- w7 ~; b
    move into Q_induct33 f, d: [: k( X6 T* R) d& I
    move into pickaisle.induct31 O, R- l' {8 i. ^5 c
    while A_i<=30 do begin
2 M" V4 O8 s7 f5 g8 y( A+ t# ~        travel to pickaisle.con(A_i)7 l8 c0 g* H# b- S1 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! F8 g& }8 i% G4 t) W7 g7 \% \; b        else wait for 10 sec. w9 F( ^9 V" n( O; N$ b3 s
        if A_i=A_leave then send to die+ K5 j+ N5 C& N. w/ q3 C; c! {
        else inc A_i by 1
! {  y# ]# C9 c) E    end
- q. Y' \) e% f/ Aend

最佳答案

查看完整内容

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是个什么东东?
  w( d% K0 V9 y! gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. \& t4 ?: |" Z
0 u+ U# z# L" A5 n1 t* _0 U( J/ m/ `AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 F, D( L! `0 C, b! A$ {

" {" T  f7 }2 v另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! }3 F# j' T, ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# C2 ?) F2 x3 V: b. u$ f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% S* K; Y. c% f3 S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 g" ]0 g6 }' y
begin P_induction arriving0 X, I* b; T9 j
    clone 1 load to P_pick(A_induct)
+ [* z. P- j  E! y9 R# Kend最大的系% y; c% B. S5 s& p
) U6 M! B3 \, ^4 l. z2 T
begin P_pick arriving
/ z. y9 m; U& m) [0 g, V* y    set A_i to procindex * 10 + 1, z! h0 s( r! F8 u( y
    move into Q_induct(procindex)4 a8 Z$ L7 \3 f: K% G8 ?6 T
    move into pickaisle.induct(procindex)6 h( O$ G  U0 Y- G" K3 t
    /*check the type of pickaisle.induct(i), for your last problem.*/7 w- b5 i3 ~4 d1 E" O
* z  e( ?. `" k' ~/ C
    while A_i<=30 do begin) C3 G0 {: S- j) C
        travel to pickaisle.con(A_i)
) ]. D( o- l- `" @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: A  L! N; s1 A; p
        else wait for 10 sec
& g1 P  e, F( U2 m3 ]        if A_i=A_leave then send to die
: I2 U( B! p( X- C% t. U: P        else inc A_i by 1
- L. F; i* d$ K7 I    end
# v6 @  h) a/ f. f  dend
2 R$ K( F( o' z6 N/ o! ~5 B2 t! [
其中的procindex为整形,代表当前process的序号。) u3 T1 P! M- g+ d; X( ]
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, 2024-4-28 14:14 , Processed in 0.014169 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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