设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15584|回复: 2

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

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

) u. g( ]3 A+ h% j( 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中的数值,不知道会不会有什么不妥。) h$ j# g1 k( K7 x' X# o$ Y: B( f
% k0 Y7 _* \, _
begin P_read arriving# A, h' j' l( }5 w" N3 Y- z
    while 1=1 do begin
" V- z2 [. F0 P" m0 K        read A_tote from "data.txt" with delimiter "\n"; I( I  _, w# ~$ [1 U9 q- B: D
        read A_time from "data.txt" with delimiter "\n"7 W8 F: k4 _7 d
        read A_leave from "data.txt" with delimiter "\n"
. b7 }) a8 D9 _7 y- T        read A_picks from "data.txt" with delimiter "\n"( F1 N- d- ^- _
        set load type to A_tote) V8 G; t3 x. E  b7 D% c/ Z
        if A_tote="tote 1" then set A_induct to 1
: R0 R" S% y% r5 Y7 Y        else if A_tote="tote 2" then set A_induct to 2
4 o! M, [0 m" T            else set A_induct to 3   
$ f6 b5 F, R# @2 m        set A_i to 0. }; M/ g! @/ h( M8 x& ]
        clone 1 load to P_induction. H; k: n( n* |9 x' {
        wait for A_time sec9 C" T/ ~+ `- d* g; P+ y
    end
* z" i% ~7 p# Z. hend  u# p& `' ~- z3 P  f" L" ^
! Y# n& J7 x5 X8 T
begin P_induction arriving
% L7 c0 K9 z! Z/ o  x+ Y+ g    if A_induct=1 then clone 1 load to P_pick1
, N% n$ {, _3 B: Y5 C/ R$ b    else if A_induct=2 then clone 1 load to P_pick2
. t2 `/ k/ A" _- n& T        else clone 1 load to P_pick3
+ R* s1 p4 X5 {9 H% Pend) \6 _# k# l$ y* f
# n: l  ?' r! ?: T$ g
begin P_pick1 arriving, b* W& a( {: X" Q/ J' ]* c! C3 u% M
    set A_i to 1
9 z' E1 f3 \  X    move into Q_induct13 O. E$ ]5 C" V6 \& t( g  X' {) s
    move into pickaisle.induct18 d$ M' D% \  I3 a# O- w: i
    while A_i<=30 do begin
9 t, A2 `3 k1 y- \        travel to pickaisle.con(A_i)
* L: k, G- s! e' t" ^/ {8 s$ k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 B/ M2 _  W/ r# w! I        else wait for 10 sec
! @- c; w& b+ _) t8 r4 E8 v8 K        if A_i=A_leave then send to die3 b! J' M; C9 x9 F! J4 q
        else inc A_i by 1, e# ]4 g6 Z6 A
    end
% j4 _, ?$ [; u5 X; b% rend9 f6 W3 y" O) ?& Y

. ]( l. r1 R, n* |begin P_pick2 arriving
' I; B1 a/ J  _3 D    set A_i to 11
- l3 f; r, x2 s0 M  p    move into Q_induct28 b  @8 g2 ~+ @. L6 x1 V
    move into pickaisle.induct2
9 V* s- u6 r9 m* Y    while A_i<=30 do begin
; W+ L* ?5 i$ u& H# T1 m8 o% U        travel to pickaisle.con(A_i)
' ~0 A) A- _. V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 {& F% I- ~+ ]* K
        else wait for 10 sec
6 G5 G9 H4 c0 L) h2 w* M$ `        if A_i=A_leave then send to die
$ M' ~0 Q) o  u0 f4 r        else inc A_i by 1, O- O6 p; u0 [% N3 |
    end
3 \5 C& [- r0 _end
4 @- n- p& [" M* G5 X' V! a" G- W
' J2 S& X' u( x; F, Z+ d2 Vbegin P_pick3 arriving3 L" z7 Q0 c$ R6 r2 o4 U' w8 W. W8 V
    set A_i to 21" G' X3 v: ]( Y% D6 A* Y1 R& w
    move into Q_induct34 c& x" G! x; ~  |6 E- y  r
    move into pickaisle.induct3
0 p: J" ?: ~; l' c    while A_i<=30 do begin: g/ [7 J6 t1 O3 B/ z; x& P
        travel to pickaisle.con(A_i)
! |8 i7 Y- A+ @! |+ c! Q4 Z% K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 c. C" g; ~) H: L: p- p
        else wait for 10 sec
, @" Z, j% d0 j' x" B        if A_i=A_leave then send to die, B( p6 ?- a- i8 a$ G7 F$ l+ e+ C! W
        else inc A_i by 1
$ g) S( R0 ^  a; [) }" u    end0 u" U5 K" t! E2 m0 `
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是个什么东东?
4 _  e- p% k( T+ Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' a$ F5 G$ S! `7 i; r# X  r; g; Y* t! P. d7 \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* c0 L' K$ R. E- U3 n' f2 J

" y9 ]( P/ D' l9 c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. Z' F$ g& u' e$ e6 O- |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( b; d- m% W4 W- t6 i2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) {, d- [2 g' {+ H0 s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ S3 U( P2 D% @5 k! j6 lbegin P_induction arriving* ?1 O) V0 x! K8 L
    clone 1 load to P_pick(A_induct)
$ s1 o5 R* k9 u& fend最大的系
3 a+ Y/ k5 z3 F4 J* Y* h2 U
- e) e  B9 p! C, t; E, r- @, Tbegin P_pick arriving
5 [2 a: T# c- l6 Y    set A_i to procindex * 10 + 1
& ]+ }5 X7 K" [9 k    move into Q_induct(procindex)8 E$ `% b# e7 \  l! l
    move into pickaisle.induct(procindex)" b; w  N9 ]( J, s  d4 _
    /*check the type of pickaisle.induct(i), for your last problem.*/& X! F* n; v9 V  B) X
1 h- ^" z" B/ _) S! t; n5 U3 S
    while A_i<=30 do begin, y- y& [8 L0 }3 s5 V- T0 I( a
        travel to pickaisle.con(A_i)2 h% C4 X1 F9 C9 e( t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- t* x* d. d, R6 V# Z
        else wait for 10 sec% g* y  A& w7 R* f5 ]7 L4 @
        if A_i=A_leave then send to die
# m: A2 q. Q, o: G  r        else inc A_i by 1* Q4 B3 ?8 C# q$ z# d) F
    end$ ?7 V' E5 @3 V  d; Y
end! ^" b% y+ Q3 l4 }+ |7 g

4 T) U! \. M8 A. K$ N其中的procindex为整形,代表当前process的序号。4 V# A7 w, O1 p' C. x
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-9-21 12:45 , Processed in 0.015926 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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