设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13410|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) N+ v* V% Y9 a6 v8 S  W) x; E" ~
" h! U/ l! _! |) t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ v0 M2 v; t, v3 G( b
0 D- e) G. l1 w/ P0 q/ R, m% Y# g
begin P_read arriving' ^$ L. Y& \* t! C- _7 {$ j7 B: v
    while 1=1 do begin
5 M# N5 ~* Q1 U0 I( Q- T! |        read A_tote from "data.txt" with delimiter "\n"' y- s3 Y" B$ n0 h
        read A_time from "data.txt" with delimiter "\n"4 h$ a9 K3 A1 P; N
        read A_leave from "data.txt" with delimiter "\n": t+ S! ^/ {. f& L$ o
        read A_picks from "data.txt" with delimiter "\n": H) p; f3 }( f4 l+ Y+ F0 s- K
        set load type to A_tote' [1 D0 A2 G7 T* j$ E' t5 K
        if A_tote="tote 1" then set A_induct to 16 w, R. S# q) _+ h' W
        else if A_tote="tote 2" then set A_induct to 2
2 Z) Q+ g. }3 X7 _4 h9 S* i  M3 F            else set A_induct to 3   
. `: ^1 [% v8 @& h% y        set A_i to 0
8 Q* W" Z8 p  {* _" T        clone 1 load to P_induction
) x. y# g8 A( L. K3 b. O  q0 i        wait for A_time sec
& G7 I) r2 G8 T1 \/ N  D0 H    end
# Y  g) X5 f& ^- W" [" }, Uend
" X" A* V6 q" \# c# M& E! U1 ]7 F. S4 h  R8 n4 w! r% A3 x2 l
begin P_induction arriving- o6 P- C' K1 C: \: \3 H; P
    if A_induct=1 then clone 1 load to P_pick1
, G0 O/ s: q( K: q    else if A_induct=2 then clone 1 load to P_pick2$ @% A4 Z- ~( p' t! q! _! b
        else clone 1 load to P_pick39 T; ~! o3 T0 `/ h" o
end
5 h8 u2 f  d7 H/ o2 }( t3 k$ {
% q; p' ?% S, u7 \9 s) Dbegin P_pick1 arriving
; p* j( u: k5 ~  T) x' a. D    set A_i to 1/ {3 y$ j" y) n9 B$ k  h7 v
    move into Q_induct1# ^/ O2 w4 x% g4 D8 p+ o
    move into pickaisle.induct1* Z/ w  e# a( K: I1 e, h
    while A_i<=30 do begin
% H- q4 V' ~* }& u; M        travel to pickaisle.con(A_i)
  f* u  _8 i0 Y) u1 k/ a. V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" q7 m1 {0 k0 c5 x1 j        else wait for 10 sec1 z, h' l. o, A& N
        if A_i=A_leave then send to die
( L+ ?. e; `; \* |$ q( ?  S; _' I' D, m/ c        else inc A_i by 1' K3 s" {$ ^" c% S; x
    end1 J! Y5 X' o$ ]2 a8 v
end! Y4 t+ J6 S9 j+ |

6 Z" K1 T. x) J( [- f% g+ v* nbegin P_pick2 arriving
$ d3 u8 Q3 |( M    set A_i to 11* C4 `8 U7 F7 B  F* y" n
    move into Q_induct25 u1 [( C& A' I; H/ f
    move into pickaisle.induct2  ^1 e5 P) {( o% J0 L
    while A_i<=30 do begin
7 E% m% {4 o' z2 O% T, c* l- r        travel to pickaisle.con(A_i)
. r4 a# a2 c9 O7 i6 r3 K& T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# X0 S9 X5 q2 X1 c3 z$ h* {; e
        else wait for 10 sec. J- @4 [8 _. c
        if A_i=A_leave then send to die
( E# Z: }0 f$ R0 C7 _7 _5 J        else inc A_i by 1
* x& _; }$ V# U! y7 M    end
$ O$ Z' `7 U; b* kend
7 Q' `% [4 E+ W
, l5 f  B5 q. p) b8 Z" V- A; Nbegin P_pick3 arriving; a0 |! o2 D0 P) ]" I. H& Y
    set A_i to 21, t; T( n2 e: o1 D3 q( @; \6 i
    move into Q_induct3
/ ]2 w8 D+ m8 \) H    move into pickaisle.induct3
- b2 a* ]8 n- [" @" m1 ^2 [    while A_i<=30 do begin
# Z" |- v0 z& F1 A        travel to pickaisle.con(A_i)
1 y% F" U7 r; X. v: T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, T: w' d) |8 h& q
        else wait for 10 sec
! u, s- K, H& U, q        if A_i=A_leave then send to die
; k  B2 r; b$ M  U        else inc A_i by 1$ ~8 t" i" x$ M( Q5 ~5 ?2 x
    end/ H! X) t3 W# i8 [: Q6 m
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是个什么东东?
* b% s5 Z- ^3 _2 Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) @6 g2 A" J4 j( \  I0 |; z0 W2 R5 }
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 W2 w* v1 |9 p, `8 B$ e, F2 Q5 V

5 K7 J. g, X$ c: a: P/ ?* B; w% F) e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! E9 t- z% @' K2 d' A
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 ^8 y7 c' S8 n1 o" I# d
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 a2 f) @, e9 f$ [# @9 ]' A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ t  `8 p. T" ]8 a$ l8 F9 M1 ^8 Obegin P_induction arriving
! _  F. E, s' H  C$ t    clone 1 load to P_pick(A_induct)7 c- [# w& k4 ^5 _9 P% u( O8 g
end最大的系
. C0 t' c& Z- s. M* E
" r! F; A( j! u0 m/ i3 mbegin P_pick arriving
) l) U0 t8 e. h" i6 ?; a    set A_i to procindex * 10 + 1
" g  d- V; D" u; r    move into Q_induct(procindex)
' u) T" J+ I7 T    move into pickaisle.induct(procindex)  l& X1 z+ W3 U8 q
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 A- Z! \- w" R8 t8 g% _; |) Y. D& E+ }4 J1 K0 }2 f9 [) m
    while A_i<=30 do begin
- k$ u! l7 \% c3 [6 o8 I        travel to pickaisle.con(A_i)2 O9 l/ c9 H( P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" G7 \+ b! P0 ^- I
        else wait for 10 sec
& r& I1 j/ i3 _1 c- Q        if A_i=A_leave then send to die
/ S: a8 I9 L7 z$ a" }        else inc A_i by 1: d/ ?" C2 G2 }* q& Q2 y
    end
( T! Q1 w& M$ Q' e" Y0 V, |end) m& o, Z4 M% \" p

7 i9 i- w2 \8 V6 g其中的procindex为整形,代表当前process的序号。3 h( b# p7 x( ?8 }( e$ F; 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-11 03:31 , Processed in 0.019213 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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