设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11268|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% v5 K7 }- v% `: I
! ]* R3 B" X3 W& R  I  G8 V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 c; v: m; H9 p8 G4 p& ?) z' e& N1 b0 n! e
begin P_read arriving8 l' m9 M" s* {, u/ j8 |
    while 1=1 do begin3 v" J5 g. V* h. I1 V7 X9 ~6 W
        read A_tote from "data.txt" with delimiter "\n"7 x) \0 t1 J  e# `2 ?. e& Q/ R
        read A_time from "data.txt" with delimiter "\n"- E4 f4 c* G* \/ @  I5 V" a9 {! t
        read A_leave from "data.txt" with delimiter "\n"9 \/ Y& }$ w/ z
        read A_picks from "data.txt" with delimiter "\n"+ i% M. D4 p! m6 y
        set load type to A_tote
4 [8 n! r& S0 K8 a& O+ K3 I        if A_tote="tote 1" then set A_induct to 1
; n- z' Y5 E. m0 k        else if A_tote="tote 2" then set A_induct to 2
3 O6 n3 I; T1 Q9 \! T" f            else set A_induct to 3    ; C. A1 U  U- p  `8 W  [
        set A_i to 02 g# {6 L& M$ Q
        clone 1 load to P_induction" n/ P2 u) i7 B& j
        wait for A_time sec
- Z- I, Z7 O9 @3 ~0 V    end3 ^1 n6 W- [. P# {3 O  t
end
& X- K& s  R( m! H: w$ m$ K3 a; O9 j7 ^6 d
begin P_induction arriving
) Q# u. l+ R' \5 [1 K& ?1 D    if A_induct=1 then clone 1 load to P_pick12 V8 \  r* ^$ r
    else if A_induct=2 then clone 1 load to P_pick2; e: M; B9 K8 i
        else clone 1 load to P_pick3
; p, \7 M8 e8 N) O, iend, g! a9 s8 n4 O' [7 K- [2 ^

1 m' V! W7 u2 V9 l. x( Dbegin P_pick1 arriving. m( q6 v: t. F; O" i( n
    set A_i to 11 b% F9 P+ v/ K/ r- J
    move into Q_induct1
. K. R, E2 B6 [. L: D9 G* p: h. M    move into pickaisle.induct19 v+ P. w* ^& O& I" |% h( }
    while A_i<=30 do begin1 I' v! R5 T0 k1 B* k
        travel to pickaisle.con(A_i)3 X+ ?! E0 j% x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 V: x5 Y& U/ I
        else wait for 10 sec6 N+ u  z& C) w: @2 o. g( w
        if A_i=A_leave then send to die
, I! W  d& c. I        else inc A_i by 1; R- R# z4 C& t( F2 r9 Z
    end* L, Y: h- W" B. q% R; o! s8 C
end1 ?- x( S6 Q1 c$ E' _4 Y& ]

5 `: K' A9 n8 M0 y3 B; Mbegin P_pick2 arriving' Z* g& |( H& {3 C8 T1 `
    set A_i to 11, X* T2 D2 C" I3 A- d( ?% c! a
    move into Q_induct2  x. t5 c! A- l( `6 n- G: T
    move into pickaisle.induct2
/ V6 J* b8 H* ?9 h! _0 y    while A_i<=30 do begin
9 w/ h; [+ x7 s7 i# {$ w2 N6 `        travel to pickaisle.con(A_i)) w5 j) J# C$ }$ o. F( x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) p- A4 ?( \# b" a' a3 [& P5 T        else wait for 10 sec
+ ^# P9 X4 {/ w7 W        if A_i=A_leave then send to die2 }5 s/ K: |7 {6 K8 F+ B! S" Q
        else inc A_i by 1
) F, ?% P3 ~* [! z: j    end
/ B2 ^7 j/ v* `! aend
) @% f* W' \4 L' G6 m, D5 F% }. |/ g; o
begin P_pick3 arriving# W4 ?5 e2 U1 n3 G
    set A_i to 21' U# e: K0 X; a/ K% H
    move into Q_induct39 J! G8 H/ D! _- C  x
    move into pickaisle.induct37 }9 C# W2 s: `- ~8 a+ f
    while A_i<=30 do begin
$ t1 V$ w+ _8 o% p/ W& j        travel to pickaisle.con(A_i)/ g- ]  c2 y4 _3 @8 m. ~0 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! \* v  v) t; }3 b- i0 q* ~; g        else wait for 10 sec
' q" e( f4 s% W( s! i        if A_i=A_leave then send to die# K5 m! d' z( m0 j, D" r
        else inc A_i by 1$ f9 }( I3 U- {/ s( f
    end$ q3 p8 K- w4 ~8 ^$ n7 X0 Z3 Q& 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是个什么东东?& F$ C8 i  x% `+ {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 Z: K( `' s1 T4 ^( \, o
" {$ ~5 u' h2 N% |  ?4 `% J! k/ _* \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 [1 y) K# w8 }. q- a

) j; [* l3 b+ c5 J+ f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  Z+ O" E. l+ x4 Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) c  X& X. S: O) i" [) I7 B2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 j3 W2 Q. R5 N" E% V  \6 W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 X" E3 a, G: ]. y8 {( r" ~4 rbegin P_induction arriving
7 h  ?( _7 i: `& G    clone 1 load to P_pick(A_induct)" t! t) g2 \1 f- {! a" h
end最大的系
$ q0 p$ d# ?) f9 y. _
$ m# G- T1 \; q, M7 Dbegin P_pick arriving
( w6 v0 ]" F' P    set A_i to procindex * 10 + 1
: ^4 X: A4 A' }4 v, o    move into Q_induct(procindex)$ s. `& t/ c1 m4 I7 L8 ?
    move into pickaisle.induct(procindex)
4 ^# I" a) V! Q* ?: x( ]    /*check the type of pickaisle.induct(i), for your last problem.*/
& A& f/ n: L: n  [5 Z1 z; T8 Z- X! ]: \* X* W+ @; D0 @
    while A_i<=30 do begin6 T& y# s0 i( H+ B2 M
        travel to pickaisle.con(A_i)
  G5 Z2 [8 h# @4 d& M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, A' Y% n2 j  w9 [
        else wait for 10 sec
) P  @5 E6 a2 K) z  \        if A_i=A_leave then send to die' I- \- v+ c8 B0 e. o$ P+ w) C
        else inc A_i by 11 m& l( n! A0 p# s+ s0 O( U% y
    end
" f' K, A- q, t* t- \6 B+ rend+ {4 l8 q8 [% w9 `3 |3 N9 D$ J+ h

' k1 ?5 K/ ?$ D1 q" h其中的procindex为整形,代表当前process的序号。/ ^2 P, K# q7 v0 W" ?8 W; l. ^' ~
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-3 14:54 , Processed in 0.016460 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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