设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13907|回复: 2

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

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

3 T9 z6 y% Z! D& n我的问题是,在每个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中的数值,不知道会不会有什么不妥。) t. d1 k. b, Z0 B7 b/ o$ Y
, I  g* q; x- k( V- Z8 e# V
begin P_read arriving
, U! y- _4 d) e  `0 `( G* ]5 j+ F    while 1=1 do begin' p1 ~0 `9 x4 o; M  k; V" G2 R
        read A_tote from "data.txt" with delimiter "\n"
6 S" c9 v. P; n" w        read A_time from "data.txt" with delimiter "\n"
: s& V  h! r) \6 H1 z        read A_leave from "data.txt" with delimiter "\n"# G  s! V( B6 B& }2 l" d) ]
        read A_picks from "data.txt" with delimiter "\n"( c5 @2 P2 h6 \
        set load type to A_tote4 T! O' v6 K9 s/ F  n$ z, N
        if A_tote="tote 1" then set A_induct to 1' m$ S5 x' T4 R3 K' T5 K
        else if A_tote="tote 2" then set A_induct to 29 D; w$ ]. j2 M$ J8 v8 |0 W
            else set A_induct to 3   
  l  |2 K5 [) g- s  B7 g. N, \& R        set A_i to 0
* k+ i% [& N9 b# n- X        clone 1 load to P_induction. V8 a! v0 ~& g( i' T' P
        wait for A_time sec9 Y& v1 d* A. W. S" J0 S% g& Q! w; a9 b! T
    end
( f' i3 r7 Y- @& J: {end
% T* q: g* R& h
5 K: y5 n$ ~  E, Qbegin P_induction arriving
+ M8 |( }1 ]/ K, G    if A_induct=1 then clone 1 load to P_pick1
9 r" B8 Z9 e6 }2 n    else if A_induct=2 then clone 1 load to P_pick2
9 `0 y. d  c0 I, ^0 w        else clone 1 load to P_pick3
6 b- m5 S$ P5 L6 O( ^7 I9 `5 Kend5 J  P% X3 D. U4 `+ p! Z

% t* @2 S" U4 abegin P_pick1 arriving2 F, T5 y9 r, j4 Z, Q1 b
    set A_i to 1
! P& p' w8 {$ h  ~" B    move into Q_induct1
. z: i* t; H/ X; {& I+ J9 A/ u( s    move into pickaisle.induct1( ~: q/ p8 M4 ?" T* R  @" ?
    while A_i<=30 do begin% j" ~$ p1 C/ j
        travel to pickaisle.con(A_i)5 J# A+ n: d$ W5 b" G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- g8 z7 y8 |: i5 `1 [
        else wait for 10 sec8 j3 B' `2 f: b* g2 C" L5 a/ B
        if A_i=A_leave then send to die  a4 i% M  q. O- }" `) E2 h
        else inc A_i by 1
9 J8 d6 ~) s# b7 K( S    end( C4 S1 b  }/ h% D, ?7 ?
end1 r  D. H! L: Q9 Z5 X' y$ N

3 P6 U, L# }, H; q& B0 h- k, K9 ^begin P_pick2 arriving
$ `: P. C* J# d; B+ g5 F/ `    set A_i to 110 m( o( x8 J7 ?4 E8 }
    move into Q_induct2" h5 }- a) w) `( B- \, w0 J
    move into pickaisle.induct2' X/ h6 A* B+ |0 u6 H( Y5 ^$ H  C4 V' N
    while A_i<=30 do begin6 ~. F& I; X+ O7 e" E
        travel to pickaisle.con(A_i)7 N0 c" A: ~9 x5 b! V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ d! j% T, q' {6 U; |
        else wait for 10 sec
- \: W3 d0 D/ I0 G; q  y& q- s        if A_i=A_leave then send to die+ _1 S% [6 A  l5 }4 _4 M$ G
        else inc A_i by 1
" n+ G" j/ ^' h$ U    end
" n0 @5 T, \8 ]0 M: Y! @0 {/ jend
1 i5 q4 p6 B0 y( K# N$ R$ u  X6 Z! X% N; E, Z
begin P_pick3 arriving! U. j% Y$ S7 P& }9 H5 b. z8 ^
    set A_i to 210 w5 \4 T( u, i; t/ P, _, r3 R
    move into Q_induct3. _3 W/ U) X0 Y: ]
    move into pickaisle.induct3$ S- \- h. N# g* E8 K' n
    while A_i<=30 do begin5 X) @; b& u, k$ h
        travel to pickaisle.con(A_i)
. A) O, `4 q3 k% \% Z5 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 d0 b) z. B1 ]" ]
        else wait for 10 sec5 G- j; D5 N0 g. ?1 a2 S* v# F$ A
        if A_i=A_leave then send to die
5 D) _6 s, k( S( s1 y1 P! A        else inc A_i by 1
3 T- `4 |% f- J; M4 P% @    end) U, I) ]) o# R5 H
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是个什么东东?8 R) H0 P: b- G+ W! `% A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" P5 ]: C9 k$ }% b6 g/ I  S5 P  {2 [
0 _" \0 L1 K* n7 `" b* M  d" k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ ~8 g: W- h: U9 @) [
, t' F3 a: s. L; W4 Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 Q) Q0 a6 a  G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ l# S- _- }+ G' e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 J1 J# i% C  k/ j: b, K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 F5 h, R+ ]  M& `/ mbegin P_induction arriving
) w% w7 \6 s0 L2 e0 d    clone 1 load to P_pick(A_induct)9 p- V% Z+ Z0 _' J8 A
end最大的系# M$ E0 `4 ?6 p% l7 v
4 S* S+ h8 {9 L- L; p! n. n
begin P_pick arriving5 g8 C1 o" P% \2 E/ M0 b
    set A_i to procindex * 10 + 1
. s2 L5 Z! H' Y+ o% N    move into Q_induct(procindex)
; A8 A; w5 U# w- o    move into pickaisle.induct(procindex). N- C- d6 n( K
    /*check the type of pickaisle.induct(i), for your last problem.*/9 ?. @$ \5 d5 z& r/ c1 T) ~7 _
3 m4 L( `: i2 E1 G
    while A_i<=30 do begin' R+ N: x) u6 A  z( u
        travel to pickaisle.con(A_i)
9 g4 m- l3 P- [* x# g1 V+ u* r" z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 q2 x. x6 F& C4 U- t/ v        else wait for 10 sec
' o) ~8 H( n) J+ B7 a' @        if A_i=A_leave then send to die0 L1 W/ @0 p( J: v( n
        else inc A_i by 1
& Z$ S! C# T! M# z    end
  `/ Y" K4 Y6 N# h0 J- X, fend+ |* H! V$ f5 S  X1 o1 B) C

2 W1 ?7 O; V4 b8 ]0 C, m3 v8 |其中的procindex为整形,代表当前process的序号。% o% h  g4 v8 G* D9 q
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-17 19:44 , Processed in 0.018767 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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