设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11602|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; g- B5 v6 A- N* ?1 L, @/ W. F0 q: I; ^; S# `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 |4 ~3 R1 @1 F8 B

' z/ p. I6 k' l3 w" x) x8 Bbegin P_read arriving
- f& d: h; L0 \3 ^. f9 k    while 1=1 do begin
! Z4 H) d9 V( M4 ~        read A_tote from "data.txt" with delimiter "\n"( {, C* y1 W7 ^% Q5 v9 v
        read A_time from "data.txt" with delimiter "\n"
8 N: T8 A3 U$ v! }) r, }/ k        read A_leave from "data.txt" with delimiter "\n"
$ g2 r' v/ A9 \$ g        read A_picks from "data.txt" with delimiter "\n"
' _/ Y4 {0 I& E- M        set load type to A_tote
  G$ x( H; o% g7 M) E2 f        if A_tote="tote 1" then set A_induct to 1) K" y2 n, \4 k) l) ?
        else if A_tote="tote 2" then set A_induct to 2
% S& m) @2 B! T* T) W# ~1 S) K3 \            else set A_induct to 3   
1 }, r2 B, [) B. H. h        set A_i to 08 x0 z. r, H2 X, C
        clone 1 load to P_induction
7 Q/ i% E6 Z3 T. g" e2 }" I        wait for A_time sec
/ q: [6 n5 |5 y% V5 p    end
4 P2 i! [3 e& f  q, cend
; P# `6 g8 S+ B& O  f! o% P
7 H  p# a; l' [begin P_induction arriving
4 I4 {8 \/ {# K& ^8 v3 L& }5 g    if A_induct=1 then clone 1 load to P_pick1+ {8 b2 Z" T6 \) Y! `
    else if A_induct=2 then clone 1 load to P_pick29 V- Y' B) R2 Q$ _9 t8 N  F8 x
        else clone 1 load to P_pick3
2 D6 M; I8 B5 f0 h0 `( zend
# V$ l/ p8 T# @- W6 H6 _" z9 s# P0 t
begin P_pick1 arriving5 Q6 p$ t- Y, F5 h
    set A_i to 1
2 v& }" m7 l: C  ^1 h( R+ |    move into Q_induct1) b1 U: d: Q, c$ G- G4 |% j
    move into pickaisle.induct1
8 ]  {# f7 {  U; `8 t$ g/ U    while A_i<=30 do begin% [" w9 ?: T9 G) y
        travel to pickaisle.con(A_i)
5 \2 |8 t/ Z  j' @2 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Y8 X# D9 g4 i: I        else wait for 10 sec
! ~* ]4 _7 n" S" o0 G& d/ G        if A_i=A_leave then send to die
0 Y, o. s0 o& M        else inc A_i by 1, H2 B+ V& |- A) K  N. [& i
    end
) J& b0 o5 j% @3 k& Send
- \, e/ D+ b1 l8 V- g
# D2 R. D- m. rbegin P_pick2 arriving, Z/ j8 ?6 S1 B0 U3 P( n2 N% `
    set A_i to 114 }. ~0 D6 w  R# L
    move into Q_induct2
. g; i# ]( t/ h8 U+ @    move into pickaisle.induct2! m) R" l6 f9 O' ?
    while A_i<=30 do begin
7 j2 ~/ B9 k9 X2 }2 d0 d9 }1 [        travel to pickaisle.con(A_i)
" s1 p5 X4 Q2 w- S, L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, j" n' b3 b- Z! f- q& L' v* T        else wait for 10 sec
! L( ?  G/ l) Q9 n9 f9 S" i        if A_i=A_leave then send to die
) G: c, d- G8 J  S        else inc A_i by 1
+ l; B; b0 N' y5 b" L0 v- Y& x) A( |    end( c* v8 \/ [2 _( b. @
end  n# @; |' q3 y8 j( ~' O
" w1 V. Q8 b4 W3 L0 r) b+ p& v
begin P_pick3 arriving3 p% A; |; x$ Y' ~4 [9 l) z6 m
    set A_i to 21
$ V& c' L6 ~& N5 G: Y% }; Z0 s    move into Q_induct3+ L8 u7 s! l" V& m$ d9 ~
    move into pickaisle.induct3
+ Z9 c% B7 X$ |' v) @( c" [+ v0 T    while A_i<=30 do begin
1 c% h" ~4 ]0 c  n6 X/ P1 \        travel to pickaisle.con(A_i)8 ]/ b6 [" E2 X$ E0 w  O3 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  @5 \8 h/ ~) z( }0 \+ j- X- {3 P        else wait for 10 sec
# n/ Y; ^; ?2 a6 F        if A_i=A_leave then send to die
% T$ D8 V% _9 l, i& |% k% W, L* O3 L        else inc A_i by 17 o0 s, y5 L! @! E
    end
! F* \( ?: v+ w! P  c5 I+ ]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 ]; |. u1 {+ m/ R7 g0 x% x9 o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 p7 a$ b* g( i9 O, n
) ?- T; }5 D- X
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# S& _, ^; `2 |* c; D5 C- g0 P) @
1 k, Q2 ^* J: t- q: G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 r  v! `; @: `2 ]7 I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( ?# Q; O% \6 T* D& r' P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 |; o9 \9 A) X1 c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- K0 i3 N( J( }/ V5 i3 P+ Mbegin P_induction arriving
7 Q0 Z1 r$ ?3 t! C8 Y$ l    clone 1 load to P_pick(A_induct)
1 d, l" t8 h, Z. u- E/ dend最大的系% C+ `( X, L" U. L2 ]3 r; r) V

, C  B" _! _4 D7 M$ ~4 rbegin P_pick arriving, [5 H- r8 _; o# S  n- s. u  a5 I
    set A_i to procindex * 10 + 1
" [( S* m# t0 [: l( E    move into Q_induct(procindex)0 L2 k3 \! G9 }8 R  h4 d) S
    move into pickaisle.induct(procindex)( n3 \0 W2 Z5 ~) ~) q) g7 _
    /*check the type of pickaisle.induct(i), for your last problem.*/7 w, r* f! O% \/ K1 U- U( ~

) W! X/ @) x( b% p: x    while A_i<=30 do begin
1 T- i; R8 d; Q" C# e% O        travel to pickaisle.con(A_i)
5 l( q, z6 L% G7 c4 h5 w6 z+ s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 l  Y3 W0 }$ }/ L' e8 |+ k        else wait for 10 sec5 v8 V- h  c/ M" o% p9 b8 x5 n! ]5 d
        if A_i=A_leave then send to die4 b2 s+ |+ W4 e$ T' u/ H
        else inc A_i by 1
( a8 I6 [5 [2 [, b. g6 q* V0 }3 D    end) n6 q- z! @9 R: y" D# s
end1 I  Y) L/ |* p, A
/ B' m) V' F& m7 j- R2 @
其中的procindex为整形,代表当前process的序号。
5 e  A: E5 {  F& E# B) }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, 2025-11-23 01:02 , Processed in 0.014447 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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