设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15527|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 O9 k+ Z+ `4 D: V; F. U" S8 T1 n4 F( J
我的问题是,在每个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 `8 k3 J, V4 C9 P  r( y

/ h& x9 P9 X, K7 u7 ]% d* V2 hbegin P_read arriving+ ?% A! @& \: o
    while 1=1 do begin
! I& P/ @/ C2 c( M3 G8 k" ^        read A_tote from "data.txt" with delimiter "\n"& C7 L- F' j4 O0 A* W1 r& }
        read A_time from "data.txt" with delimiter "\n"
0 V1 B% j, q* C% p        read A_leave from "data.txt" with delimiter "\n"" l- Q6 j4 t4 }5 ^
        read A_picks from "data.txt" with delimiter "\n"& A0 k, f6 w. V* }/ r: b
        set load type to A_tote" y' M% x4 k2 D+ P
        if A_tote="tote 1" then set A_induct to 1
  x# K5 P, V( V; v7 K7 |        else if A_tote="tote 2" then set A_induct to 2. v; X. R/ v9 N* T
            else set A_induct to 3   
$ h5 P  l0 k1 D* y        set A_i to 0( i8 ?: l8 x' f+ Y  _4 ]4 j  n
        clone 1 load to P_induction' Z7 R* }" X- q' P, a$ k3 N
        wait for A_time sec7 U# [* g7 G" `$ |3 H
    end
3 b) ]- Q) {2 O+ y- X+ ?1 k+ Yend$ s  M3 r1 j( d) c: R; Z: f

2 ^. Z6 r0 }1 V1 Y3 \begin P_induction arriving
" P! Z+ Q; J1 O: M) Q* ~; U    if A_induct=1 then clone 1 load to P_pick1
7 g/ {% O& G2 F$ e# z    else if A_induct=2 then clone 1 load to P_pick26 Y6 d! V8 T$ |9 w. |3 D+ Q$ n. E5 ^
        else clone 1 load to P_pick3
* V! E8 n! x9 v- o/ k" D# {% bend
. f, l9 @8 z  P. f" `7 e! H, e1 b5 L  }5 E
begin P_pick1 arriving0 E  Y, g* x. m" L( \$ ^
    set A_i to 1& B2 f0 T, J9 w4 |% Z% g9 f
    move into Q_induct1
5 S9 i, O3 ]5 u- J: I' f  f2 E    move into pickaisle.induct1
4 v. |3 }8 p5 f- G    while A_i<=30 do begin+ A, n. [! s/ a( w
        travel to pickaisle.con(A_i)
* `- @% d& r; t; X0 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" n, M' D% V. @3 A. D6 {' Z7 u2 o
        else wait for 10 sec# t% A" H* @& G& Z+ r7 a8 w. y
        if A_i=A_leave then send to die
" f% ?2 C4 `& `4 ?# K6 N+ B        else inc A_i by 1
& U/ M/ R8 e: S    end8 b7 W2 @' h7 r; O5 |% m% N
end
  U+ P' W1 t0 W
2 F1 O, }- S0 w4 ^* |& ?begin P_pick2 arriving" S2 j: `+ z( ?. c+ l
    set A_i to 11% |. W4 P7 W* a+ u( Q& b# q0 T3 i
    move into Q_induct2
6 S9 j+ J$ n$ C. p: s" r4 n    move into pickaisle.induct2. Q& r6 R' e1 k  N( K6 N0 M
    while A_i<=30 do begin8 q0 b+ s" @) R, t1 [: F3 A' R. R
        travel to pickaisle.con(A_i)
) B6 y6 a% |  R8 I2 k( I' L( ?+ ?! M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- |* P7 w9 ^" I9 u( }
        else wait for 10 sec
. M# c+ K! N, R/ N. l9 a( Z        if A_i=A_leave then send to die8 G3 r) [$ C# k8 ^, C
        else inc A_i by 1
& P+ h; v& T' K/ Q) S    end
- z+ w; ^0 |- R( cend  s1 e: p% c8 o  x

3 t( I6 p: B. j1 g  u1 w& \begin P_pick3 arriving! k/ s& `) s4 y( D7 d4 O4 F- E
    set A_i to 21
' G+ ]% f/ I9 a1 }  m0 R    move into Q_induct3' D! k: v% s/ j5 q0 N6 x
    move into pickaisle.induct3
$ n  l0 K, _" k1 ^! r/ k    while A_i<=30 do begin+ I! s& D- V1 ?- _( h' g1 c3 M! ~7 T8 r
        travel to pickaisle.con(A_i); E6 p" C! D! j) F+ ~) }+ f/ ?2 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ~* Z& e. p9 ]5 \1 ]3 Z
        else wait for 10 sec- P# S9 f7 p) n( _! |9 [
        if A_i=A_leave then send to die* g$ ~% X9 `5 G/ X  m
        else inc A_i by 1; a) [+ @4 x' X: B' u( D
    end: r/ O/ |- A( O& |' x% q
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是个什么东东?
& y( m% ^) S" f& E: F) i8 Vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ e2 J% Y. j/ z  s* h0 |; c$ b" P) v: h& A5 s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# X  s- x3 ]) v% R; X6 h6 L% e: W9 ]( B# h
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! {% Y( ~  c  @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* |4 E& P* |& R* p( d( H
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: F$ G& l  p0 q1 b* g( u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  ?  y8 M# }* V! xbegin P_induction arriving7 [; m" l8 p* Z6 [% h" U
    clone 1 load to P_pick(A_induct), I) f: }* F3 d: X0 \, ?
end最大的系" S6 W! P, K) u

9 d: B% J% W9 ~: e6 ]0 O5 \$ Ubegin P_pick arriving
, Z" X# a! m4 i5 W& d0 m& I3 M    set A_i to procindex * 10 + 1
5 }4 m$ ?. e! z7 [: h+ ^2 c    move into Q_induct(procindex)0 R# W( ?3 k/ l/ Z9 G+ t
    move into pickaisle.induct(procindex)3 b6 A9 z8 X% r2 D; @3 p
    /*check the type of pickaisle.induct(i), for your last problem.*/
- N& D2 g! D: x1 [; U/ F- e0 |5 ~; o/ E; l. d- p" L8 {* @& D5 P
    while A_i<=30 do begin
7 @% o/ {! O" D+ A9 J5 E        travel to pickaisle.con(A_i)+ c% ~3 }1 c) u+ e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' I$ r. o0 d' o  s2 [        else wait for 10 sec
+ O9 T$ C! T1 S( c; v  `' f# M        if A_i=A_leave then send to die
! m* `, g: W# Q# z( F/ {        else inc A_i by 1
9 s5 R  e1 r* O' q2 z    end
/ }- d& b, g4 F% a4 c( X/ i# aend
3 M  H4 h/ {+ D0 B' g2 i7 k
7 T  H7 q, _" k! h* ~5 B, y. L其中的procindex为整形,代表当前process的序号。
9 X3 U& J, U* [1 {' O, C$ xstation和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-18 00:24 , Processed in 0.016771 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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