设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13492|回复: 2

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

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

' p/ u! Y9 K! G, Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 a% u% E- M! y* V
' K! P: i2 e  Q# wbegin P_read arriving
7 \8 N8 u' y* E$ F4 P/ `2 n    while 1=1 do begin
  _6 i% _* P6 y        read A_tote from "data.txt" with delimiter "\n"
* X& j* u- J2 f4 m$ d        read A_time from "data.txt" with delimiter "\n"
3 B) m0 q1 _$ ^& S7 H) H        read A_leave from "data.txt" with delimiter "\n"
0 S* h- H5 X$ [. M* a        read A_picks from "data.txt" with delimiter "\n"' N8 Y1 H  ?9 Q" ], I+ z; ^
        set load type to A_tote
9 ], M+ n8 K0 a: _) ?  Q2 M# F        if A_tote="tote 1" then set A_induct to 1
" |# w8 _2 _$ D8 F& m7 g4 |        else if A_tote="tote 2" then set A_induct to 27 Z1 U, v7 e# Y
            else set A_induct to 3    6 \5 W1 B7 q* \) c
        set A_i to 0
. L" V' m% T9 f# G* J3 r3 A        clone 1 load to P_induction
8 L2 x% B. C9 C/ {        wait for A_time sec4 Z5 S: E- j, x  E" H+ {! {
    end
, A0 R8 G8 r6 l6 uend
+ L* N% y, i. J: \( e. D! |# z) l
& I( f5 h' z' Rbegin P_induction arriving
% \4 G8 u/ c; `& s, P0 f9 A# t# B, C    if A_induct=1 then clone 1 load to P_pick18 o9 k1 p2 b; |6 t
    else if A_induct=2 then clone 1 load to P_pick2
) Z' c. X" H1 o$ j& D( ]        else clone 1 load to P_pick3
9 w3 x6 {: W' ^4 N: x; Kend
  w+ _8 `2 w" R% c, p) g  ~4 s1 K+ f) j1 w# D
begin P_pick1 arriving# `! f: N' k9 j1 [0 ?& m* n7 f# v
    set A_i to 1. d" J( g$ n' r! {0 Q2 T% ^
    move into Q_induct1
% o: u$ \" L8 j4 {$ V; v    move into pickaisle.induct1
2 g, u( H+ O' o2 j2 u2 ?  @" }- C    while A_i<=30 do begin: X+ ~- c4 v' p, M( u2 v
        travel to pickaisle.con(A_i)" }! n; N1 N4 C4 D7 {$ {9 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- x3 {" T. I1 C# Z% e+ Y9 Y        else wait for 10 sec, E0 O3 K1 ], ]  S. S0 P& h
        if A_i=A_leave then send to die
3 g& e/ z# x& j9 H! l        else inc A_i by 1
) ^, c6 a. h5 ^' x! r4 g    end5 s: }3 v/ G! a
end
- q) [5 |. @- e3 y
; n3 A  }- y5 T9 F* V8 V/ jbegin P_pick2 arriving8 j! f) v/ m$ G
    set A_i to 11
) m; {' i, N* m) W: n" O    move into Q_induct2
3 W" z5 v1 M( [% V9 E' [/ ?    move into pickaisle.induct2  Y" X6 I* D: \2 o" I0 G* q4 ?2 x& x
    while A_i<=30 do begin% r1 d( \, l, N( V& c3 {( M0 }
        travel to pickaisle.con(A_i)
+ J- F: {# [5 }- N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ]2 W, V7 ?' T' |$ A& a
        else wait for 10 sec+ D: s- i% T8 R2 y, v* x1 O& z+ {9 N
        if A_i=A_leave then send to die
3 f0 K* R1 U. g8 V* A        else inc A_i by 1$ x- j- ]- a, t  u# C
    end
: d3 i5 K- r6 K5 S# _7 S0 Zend
2 T' x' ~3 F3 k7 \: C8 C- Z3 I- D
begin P_pick3 arriving
! l2 p" p' R$ C, l" z$ C    set A_i to 21+ ~' S# G3 e3 Z; x' L
    move into Q_induct3
% |, t$ o) h4 x/ L% v    move into pickaisle.induct3
; `9 y2 r! ?/ i- t; y4 k    while A_i<=30 do begin1 q4 }3 Q6 x; p2 J, T, H2 z2 y9 H
        travel to pickaisle.con(A_i)! |- B' x' [: N6 E6 E- l# d) E% k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( g4 `! t2 z' @/ k        else wait for 10 sec6 u  Y6 C4 w2 L
        if A_i=A_leave then send to die
' d, ~; F6 `& j        else inc A_i by 16 F/ F6 h7 P( ?+ ~. Q3 S
    end
5 U7 D, i6 z. F/ [& u' [4 w, O+ ^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是个什么东东?! a$ r' n" D& h2 c8 F4 c+ C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; o1 T0 N# U& Y  p* H
4 i3 _4 F: q# ]0 J% [' e) H( U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% g6 L! l; t0 {- U. H
9 n5 d; i" H  x3 o' c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 o* W1 r6 \- K* \, k1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% t7 l& l$ Y$ H" P6 ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 _5 T; \+ g7 T: ~& n  f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. c1 O* x' H; e$ q$ j5 x' Obegin P_induction arriving; `) c( I6 @7 s/ |+ @1 {" B1 f: B
    clone 1 load to P_pick(A_induct)
- S5 H, C! S  i1 B  tend最大的系! u" F  v5 {( G% K

% N6 H0 ^9 L) H* q9 Z. obegin P_pick arriving
! w2 g) Y& k& F- v8 Y; O    set A_i to procindex * 10 + 1
* G# j8 y; A4 g* \5 u5 P) R# G5 r    move into Q_induct(procindex)1 ?* o: i# |& G
    move into pickaisle.induct(procindex)
' }6 s6 R! r. {1 j. d    /*check the type of pickaisle.induct(i), for your last problem.*/1 ]- n; {$ i1 Y, f" u+ P; i
/ U( o* `" j+ y/ c- J. i- N: @
    while A_i<=30 do begin" o8 d$ k' u# S( o2 C4 S) S! O
        travel to pickaisle.con(A_i); ], p6 c4 ?7 I0 O' F& W; c% G4 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 M7 z$ i9 B- h0 M  C( V  o: ~
        else wait for 10 sec
1 j; L+ @- g6 U7 q! g1 A) s        if A_i=A_leave then send to die
. s$ ^! a& g( W1 l        else inc A_i by 1
# Q& c! C* h' D% u5 ?    end% D+ G/ [! V7 ^7 n* `0 M, O
end  L+ L. F" c' ]4 n  _2 B/ _
& [3 @/ L3 H7 c( r( n: g5 q
其中的procindex为整形,代表当前process的序号。8 K2 j1 E* c! 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-4-17 17:59 , Processed in 0.017443 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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